jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.7 | Fund Crystals development: http://is.gd/X7PRtI | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Logs: http://irclog.whitequark.org/crystal-lang
<crystal-gh> [crystal] asterite pushed 5 new commits to master: https://git.io/vK1Kl
<crystal-gh> crystal/master 084b406 Ary Borenszweig: Reomved a bunch of TODOs and obsolete comments
<crystal-gh> crystal/master 6aba9c8 Ary Borenszweig: Compiler: flip order of Location constructor arguments, and document it
<crystal-gh> crystal/master 64a2f11 Ary Borenszweig: Compiler: a few more clean ups and docs in Program
zacts has joined #crystal-lang
zacts has left #crystal-lang ["WeeChat 1.4"]
pawnbox has joined #crystal-lang
<travis-ci> crystal-lang/crystal#00bc6fd (master - Compiler: general refactors and simplifications for better code readability and brevity): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/146528578
pawnbox has quit [Ping timeout: 264 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 264 seconds]
Kurisu_ has joined #crystal-lang
Kurisu_ has quit [Client Quit]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 272 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
ome has joined #crystal-lang
matp has quit [Remote host closed the connection]
maxpowa has quit [Ping timeout: 252 seconds]
Netfeed has quit [Ping timeout: 276 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 276 seconds]
Netfeed has joined #crystal-lang
matp has joined #crystal-lang
snsei has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
snsei has quit [Remote host closed the connection]
willl has quit [Quit: Connection closed for inactivity]
pawnbox has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 244 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 258 seconds]
onionhammer has quit [Ping timeout: 276 seconds]
onionhammer has joined #crystal-lang
dminuoso has joined #crystal-lang
dminuoso has quit [Ping timeout: 272 seconds]
dminuoso has joined #crystal-lang
dminuoso has quit [Read error: Connection reset by peer]
<FromGitter> <sdogruyol> morning all
ome has quit [Quit: Connection closed for inactivity]
dminuoso has joined #crystal-lang
dminuoso has quit [Remote host closed the connection]
dminuoso has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
mark_66 has joined #crystal-lang
slash_nick has quit [Ping timeout: 244 seconds]
FromGitter has quit [Ping timeout: 244 seconds]
FromGitter has joined #crystal-lang
slash_nick has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
dminuoso_ has joined #crystal-lang
dminuoso has quit [Ping timeout: 260 seconds]
<j2k> Hey guys, I'm getting "Invalid memory access" when passing a pointer to a C lib. Any ideas? https://gist.github.com/Vanhecke/5d7890cbca64aa604de24a215e9f8a01
<jhass> ugh, we still don't require the spaces before : in lib definitions?
<BlaXpirit> j2k, could be anything, maybe tell us about the actual library?
<BlaXpirit> Pointer(Int64) sure looks weird
<j2k> Yeah
<jhass> +1 let's see the C lib
<j2k> This is the "spawn" function
<jhass> the invalid dereference surely happens inside it
<j2k> ok
<j2k> Im probably using it wrong
<BlaXpirit> j2k, well sure you are. Target is not a pointer to int64, it's a pointer to a complex struct
<BlaXpirit> though it might pass as it's still a pointer
<jhass> yeah, dunno C ABI is potentially weird there
<jhass> type it as Pointer(Void)
<jhass> or just Void* for short
<jhass> where's exp_renameObject?
A124 has quit [Quit: '']
<j2k> that was just an example
<j2k> was trying exp_getMousePos
<BlaXpirit> j2k, give only real examples, because it's not really about crystal at this point, we need to figure out how to actually use the lib and what's going wrong
<j2k> ah ok
<j2k> Yeah I thought it was crystal so wanted to simplify it :/
<jhass> void exp_getMousePos(Target t, int &x, int &y)
<jhass> my C++ sucks, what might that look like in C?
<BlaXpirit> jhass, just int* i guess
<jhass> yeah, me too
<jhass> j2k: so try x : Int32*, y : Int32*
<BlaXpirit> and LibSmartRemote.mouse_pos(x, out pos_x, out pos_y)
<jhass> and out x, out y in the call
<BlaXpirit> >> Pointer(Void) == Void*
<DeBot> BlaXpirit: Syntax error in eval:22: expecting identifier 'end', not 'EOF' - https://carc.in/#/r/14j5
<BlaXpirit> right..
<jhass> >> Union(Pointer(Void), Void*)
<DeBot> jhass: # => Pointer(Void) - https://carc.in/#/r/14j6
<jhass> \o/
pawnbox has quit [Remote host closed the connection]
<BlaXpirit> jhass, did you see what I said yesterday? any way to force the fields within a class to appear in some particular order in memory?
<jhass> yes, I did see it
<jhass> none that I'm aware of
<BlaXpirit> why does it rearrange them anyway?
<jhass> well short of making the class have a single var that's a struct I guess
<jhass> alignment optimization I guess?
<BlaXpirit> even that could lead us to a clue
<BlaXpirit> sigh, predicting optimal alignment?
<BlaXpirit> so fragile
<BlaXpirit> well it doesn't seem to depend on the size of the preceding array so it's not exactly alignment
<jhass> it might be just however it ends up in the AST after transformations and shit
A124 has joined #crystal-lang
<BlaXpirit> does it simply put arrays at the end?
<BlaXpirit> i could store the extra data at the end of an array but the main point of the extra variables is storing references to make GC happy and not collect them
<jhass> tbh I think you simply have no guarantees atm
pawnbox has joined #crystal-lang
<j2k> Hey guys thank you :) Got it to work
<jhass> <3
<j2k> Couldn't use `out` though. The parameters needed to be initialised.
<j2k> And crystal compiler says "variable X is already defined".
<BlaXpirit> j2k, well don't define it beforehand
<j2k> I didn't - the error is just a bit weird.
<j2k> hold on
<BlaXpirit> jhass, the closest to a guarantee might be that consecutively defined variables of the same type should be consecutive in the result
<BlaXpirit> so i may need to define all the extra variables i'm going to use in the base class
<BlaXpirit> [12:05:21] <jhass> j2k: so try x : Int32*, y : Int32*
<j2k> oh sorry bad copy/paste I have that
<BlaXpirit> the command you wrote below is indeed what `out` ends up as behind the scenes
<BlaXpirit> comment* :|
<j2k> BlaXpirit: I think it does "p_x = uninitialized Int32" behind the scenes not "p_x = 0"
<BlaXpirit> probably
<jhass> no read to x or y
<jhass> so it shouldn't matter
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<RX14> why do we still have postfix rescue?
<RX14> i never even knew it existed before today
<RX14> but i think its a terrible idea
<RX14> the article from sitepoint on crystal seemed to use it
<BlaXpirit> ^
<RX14> >>raise "a" resuce nil
<DeBot> RX14: Syntax error in eval:21: unexpected token: resuce - https://carc.in/#/r/14j7
<RX14> >>raise "a" rescue nil
<DeBot> RX14: # => nil - https://carc.in/#/r/14j8
<RX14> yeah thats not nice
<RX14> i also think the sitepoint article could mention crystal play where itt alks about repl
<RX14> they're not the same
<RX14> but similar
<RX14> i do miss being able to open a repl in some random function in the middle of a webapp and execute code
<BlaXpirit> it could mention but the person clearly doesnt know about it
<RX14> but gdb does exist
<jhass> well, Crystal postfix rescue is not as terrible as Ruby's as it allows for rescue e : IO::Error e.message
<RX14> oh? thats nice
<RX14> yeah keep it then
<RX14> >> raise "" rescue e : IO::Error e.message rescue nil
<DeBot> RX14: Syntax error in eval:21: unexpected token: e - https://carc.in/#/r/14j9
<RX14> >> raise "" rescue e : IO::Error e.message
<DeBot> RX14: Syntax error in eval:21: unexpected token: e - https://carc.in/#/r/14ja
<RX14> jhass?
<jhass> well, something like it
<jhass> let me try to find it
<RX14> would be nice if it was documented.....
<BlaXpirit> seems like there's no such thing
<jhass> meh, I'm fairly sure it used to work
pawnbox has joined #crystal-lang
mose has quit [Changing host]
mose has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden pushed 3 new commits to master: https://git.io/vKMB7
<crystal-gh> crystal/master 971831f Jonne Haß: Unify String and Char to integer/float conversion API...
<crystal-gh> crystal/master 1489670 Julien Portalier: Add String#to_f(strict: false)
<crystal-gh> crystal/master da3c38e Julien Portalier: Merge pull request #3025 from jhass/to_num...
<travis-ci> crystal-lang/crystal#da3c38e (master - Merge pull request #3025 from jhass/to_num): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/146618133
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
CompanionCube has quit [Ping timeout: 264 seconds]
CompanionCube has joined #crystal-lang
CompanionCube has quit [Changing host]
CompanionCube has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
rolha has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] jhass opened pull request #3030: Add OptionParser#missing_option and OptionParser#invalid_option (master...option_parser_handlers) https://git.io/vKMwT
CompanionCube has quit [Max SendQ exceeded]
CompanionCube has joined #crystal-lang
CompanionCube has quit [Changing host]
CompanionCube has joined #crystal-lang
Oliphaunte has joined #crystal-lang
<FromGitter> <jmoriau> Hi, what is the block for in the instance method File#flock_exclusive ?: https://crystal-lang.org/api/0.18.7/File.html#flock_exclusive%28blocking%3D%3Cspanclass%3D%22n%22%3Etrue%3C%2Fspan%3E%2C%26block%29-instance-method
<FromGitter> <jmoriau> (I would like to run a block that would acquire and release the lock after)
<jhass> exactly that
<FromGitter> <jmoriau> yeah Im reading that
<FromGitter> <jmoriau> but it doesnt yield the file
<FromGitter> <jmoriau> how can I read/write to it
<jhass> well, just closure it
<FromGitter> <jmoriau> (sorry if it sounds incredibly stupid haha)
<jhass> f.flock_exclusive { f.write("hey" }
<FromGitter> <jmoriau> ah ok so I can't do it all on the same line
<FromGitter> <jmoriau> have to File.new
<FromGitter> <jmoriau> then flock
<FromGitter> <jmoriau> thanks!
<jhass> you shouldn't File.new anyway
<FromGitter> <jmoriau> ah ?
<jhass> File.open(..) {|f| f.flock_exclusive { f.write(...) } }
<FromGitter> <jmoriau> I see, thanks!
<jhass> yw
Oliphaunte has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
dminuoso_ has quit [Ping timeout: 250 seconds]
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/vKMXQ
<crystal-gh> crystal/master f6b9b0c Ary Borenszweig: Fixed #3029: incorrect restriction for module vs. Path
<crystal-gh> crystal/master 969c103 Ary Borenszweig: Fixed #3032: Proc that returns NoReturn should be compatible with a proc that returns any type
<crystal-gh> crystal/master e91a76c Ary Borenszweig: Compiler: don't use init flag for simple constants
<asterite> BlaXpirit: if you can, open an issue for the trouble you have. It's not very easy to discuss those things here, keep track of the whole conversation, use code snippets, etc.
dminuoso has joined #crystal-lang
<asterite> The issue you are having is just because the different types you can "declare" an instance variable are processed in different orders, or put in different "buckets", so the order is not preserved... but it could
pawnbox has joined #crystal-lang
<asterite> But I wouldn't rely on how the compiler lays out things, because then we couldn't do some optimizations (for example rearranging some instance vars for less memory usage)... though maybe we could have an attribute to preserve the order
<RX14> I much prefer discussing most problems in IRC because it's usually my fault and you get much faster feedback
pawnbox has quit [Ping timeout: 240 seconds]
mark_66 has quit [Quit: Leaving.]
mark_66 has joined #crystal-lang
<travis-ci> crystal-lang/crystal#969c103 (master - Fixed #3032: Proc that returns NoReturn should be compatible with a proc that returns any type): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/146651493
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
pawnbox has joined #crystal-lang
dminuoso has quit [Remote host closed the connection]
pawnbox_ has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vKMQm
<crystal-gh> crystal/master d63ebf8 Ary Borenszweig: Compiler: replace `binary` property of `If` with two booleans, and moved to semantic code
pawnbox has quit [Ping timeout: 276 seconds]
<travis-ci> crystal-lang/crystal#d63ebf8 (master - Compiler: replace `binary` property of `If` with two booleans, and moved to semantic code): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/146664699
mark_66 has quit [Quit: Leaving.]
[spoiler] has quit [Ping timeout: 272 seconds]
swav has quit [Ping timeout: 272 seconds]
[spoiler] has joined #crystal-lang
swav has joined #crystal-lang
Oliphaunte has quit [*.net *.split]
wmoxam has quit [*.net *.split]
wmoxam has joined #crystal-lang
Oliphaunte has joined #crystal-lang
pawnbox_ has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
maxpowa has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Philpax has quit [Ping timeout: 252 seconds]
paulcsmith_ has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
rolha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
paulcsmith_ has quit [Quit: Textual IRC Client: www.textualapp.com]
paulcsmith_ has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
willl has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
toydestroyer has quit [Ping timeout: 264 seconds]
fnux has quit [Ping timeout: 264 seconds]
fnux has joined #crystal-lang
toydestroyer has joined #crystal-lang
paulcsmith_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vKDd4
<crystal-gh> crystal/master 5c57213 Ary Borenszweig: Compiler: replace Dependencies with Array(ASTNode)...
<crystal-gh> crystal/master 78a7220 Ary Borenszweig: Compiler: more refactors....
<FromGitter> <jwoertink> Hey everyone. What's the general thoughts on commiting or ignoring the `libs` and `.shards` folders?
<FromGitter> <sdogruyol> ignore `libs` and `.shards`
<FromGitter> <sdogruyol> commit your `shard.lock`
<jhass> always ignore them
<jhass> shard.lock commit for apps, don't for libs
<FromGitter> <jwoertink> sweet! thanks
<FromGitter> <sdogruyol> yeah, thanks jhass :)
<FromGitter> <jwoertink> that makes sense
<travis-ci> crystal-lang/crystal#78a7220 (master - Compiler: more refactors.): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/146766191
rolha has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
<FromGitter> <jwoertink> Is the http://crystalshards.xyz site open source? There's a search issue I found. Who would I report that to?
rolha has quit [Remote host closed the connection]
rolha has joined #crystal-lang
rolha has quit [Quit: My Mac has gone to sleep. ZZZzzz…]