ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.19.4 | 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
pawnbox has joined #crystal-lang
pduncan has quit [Ping timeout: 251 seconds]
Philpax has quit [Ping timeout: 240 seconds]
pawnbox has quit [Ping timeout: 240 seconds]
Philpax has joined #crystal-lang
pduncan has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
bjz has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
snsei has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 250 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
asterite has quit [Ping timeout: 240 seconds]
asterite has joined #crystal-lang
bjz has joined #crystal-lang
zatherz has quit [Ping timeout: 248 seconds]
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
soveran has joined #crystal-lang
Philpax has quit [Ping timeout: 248 seconds]
soveran has quit [Ping timeout: 250 seconds]
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has joined #crystal-lang
Philpax has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
kulelu88 has quit [Quit: Leaving]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
eizua has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
soveran has joined #crystal-lang
Raimondii has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
Raimondi has quit [Ping timeout: 244 seconds]
Raimondii is now known as Raimondi
onethirtyfive has joined #crystal-lang
Philpax has quit [Ping timeout: 268 seconds]
djellemah has joined #crystal-lang
pawnbox has joined #crystal-lang
Philpax has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
ome has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Philpax has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
mark_66 has joined #crystal-lang
soveran_ has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<jokke> anyone care to write gpgme bindings for crystal? ;)
pawnbox has quit [Ping timeout: 260 seconds]
kochev has joined #crystal-lang
HakanD has joined #crystal-lang
pawnbox has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
djellemah has quit [Ping timeout: 260 seconds]
djellemah has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
_whitelogger has joined #crystal-lang
HakanD has joined #crystal-lang
bjz has joined #crystal-lang
kochev has quit [Ping timeout: 268 seconds]
kochev has joined #crystal-lang
HakanD has quit [Quit: Be back later ...]
soveran_ has quit [Remote host closed the connection]
HakanD has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
kochev has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
optikfluffel has joined #crystal-lang
<FromGitter> <sdogruyol> why can't i declare a struct in global scope?
<BlaXpirit> can't you?
<FromGitter> <sdogruyol> this wont work
<FromGitter> <sdogruyol> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=57fe1b0da7c618cd26049dc2]
Guest37817 has quit [Ping timeout: 250 seconds]
RX14- is now known as RX14
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
HakanD has quit [Quit: Be back later ...]
<crystal-gh> [crystal] bmmcginty opened pull request #3414: fix gets call with delimiter exactly at limit (master...io_gets) https://git.io/vPgyk
HakanD has joined #crystal-lang
HakanD has quit [Ping timeout: 260 seconds]
djellemah has quit [Ping timeout: 268 seconds]
djellemah has joined #crystal-lang
<crystal-gh> crystal/master d1b5ad4 Ary Borenszweig: String::Builder: make capacity bigger to hold string header
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vPgbJ
<crystal-gh> crystal/master a33c0c2 Ary Borenszweig: File.read: fix for zero-sized files. Fixes #3410. Closes #3411...
FromGitter has quit [Ping timeout: 240 seconds]
Philpax has quit [Ping timeout: 248 seconds]
<travis-ci> crystal-lang/crystal#a33c0c2 (master - File.read: fix for zero-sized files. Fixes #3410. Closes #3411): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/167046663
<DeBot> https://github.com/crystal-lang/crystal/issues/3410 (`File#read` does not read files located in `/proc` Linux Virtual FileSystem) | https://github.com/crystal-lang/crystal/pull/3411 (Add workaround to handle zero sized files in /proc)
snsei_ has quit [Remote host closed the connection]
snsei has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
optikfluffel has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Client Quit]
pawnbox has quit [Remote host closed the connection]
optikfluffel has joined #crystal-lang
optikfluffel has quit [Max SendQ exceeded]
HakanD has joined #crystal-lang
soveran 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
snsei_ has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
pawnbox has quit [Remote host closed the connection]
mark_66 has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
kulelu88 has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
pawnbox has quit [Ping timeout: 260 seconds]
soveran has quit [Ping timeout: 250 seconds]
ponga has joined #crystal-lang
pawnbox has joined #crystal-lang
FromGitter has joined #crystal-lang
<BlaXpirit> sorry, the bridge bot has been down for the past 2 hours
<BlaXpirit> but nobody said anything
<BlaXpirit> anyway
<BlaXpirit> i really need a crash in 1 fiber to crash the whole app
<BlaXpirit> because as it is, it just stops, and my failsafes sometimes dont work
<FromGitter> <TheLonelyGhost> @BlaXpirit written in Go?
* FromGitter * TheLonelyGhost hides from flying objects
<BlaXpirit> written in Crystal...
<FromGitter> <TheLonelyGhost> I'm still catching back up. Is the bridge open source? Can I look at the source code somewhere?
<FromGitter> <TheLonelyGhost> Wasn't sure how far we'd gotten on the concurrency front yet. Go is the only other language I know of using fibers.
<FromGitter> <raydf> @BlaXpirit, what's the longest uptime of the bot? just for curiosity :)
<BlaXpirit> TheLonelyGhost, crystal uses fibers which are currently not parallel but soon will be
<crystal-gh> [crystal] RX14 opened pull request #3416: Optimise IO::Buffered for reads 2048 <= size < 8192 (master...optimise-buffered-io) https://git.io/vP2WB
<FromGitter> <TheLonelyGhost> @BlaXpirit also, how soon does it seem like we'll get parallelism? Ruby has been saying it for years but you can't really get past the GIL on MRI.
<BlaXpirit> TheLonelyGhost, i dunno, core devs seem to be working on it. there's no such roadblock like GIL but who knows what may happen
<BlaXpirit> it'll be a big undertaking, a lot of code will need to be updated to expect parallelism
<BlaXpirit> on the other hand much code was modelled to prevent the need to update it for parallelism
<FromGitter> <raydf> @TheLonelyGhost , there's a branch https://github.com/crystal-lang/crystal/tree/thread-support.
<FromGitter> <TheLonelyGhost> @raydf will check it out. Thanks!
<FromGitter> <TheLonelyGhost> Yeah, I figured there'd be something else in the way instead of the GIL. I'm curious how Rust did parallelism and seeing if we can draw from that?
<FromGitter> <johnjansen> @BlaXpirit whats monitoring and keeping critter alive BTW ?
<FromGitter> <raydf> @BlaXpirit , thanks, it looks very stable.
<BlaXpirit> TheLonelyGhost, Rust fixes everything by being extremely strict. doesnt apply usually
<BlaXpirit> if you want an analogy, Crystal will be similar to Go
<BlaXpirit> johnjansen, uhh main monitoring is exception catching in each fiber, and systemd can restart the whole app if it crashes but it really doesnt because just individual fibers crash :(
<FromGitter> <TheLonelyGhost> Yes, but I figured many people were already looking into Go and it's not based on LLVM, if memory serves. Even if it's a dead end, I'm curious about how they handle a lot of the similar problems we're facing with Crystal. Even if certain core philosophies differ, the macroscopic path to get there might be similar.
<BlaXpirit> TheLonelyGhost, we don't even know if there are problems per se. it might be just a matter of time
<BlaXpirit> i'm sure the devs have studied what Go does and it's a relatively good approach
<BlaXpirit> namely, usually you should not have shared memory but use queue-like structures for communication between different fibers
djellemah has quit [Ping timeout: 260 seconds]
* FromGitter * TheLonelyGhost shrugs
<FromGitter> <TheLonelyGhost> Fair point
<FromGitter> <johnjansen> oh @BlaXpirit sorry (i didnt mean in your code), more like monit, bluepill or the like
<FromGitter> <raydf> In some commits of the branch it looks like the channels are already thread safe :).
<FromGitter> <johnjansen> @BlaXpirit i need to read what people write :-) systemd was the answer, sorry
<FromGitter> <TheLonelyGhost> @raydf interesting... Now I'm definitely going to have to check it out! 😊
<BlaXpirit> i was worried, but it's actually freenode that really lags right now. my bot receives and sends messages in a timely manner but sometimes i see your messages a minute later all bunched up
<FromGitter> <raydf> I haven't tried it yet :). based on history of crystal development as indicator, i believe multithreading should be initially supported in around 1-3 months, this is only speculations from me :).
<FromGitter> <raydf> After that i'm sure we'll find a lot of bugs in std libs.
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vP2BM
<crystal-gh> crystal/master 1119f02 Ary Borenszweig: Compiler: restrict else parr of an if with ||. Fixes #3266. Fixes #3412
soveran has joined #crystal-lang
<crystal-gh> [crystal] asterite closed pull request #3414: fix gets call with delimiter exactly at limit (master...io_gets) https://git.io/vPgyk
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vP203
<crystal-gh> crystal/master 56cff37 Ary Borenszweig: GC.stats: remove internal properties not exposed by boehm. Related to #3405
soveran has quit [Ping timeout: 265 seconds]
snsei_ has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<RX14> BlaXpirit, i'm pretty sure 1 fiber crashing doesn't crash the whole executable usually
pawnbox has quit [Remote host closed the connection]
soveran has quit [Remote host closed the connection]
djellemah has joined #crystal-lang
<FromGitter> <johnjansen> @raydf i thought he was saying that he wanted it to
<FromGitter> <johnjansen> although i think this is a candidate for better error handling
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<BlaXpirit> RX14, yes, and that's what sucks
<BlaXpirit> there are like 5 different unrelated exceptions that can happen at that point
<RX14> what do you mean?
<BlaXpirit> uh this is specific to my application (well any application that uses SSL sockets)
<BlaXpirit> there can be timeouts, io exceptions, ssl exceptions
<BlaXpirit> decoding exceptions
soveran has quit [Remote host closed the connection]
<BlaXpirit> you name it. fun times
<BlaXpirit> yeah who am i kidding
<RX14> yes, surely the correct solution is to either exit or retry when you raise
<BlaXpirit> did i really expect `@socket.try &.close` to never raise an exception :D
<BlaXpirit> of course it can timeout, cuz why not
pawnbox has joined #crystal-lang
<RX14> exceptions happen, if you don't handle them then it's kinda your fault
<BlaXpirit> i had 2 layers of exception handling, apparently need a 3rd one
<FromGitter> <johnjansen> @BlaXpirit i think you are swallowing the timeout error anyway … you only raise it if timeout=true and you reset it to false on every iteration
<FromGitter> <johnjansen> i think
<RX14> surely if run is in the main fiber, raising in it will exit the program?
<BlaXpirit> probably
<RX14> if it's not, then i always use rescue in a loop
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<FromGitter> <johnjansen> @RX14 check lines 82, 115 and 116 of https://github.com/BlaXpirit/critter/blob/master/irc.cr#L121
<RX14> this looks like a mess
<BlaXpirit> yep, the error handling can't be done well
<FromGitter> <johnjansen> pretty sure timeout is never true when tested
pawnbox has quit [Ping timeout: 260 seconds]
<RX14> well I meant the code in general...
<FromGitter> <johnjansen> ;-)
<RX14> I've got IO code using long-running TCP connections that hasn't failed in months in crystal
<BlaXpirit> johnjansen, nah i think it's correct, it just checks for 2 consecutive timeouts before bailing
pawnbox has joined #crystal-lang
<BlaXpirit> RX14, probably doesn't deal with freenode, huh
<RX14> deals with discord
<RX14> which is arguably worse
<FromGitter> <johnjansen> @BlaXpirit im not so sure about that
<FromGitter> <johnjansen> plus your errors never bubble up, they are all caught somewhere and then discarded
<BlaXpirit> well i am sure. after 2 consecutive timeouts on socket gets it reconnects
<FromGitter> <johnjansen> at least in `run`
<BlaXpirit> johnjansen, if they were all caught it would be fine
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
<BlaXpirit> but for the first time in like 3 months i'm pretty sure `@socket.try &.close` raised a timeout
<dom96> A quick solution would be to just set it up so that the OS automatically restarts it for you when it crashes.
<BlaXpirit> dom96, mentioned before that this cannot happen
<BlaXpirit> dom96, a fiber (a thread-like thing if you're not familiar) crashes but doesnt take the whole application with it
<BlaXpirit> which i would argue should take the whole application with it - and then i'd be fine
<dom96> oh, so the fiber crashed and your app kept running?
<BlaXpirit> yes
<dom96> hrm, tough problem.
<dom96> But I do agree with you.
<FromGitter> <johnjansen> what about calling `exit` in your rescue
<FromGitter> <johnjansen> just a thought???
<BlaXpirit> that might do it. but if I'm already catching the exception, I have ways to deal with it
<BlaXpirit> I mean generally I don't think fibers should crash silently
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vP2rT
<crystal-gh> crystal/master d3814ec Ary Borenszweig: Strong GC.stats spec
FromGitter has quit [Remote host closed the connection]
FromGitter has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<FromGitter> <johnjansen> so a concrete example is here https://play.crystal-lang.org/#/r/1c1k 1 fiber raises an error, the other keeps going
<BlaXpirit> yep
<RX14> that is kind of the point of fibers
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
RX14 has left #crystal-lang ["Leaving"]
RX14 has joined #crystal-lang
soveran has quit [Remote host closed the connection]
<FromGitter> <johnjansen> you could solve it like this https://play.crystal-lang.org/#/r/1c1l
<FromGitter> <johnjansen> oops
<FromGitter> <johnjansen> https://play.crystal-lang.org/#/r/1c1m
sooli has joined #crystal-lang
djellemah has quit [Ping timeout: 250 seconds]
pawnbox has quit [Ping timeout: 240 seconds]
djellemah has joined #crystal-lang
<travis-ci> crystal-lang/crystal#1119f02 (master - Compiler: restrict else parr of an if with ||. Fixes #3266. Fixes #3412): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/167104663
<DeBot> https://github.com/crystal-lang/crystal/issues/3266 (Type inference: strange behavior with the || operator) | https://github.com/crystal-lang/crystal/issues/3412 (bug nil check)
pawnbox has joined #crystal-lang
onethirtyfive has joined #crystal-lang
onethirtyfive has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
eizua has quit [Quit: Leaving]
HakanD has quit [Quit: Be back later ...]
HakanD has joined #crystal-lang
bmcginty has quit [Ping timeout: 260 seconds]
bmcginty has joined #crystal-lang
HakanD has quit [Ping timeout: 265 seconds]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
sooli has quit [Ping timeout: 265 seconds]
<travis-ci> crystal-lang/crystal#56cff37 (master - GC.stats: remove internal properties not exposed by boehm. Related to #3405): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/167106448
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
Ven_ has joined #crystal-lang
HakanD has joined #crystal-lang
Cyrus has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
djellemah has quit [Ping timeout: 268 seconds]
soveran has quit [Remote host closed the connection]
HakanD has quit [Quit: Be back later ...]
pawnbox has quit [Remote host closed the connection]
HakanD has joined #crystal-lang
HakanD has quit [Read error: Connection reset by peer]
HakanD has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
_whitelogger has joined #crystal-lang
djellemah has joined #crystal-lang
bjz has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
Ven_ has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
Ven_ has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
<FromGitter> <raydf> Just wanted to ask, why crystal compiles faster in macos than ubuntu?
<BlaXpirit> raydf, are you sure that's the only variable?
<FromGitter> <raydf> yes is the same macbook air
<FromGitter> <raydf> i'm dual booting and compiling the same project
<FromGitter> <raydf> the difference is around 20-30% of compile time reduction
<FromGitter> <raydf> and i compiled 10 times with cache and without it
<FromGitter> <raydf> In reality i'm using ElementaryOS rather than ubuntu
<FromGitter> <raydf> maybe that could be a difference
Ven_ has quit [Ping timeout: 240 seconds]
soveran has quit [Remote host closed the connection]
<FromGitter> <raydf> Just wanted to know if someone else has seen this behavior in another mac?
<travis-ci> crystal-lang/crystal#d3814ec (master - Strong GC.stats spec): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/167120113
bjz has quit [Ping timeout: 268 seconds]
bjz has joined #crystal-lang
Ven_ has joined #crystal-lang
Ven_ has quit [Client Quit]
_whitelogger_ has joined #crystal-lang
FromGitter has joined #crystal-lang
miketheman has quit [*.net *.split]
jeromegn has quit [*.net *.split]
<travis-ci> crystal-lang/crystal#631fdce (master - fix gets call with delimiter exactly at limit (#3414)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/167105614
<DeBot> https://github.com/crystal-lang/crystal/pull/3414 (fix gets call with delimiter exactly at limit)
jeromegn has joined #crystal-lang
miketheman has joined #crystal-lang
djellemah has quit [Ping timeout: 248 seconds]
soveran has quit [Remote host closed the connection]
<crystal-gh> [crystal] zatherz opened pull request #3417: String#index with Regex (master...feature/string_regex_index) https://git.io/vPanu
HakanD has quit [Ping timeout: 250 seconds]
HakanD has joined #crystal-lang
A124 has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
HakanD has quit [Quit: Be back later ...]
HakanD has joined #crystal-lang
HakanD has quit [Quit: Be back later ...]
HakanD has joined #crystal-lang
HakanD has quit [Ping timeout: 260 seconds]