asterite changed the topic of #crystal-lang to: #crystal-lang The Crystal programming language | http://crystal-lang.org | Crystal 0.6.0 | Paste > 3 lines of text to https://gist.github.com | GH: https://github.com/manastech/crystal - Docs: http://crystal-lang.org/docs/ - API: http://crystal-lang.org/api/ - Logs: http://irclog.whitequark.org/crystal-lang
weskinner_work has quit [Ping timeout: 272 seconds]
waj has quit [Read error: Connection reset by peer]
waj has joined #crystal-lang
havenn has joined #crystal-lang
havenwood has quit [Ping timeout: 272 seconds]
havenn has quit [Ping timeout: 245 seconds]
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
havenwood has joined #crystal-lang
waj has quit [Quit: Leaving.]
waj has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
bcardiff has joined #crystal-lang
waj has quit [Quit: Leaving.]
havenwood has quit [Remote host closed the connection]
waj has joined #crystal-lang
waj has quit [Quit: Leaving.]
weskinner_mac has joined #crystal-lang
weskinner_mac has quit [Quit: weskinner_mac]
havenwood has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
ismaelga has quit [Ping timeout: 255 seconds]
ismaelga has joined #crystal-lang
havenwood has quit []
ismaelga has quit [Ping timeout: 240 seconds]
ismaelga has joined #crystal-lang
ismaelga has quit [Ping timeout: 245 seconds]
ismaelga has joined #crystal-lang
ismaelga has quit [Ping timeout: 246 seconds]
ismaelga has joined #crystal-lang
ismaelga has quit [Ping timeout: 240 seconds]
knoopx has joined #crystal-lang
bcardiff has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
ismaelga has joined #crystal-lang
ismaelga has quit [Ping timeout: 250 seconds]
waj has joined #crystal-lang
weskinner_mac has joined #crystal-lang
weskinner_mac has quit [Quit: weskinner_mac]
ismaelga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
ismaelga has quit [Read error: Connection reset by peer]
ismaelga has joined #crystal-lang
weskinner_work has joined #crystal-lang
waj has quit [Quit: Leaving.]
<weskinner_work> I'm getting "no overload matches 'Int32#+' with types Nil"
<weskinner_work> from calling a class method with a Symbol param
<weskinner_work> " tetris.update action"
<weskinner_work> "in ./main.cr:38: instantiating 'Tetris::Game#update(Symbol)'"
<jhass> mmh, I have the feeling that the traces are incomplete sometimes
<jhass> check if you do add a (potential) nil to a number somewhere in the code descending from that method
<jhass> good candidates are instance variables, since they're nilable unless initialized in all constructors
<weskinner_work> good call
<weskinner_work> it's something inside update
<weskinner_work> " request.y += 1 while render_current_tetromino(request)"
bcardiff has joined #crystal-lang
<weskinner_work> converting into to long while form fixed it
<jhass> mmh, might be a bug
<weskinner_work> this form works as well
<weskinner_work> (request.y += 1) while render_current_tetromino(request)
waj has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
ismaelga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
<weskinner_work> how can I set a Void* member of a struct to nil?
<weskinner_work> "in ./game.cr:91: field 'data1' of struct LibSDL2::UserEvent has type Pointer(Void), not Nil"
ismaelga has joined #crystal-lang
ismaelga has quit [Remote host closed the connection]
<jhass> yeah, bug IMO
<jhass> another thing that IMO should work, so maybe open an issue for that too
<jhass> but assigning Pointer(Void).null should work
<weskinner_work> word
ismaelga has joined #crystal-lang
havenwood has joined #crystal-lang
bcardiff has quit [Quit: Leaving.]
ismaelga has quit [Remote host closed the connection]
shama has joined #crystal-lang
<travis-ci> manastech/crystal#2063 (master - f96c8d6 : Ary Borenszweig): The build is still failing.
ismaelga has joined #crystal-lang
<weskinner_work> will hopefully have my Tetris port finished up this weekend :)
<jhass> nice!
knoopx has quit [Remote host closed the connection]
asterite has joined #crystal-lang
<asterite> Did someone say tetяis?
<asterite> jhass: your problem with ssl was that you got a nil failed assertion after some time?
<asterite> I mean, "hello" :)
<jhass> hi :D
<jhass> yeah, pretty reproducably in the program when doing a second request to the github API with the same HTTP::Client instance after the timeout, iirc
<jhass> though at this point I wouldn't even be sure if that wasn't just another side effect of the memory corruption
<asterite> I don't think so. I'm hitting the slack api, wait 30 seconds, hit again and I get that nil assertion failed
<jhass> ah, at least something :P
<asterite> And it's consistent :)
<jhass> I tested with google and couldn't reproduce
<asterite> I have no idea why, but waj did that ssl thing, so I guess he'll have the answer
<asterite> So, apparently the connection is kept open and the server must be closing it after some time, but we don't check if it was closed before doing a request
<jhass> still weird that that turns something into nil
<jhass> I expected some Errno in that case
<jhass> "trying to read from closed socket", something like that
<jhass> oh
<jhass> mmh
<asterite> Below you can see "unexpected end of http response" being raised
<asterite> but there it's just doing not_nil!
<jhass> still, gets on a closed socket should raise Errno
ismael__ has joined #crystal-lang
ismael__ has quit [Remote host closed the connection]
<asterite> It also happens on http, not only https
<asterite> Here's a way to reproduce it: https://gist.github.com/asterite/0cbdb17ccf9eb91414af :)
ismaelga has quit [Ping timeout: 246 seconds]
<asterite> Hmm… apparently you can detect when a socket was closed if, when you read, it returns 0
<asterite> "Upon reading end-of-file, zero is returned"
<asterite> I wonder what Ruby does in that case
<jhass> let's dig it out
<jhass> http://rxr.whitequark.org/mri/search is useful for that ;)
havenwood has quit [Remote host closed the connection]
<asterite> That program runs in ruby and crystal :)
<asterite> In ruby it says "broken pipe" when writing, in Crystal it crashes… not very good :)
<jhass> yeah, ruby does all kind of checks all over the place
weskinner_mac has joined #crystal-lang
weskinner_mac has quit [Quit: weskinner_mac]
waj has quit [Quit: Leaving.]
bcardiff has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: http://git.io/xqba
<crystal-gh> crystal/master 2f7d39e Ary Borenszweig: Fixed: calls weren't recomputed when subclasses were added to virtual metclasses
<travis-ci> manastech/crystal#2064 (master - 2f7d39e : Ary Borenszweig): The build is still failing.
bcardiff has quit [Quit: Leaving.]
bcardiff has joined #crystal-lang
<jhass> yay llvm 3.6 is out!
<tymat> RIP Spock
waj has joined #crystal-lang
<asterite> jhass: yes! No more strange crashs on mac :)
<asterite> But we'll have to wait a bit until it's on homebrew, and I guess on other systems too
<asterite> The bad things is that they changed the debug IR in 3.6… and they changed it again in 3.7 :/
<jhass> yeah, I tempted to try if it fixes my issue too, but then compiling LLVM takes forever...
<jhass> well, I think it's fair to stay only with the latest llvm release compatible until 1.0
<asterite> Wow, there will be a 1.0? :)
<jhass> somewhere in the future :P
<asterite> I hope, hehe
<jhass> we probably have to figure out a way to write bindings compatible with different ABI versions anyway before we reach that point
<asterite> You mean, regarding llvm?
<jhass> in general really
<jhass> the simple approach would be making the library version that's going to be linked at available as a ifdef flag
<jhass> though maybe we can find something that leads to less spaghetti
<travis-ci> manastech/crystal#2062 (master - febda50 : Ary Borenszweig): The build is still failing.
<asterite> Oh, you mean, make crystal compatible with many llvm versions?
<asterite> I'll try to stick with one version
<jhass> that is something I wouldn't bother with before 1.0, yeah
<asterite> "I tempted to try if it fixes my issue too" -> what issue you have?
<jhass> but in general, we'll need a way to write bindings that are compatible many ABI versions in the long term
<jhass> the segfault?
<asterite> What segfault?
<weskinner_work> is there any kind of syntactic sugar for struct member initialization?
<weskinner_work> like C has the "{1, 3, NULL}" syntax
<asterite> Yes, use named arguments
<asterite> That is, for C structs
<weskinner_work> ah! cool
<asterite> It's something special for C strutcts/unions, but I think it makes writing bindings a lot easier
<asterite> I wonder if we should rename "colorize" to "bash_colors"… if at one point we want to add color-related functions it will be a bit confusing :)
<jhass> ANSIColor.red(string) ?
<jhass> or even ANSICode
<jhass> bash is a bad name, it's a property of the terminal, not the shell
bcardiff has quit [Quit: Leaving.]
asterite has quit [Quit: Leaving.]
waj has quit [Quit: Leaving.]
waj has joined #crystal-lang
asterite has joined #crystal-lang
bcardiff has joined #crystal-lang
asterite has quit [Read error: Connection reset by peer]
asterite has joined #crystal-lang
asterite has quit [Client Quit]
bcardiff has quit [Quit: Leaving.]
waj has quit [Quit: Leaving.]
weskinner_work has quit [Ping timeout: 264 seconds]
r20 has joined #crystal-lang
r20 has quit [Client Quit]
waj has joined #crystal-lang