jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.18.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
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zodiak has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 272 seconds]
matp has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
matp has joined #crystal-lang
paulcsmith_ has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
paulcsmith_ has quit [Quit: Textual IRC Client: www.textualapp.com]
fedruantine has quit [Max SendQ exceeded]
pawnbox has joined #crystal-lang
Raimondii has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
mgarciaisaia has joined #crystal-lang
mgarciaisaia has quit [Read error: Connection reset by peer]
snsei has joined #crystal-lang
Oliphaunte has joined #crystal-lang
soveran has joined #crystal-lang
sp4rrow has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Oliphaunte has joined #crystal-lang
soveran has quit [Ping timeout: 276 seconds]
zodiak_ has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
<crystal-gh> [crystal] waj pushed 1 new commit to master: https://git.io/voDPh
<crystal-gh> crystal/master e1d2fcd Juan Wajnerman: Use secure HTTPS calls to download packages (closes #1922)
pawnbox has quit [Ping timeout: 244 seconds]
zodiak has quit [Ping timeout: 260 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#e1d2fcd (master - Use secure HTTPS calls to download packages (closes #1922)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/139933495
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 276 seconds]
Oliphaunte has joined #crystal-lang
<FromGitter> <jwoertink> Out of curiosity, why is there no String#length?
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Remote host closed the connection]
soveran has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 264 seconds]
zodiak has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
zodiak_ has quit [Ping timeout: 276 seconds]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
ponga has joined #crystal-lang
snsei has quit [Remote host closed the connection]
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei 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]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Client Quit]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
pawnbox has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
<BlaXpirit> jwoertink, because aliases are not wanted; .size is used
snsei has quit [Remote host closed the connection]
sp4rrow has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 258 seconds]
<FromGitter> <sdogruyol> :+1: for size
<FromGitter> <ttdonovan> New to Crystal but have been working with Ruby for many years - as my introduction to Crystal I’m attempting to port over a few of the dry-rb gems. Coming from a dynamicly interpreted language I’ve struggled a bit with understanding how to do things the Crystal way. If anyone have feedback or would like to help it would greatly be appreciated https://github.com/dry-cr. Thanks.
<FromGitter> <sdogruyol> @ttdonovan welcome!
<FromGitter> <sdogruyol> nice job on porting those :+1:
<FromGitter> <ttdonovan> I like what the dry-rb community is doing and wanted to share the love with Crystal. They are far from complete with plenty of TODOs but hoping others might get invovled so I can learn from them as well.
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
zodiak_ has joined #crystal-lang
zodiak has quit [Ping timeout: 258 seconds]
<FromGitter> <sdogruyol> That's great to hear
<FromGitter> <sdogruyol> @ttdonovan are you enjoying Crystal yet?
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 264 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 258 seconds]
qard has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox_ has joined #crystal-lang
pawnbox has quit [Ping timeout: 258 seconds]
bjz has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 252 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bjz has joined #crystal-lang
pawnbox_ has quit [Remote host closed the connection]
trapped has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 244 seconds]
trapped has quit [Read error: Connection reset by peer]
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 250 seconds]
pawnbox has joined #crystal-lang
qard has joined #crystal-lang
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] michaeldesu opened pull request #2901: Minor changes as per email in google groups (gh-pages...gh-pages) https://git.io/voyGb
<crystal-gh> [crystal] michaeldesu opened pull request #2902: Update client.cr (master...patch-1) https://git.io/voynE
<crystal-gh> [crystal] jhass pushed 1 new commit to master: https://git.io/voynV
<crystal-gh> crystal/master c674cbe Jonne Haß: Merge branch 'release/0.18'
<crystal-gh> [crystal] jhass closed pull request #2902: Update client.cr (master...patch-1) https://git.io/voynE
<crystal-gh> [crystal] jhass closed pull request #2901: Minor changes as per email in google groups (gh-pages...gh-pages) https://git.io/voyGb
Oliphaunte has joined #crystal-lang
Oliphaunte has quit [Ping timeout: 246 seconds]
<travis-ci> crystal-lang/crystal#c674cbe (master - Merge branch 'release/0.18'): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/140003970
<travis-ci> crystal-lang/crystal#7074b28 (release/0.18 - Update client.cr): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/140003991
Oliphaunte has joined #crystal-lang
ponga has quit []
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
<crystal-gh> [crystal] beanieboi opened pull request #2903: adding gmp to docker images (master...gmp-dockerfile) https://git.io/voyEO
snsei has joined #crystal-lang
pochito has joined #crystal-lang
Oliphaunte has quit [Remote host closed the connection]
Oliphaunte has joined #crystal-lang
trapped has joined #crystal-lang
trapped has quit [Read error: Connection reset by peer]
franzejr_ has joined #crystal-lang
franzejr_ has quit [Client Quit]
Oliphaunte has quit [Remote host closed the connection]
Raimondii has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii is now known as Raimondi
Oliphaunte has joined #crystal-lang
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
onec has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voySi
<crystal-gh> crystal/master 1fd3ce7 Ary Borenszweig: Merge branch 'release/0.18'
pochito has quit [Ping timeout: 246 seconds]
tomchapin has joined #crystal-lang
64MAAIAT7 has joined #crystal-lang
Raimondii has joined #crystal-lang
Raimondi^1 has joined #crystal-lang
Raimondi has quit [Ping timeout: 240 seconds]
Raimondii has quit [Ping timeout: 240 seconds]
ysbaddaden has joined #crystal-lang
ysbaddaden has quit [Client Quit]
ysbaddaden has joined #crystal-lang
Raimondi^1 is now known as Raimondi
Raimondi is now known as Raimondii
<ysbaddaden> hello, I'm trying to hack HTTP2 support into HTTP::Server, but all I get is: "constant WHATEVER requires initialization of HTTP2::WHATEVER, which is initialized later" because of an IO ;-(
<ysbaddaden> the only solution I see is "get rid of all constants" but that's not gonna happen
<jhass> huh, not sure I follow
<ysbaddaden> I need an IO object in HTTP::Server::Response to write to he HTTP2 streams
<ysbaddaden> problem is, whenever I create such an IO object, it depends on HTTP2::Stream that in turn depends on all HTTP2/HPACK constants
<ysbaddaden> but crystal tries to resolve constants and all IO classes at the same time, and eventually fails
<ysbaddaden> constant OpenSSL::BIO::CRYSTAL_BIO requires initialization of HTTP2::DEFAULT_MAX_FRAME_SIZE, which is initialized later. Initialize HTTP2::DEFAULT_MAX_FRAME_SIZE before OpenSSL::BIO::CRYSTAL_BIO
<jhass> Is there some code to poke at?
onec has quit [Remote host closed the connection]
<ysbaddaden> if I hack CRYSTAL_BIO to be a @@crystal_bio, then it fails with "constant Logger::DEFAULT_FORMATTER requires initialization of HTTP2::DEFAULT_MAX_FRAME_SIZE" and so on
<ysbaddaden> I didn't push anything, yet
Raimondii is now known as Raimondi
triangles has joined #crystal-lang
<ysbaddaden> I wish @asterite had kept the "constants are always initialized first" change
<j2k> Seems to be a problem with ECR.embed. Is the issue known?
<jhass> j2k: mh?
<j2k> ooh wait
<ysbaddaden> the problem is having an IO class writing to a HTTP2::Stream, because all of a sudden whatever depends on an IO type also depends on HTTP2::Stream which in turn depends on everything under HTTP2
<travis-ci> crystal-lang/crystal#1fd3ce7 (master - Merge branch 'release/0.18'): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/140052619
<ysbaddaden> Crystal fails resolving constants that depend on IO (eg: CRYSTAL_BIO, Logger::FORMATTER, and most certainly STDOUT, ...) because it requires other constants to be already resolved
<FromGitter> <ttdonovan> @sdogruyol yes I'm enjoying it greatly, the Ruby-like syntax has made it easy to get started - just need to better understand a few other concepts when working with a static typed and complied language
<FromGitter> <sdogruyol> @ttdonovan that's great to hear and I am pretty sure that you gonna love it more and more :) Having a compiler is great
<j2k> jhass: it was my own stupidity
Philpax has quit [Ping timeout: 276 seconds]
<jhass> ysbaddaden: maybe we can do a first pass that initializes them for all primitives, tuple, named tuple, int's, float's, bool, char, perhaps string
<jhass> should even be okay to do proc
pochito has joined #crystal-lang
ysbaddaden has quit [Ping timeout: 250 seconds]
snsei has quit [Remote host closed the connection]
<asterite> oh, he's gone. I'll try to fix it, I was going to do it for 0.19 but maybe I can do it for 0.18.5
<asterite> jhass: did ysbaddaden leave a note on how to reproduce the problem? I checked out the branch and everything works fine
<jhass> asterite: run h.cr
<asterite> ah, good
<asterite> I think there's a check in the compiler that's old now... because recursive constant definition check is already done in a different place, and constants are either lazily initialized or initialized when the codegen reaches the line when they are initialized
<asterite> I removed that check and now it compiles... I'll run a few more tests to see if something breaks, but I think I can fix it for 0.18.5 \o/
<jhass> \o/
ysbaddaden has joined #crystal-lang
<ysbaddaden> @asterite thanks \o/
Raimondii has joined #crystal-lang
<asterite> ysbaddaden: I think the issue is more or less this: https://github.com/crystal-lang/crystal/issues/2906
<asterite> where Foo is some type including IO
Raimondi has quit [Ping timeout: 240 seconds]
<ysbaddaden> Yes, I think so.
sp4rrow has joined #crystal-lang
Raimondii is now known as Raimondi
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voSTk
<crystal-gh> crystal/master c49f41a Ary Borenszweig: Merge branch 'release/0.18'
<asterite> ysbaddaden: I just pushed the change to master and release/0.18 , please check if now the code compiles for you
<ysbaddaden> asterite: yes, it compiled \o/
<asterite> awesome! It's an error I dreaded for a long time :-)
<ysbaddaden> now, HTTP::Server is talking with nghttp2, thought I have some new issues (like header names must be lowercased now)
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jhass> ysbaddaden: we probably should normalize http 1 headers to http 2 headers
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voSkK
<crystal-gh> crystal/master 9cf6e06 Ary Borenszweig: Merge branch 'release/0.18'
<jhass> that is HTTP::Headers should internally store the http 2 normalized variant, allow fetch via both and have "to_h" that outputs with HTTP 1 formatting
<ysbaddaden> for now, I made HPACK lowercase the header name... and it works \o/
<ysbaddaden> that depends on what's more frequent: HTTP1 or HTTP2, the later isn't very available, yet
<jhass> well I guess it's easy to change at some point
<ysbaddaden> yup
<jhass> but it should handle both and have "output modes" for either
<jhass> and I'd make the http2 variant the recommended client code access variant already
64MAAIAT7 has quit [Remote host closed the connection]
<BlaXpirit> don't be ridiculous
<jhass> recommended != only possible
pawnbox has joined #crystal-lang
<travis-ci> crystal-lang/crystal#c49f41a (master - Merge branch 'release/0.18'): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/140075821
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
A124 has quit [Ping timeout: 244 seconds]
Oliphaunte has quit [Remote host closed the connection]
tomchapin has joined #crystal-lang
Oliphaunte has joined #crystal-lang
<ysbaddaden> Alright, I can receive and reply to HTTP2 requests with HTTP::Server
<jhass> <3
A124 has joined #crystal-lang
<ysbaddaden> I have yet to verify that current handlers are working too
grindhold has quit [Quit: No Ping reply in 180 seconds.]
<ysbaddaden> and to hack HTTP::Request since the incoming body is streamed
tomchapin has quit [Client Quit]
grindhold has joined #crystal-lang
steenuil has quit [Ping timeout: 246 seconds]
<ysbaddaden> thanks again for fixing my issue asterite!
ysbaddaden has quit [Quit: Page closed]
<travis-ci> crystal-lang/crystal#012808a (release/0.18 - Fixed #2906: Allow using constant before its declared): The build is still failing. https://travis-ci.org/crystal-lang/crystal/builds/140075838
Oliphaunte has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#a11133f (release/0.18 - Codegen: memzero native array_malloc): The build was fixed. https://travis-ci.org/crystal-lang/crystal/builds/140077776
steenuil has joined #crystal-lang
sp4rrow has joined #crystal-lang
<travis-ci> crystal-lang/crystal#9cf6e06 (master - Merge branch 'release/0.18'): The build was fixed. https://travis-ci.org/crystal-lang/crystal/builds/140077783
<j2k> How can I declare something nilable?
<j2k> ah found it, just add ? or | ::nil
<BlaXpirit> j2k, yes. well actually it's Nil, and you usually don't need ::
Oliphaunte has joined #crystal-lang
<j2k> Loving this language guys
<adam12> :)
<j2k> thank you for all the effort guys
<j2k> Checked it out first time last summer. Didn't expect to come back and find this
Oliphaunte has quit [Ping timeout: 250 seconds]
Oliphaunte has joined #crystal-lang
pochito has quit [Ping timeout: 258 seconds]
<j2k> this union thing is hard :(
<BlaXpirit> it's innovative and awesome though
<j2k> Why am I getting this?
<j2k> i set it as "getter user : User?"
<j2k> and "property! user : User?"
<BlaXpirit> j2k, hm I don't understand this
<jhass> j2k: sounds like you do context.user = User instead of context.user = User.new
<BlaXpirit> ah, probably
<j2k> ah probably
<jhass> calling both, getter and property! is rather pointless btw
<jhass> the latter just overrides the former
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voScS
<crystal-gh> crystal/master fd9bd6f Ary Borenszweig: Merge branch 'release/0.18'
<travis-ci> crystal-lang/crystal#fd9bd6f (master - Merge branch 'release/0.18'): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/140097226
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
Oliphaunte has quit []
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
tomchapin has joined #crystal-lang
sp4rrow has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voS2U
<crystal-gh> crystal/master ecf8487 Ary Borenszweig: Merge branch 'release/0.18'
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
bcardiff has joined #crystal-lang
bcardiff has quit [Client Quit]
<travis-ci> crystal-lang/crystal#ecf8487 (master - Merge branch 'release/0.18'): The build was fixed. https://travis-ci.org/crystal-lang/crystal/builds/140112661
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<travis-ci> crystal-lang/crystal#78b8ee4 (release/0.18 - Fixed LibC.write call when Fiber catches an unhandled exception): The build was fixed. https://travis-ci.org/crystal-lang/crystal/builds/140112674
sp4rrow has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter> <anlek> Hey guys, is there an event machine like system for Crystal (similar to http://rubyeventmachine.com/)?
<jhass> @anlek Crystal's IO is invented by default
<FromGitter> <anlek> invented?
<jhass> eh sorry, evented
<FromGitter> <anlek> @jhass, interested, how would one use it via HTTP?
<jhass> HTTP::Server by default spawns a coroutine for each client connection
<jhass> HTTP::Client you can safely use inside spawn
<jhass> well, multiple instances of it anyway
<FromGitter> <anlek> Hmm, I am having a hard time wrapping my head around my problem and fit to HTTP::Client. I'm looking for something similar to: https://github.com/AF83/em-eventsource (as my source is using this along with EventMachine)
<FromGitter> <anlek> I wonder if that would just be an HTTP::Client. So http::client == EventMachine::EventSource.new("http://example.com/streaming")
<jhass> just read from it in your main fiber (the toplevel) and spawn new fibers to process the responses
<FromGitter> <anlek> hahah, totally, except my knowledge of fibers is... well... let's just say low :)
<jhass> or keep a pool of fibers to process the responses and send them new work over a channel
<jhass> read the document I linked you ;)
<FromGitter> <anlek> Will do! I'll reach out if I get a bit closer (or really stuck). Thanks for your time!
<jhass> so from a quick look you just event = parse_event(response.body_io.gets("\r\n\r\n")); spawn process_event(event)
<FromGitter> <anlek> And this is inside the HTTP::Client, yes?
<jhass> yes, inside a get() do end
<jhass> The stream must then be parsed by reading everything line by line, with a U+000D CARRIAGE RETURN U+000A LINE FEED (CRLF) character pair, a single U+000A LINE FEED (LF) character not preceded by a U+000D CARRIAGE RETURN (CR) character, and a single U+000D CARRIAGE RETURN (CR) character not followed by a U+000A LINE FEED (LF) character being the ways in which a line can end.
<jhass> ugh, common W3C
<FromGitter> <anlek> Cool, thanks! :)
<jhass> so since both, lf and crlf is valid you have to read line by line and aggregate until you see a blank line :/
<jhass> might be actually fastest to keep the lines of each event in an array then actually
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<FromGitter> <anlek> hehe, I'll see what I get in from the service
<crystal-gh> [crystal] ysbaddaden opened pull request #2909: OpenSSL: get selected ALPN protocol (master...openssl-get-alpn-selected) https://git.io/voSSn
srabuini has joined #crystal-lang
soveran has joined #crystal-lang
sebasr has quit [Ping timeout: 272 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
<crystal-gh> [crystal] jhass pushed 2 new commits to master: https://git.io/voSHo
<crystal-gh> crystal/master 97011f3 Julien Portalier: OpenSSL: get selected ALPN protocol
<crystal-gh> crystal/master 2f7ad67 Jonne Haß: Merge branch 'release/0.18'
<crystal-gh> [crystal] jhass closed pull request #2909: OpenSSL: get selected ALPN protocol (master...openssl-get-alpn-selected) https://git.io/voSSn
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voS7s
<crystal-gh> crystal/master 0041ed9 Ary Borenszweig: Merge branch 'release/0.18'
Redfoxmoon has quit [Ping timeout: 250 seconds]
<travis-ci> crystal-lang/crystal#2f7ad67 (master - Merge branch 'release/0.18'): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/140140211
<travis-ci> crystal-lang/crystal#ecdcea9 (release/0.18 - Fixed #2908: better handling of errors in HTTP::Server): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/140143439
bcardiff has joined #crystal-lang
<travis-ci> crystal-lang/crystal#0041ed9 (master - Merge branch 'release/0.18'): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/140143444
<jhass> haha, it's not Ary's day I guess :P
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 252 seconds]
soveran has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/voSbG
<crystal-gh> crystal/master a8dc441 Ary Borenszweig: Merge branch 'release/0.18'
jadams has joined #crystal-lang