jhass changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.13.0 | 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
emancu has joined #crystal-lang
Raimondi has quit [Quit: The road to wisdom?—Well, it's plain and simple to express: Err and err and err again, but less and less and less. — Piet Hein]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
sp4rrow has joined #crystal-lang
sp4rrow has quit [Quit: Textual]
fowlduck has quit [Remote host closed the connection]
fowlduck has joined #crystal-lang
krtv` has quit [Ping timeout: 244 seconds]
Philpax has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
krtv` has joined #crystal-lang
Philpax has quit [Ping timeout: 248 seconds]
Philpax has joined #crystal-lang
plukevdh has joined #crystal-lang
plukevdh has quit [Client Quit]
plukevdh has joined #crystal-lang
shama has quit [Quit: (╯°□°)╯︵ɐɯɐɥs]
zeno_ has joined #crystal-lang
plukevdh has quit [Ping timeout: 264 seconds]
Philpax has quit [Ping timeout: 260 seconds]
A124 has quit [Quit: '']
A124 has joined #crystal-lang
vonKingsley 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
fowlduck has quit [Remote host closed the connection]
zeno_ has quit [Quit: 离开]
pawnbox has quit [Ping timeout: 244 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Philpax has joined #crystal-lang
pawnbox has joined #crystal-lang
_whitelogger_ has joined #crystal-lang
_whitelogger has quit [Remote host closed the connection]
Philpax has quit [Ping timeout: 260 seconds]
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 276 seconds]
<crystal-gh> [crystal] marcosdsanchez opened pull request #2286: Fix BitArray#toggle documentation (master...marcosdsanchez-patch-1) https://git.io/vaT2U
trapped has joined #crystal-lang
Philpax has joined #crystal-lang
vonKingsley has quit [Ping timeout: 252 seconds]
fka_ has joined #crystal-lang
bjmllr has quit [Ping timeout: 264 seconds]
Philpax has quit [Read error: No route to host]
bjmllr has joined #crystal-lang
Philpax has joined #crystal-lang
mondok has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<crystal-gh> [crystal] jhass closed pull request #2286: Fix BitArray#toggle documentation (master...marcosdsanchez-patch-1) https://git.io/vaT2U
trapped has quit [Read error: Connection reset by peer]
<travis-ci> crystal-lang/crystal#01d7d0c (master - Merge pull request #2286 from marcosdsanchez/marcosdsanchez-patch-1): The build was fixed. https://travis-ci.org/crystal-lang/crystal/builds/114725003
alsm has joined #crystal-lang
elia has joined #crystal-lang
umurgdk has joined #crystal-lang
mondok has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
umurgdk has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
mondok has joined #crystal-lang
umurgdk has joined #crystal-lang
umurgdk has quit [Remote host closed the connection]
umurgdk 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
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
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
mondok has quit [Ping timeout: 268 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 [Remote host closed the connection]
umurgdk has quit [Remote host closed the connection]
mondok has joined #crystal-lang
pawnbox has joined #crystal-lang
umurgdk has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
mondok has quit [Quit: Leaving]
A124 has quit [Disconnected by services]
A124 has joined #crystal-lang
daemonwrangler_ has joined #crystal-lang
umurgdk has quit [Ping timeout: 240 seconds]
daemonwrangler has quit [Ping timeout: 240 seconds]
jokke has quit [Ping timeout: 240 seconds]
maxpowa has quit [Ping timeout: 240 seconds]
daemonwrangler_ is now known as daemonwrangler
trapped has joined #crystal-lang
maxpowa has joined #crystal-lang
krtv` has quit [Ping timeout: 244 seconds]
jokke has joined #crystal-lang
pawnbox has joined #crystal-lang
krtv` has joined #crystal-lang
umurgdk has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
umurgdk has quit [Remote host closed the connection]
umurgdk has joined #crystal-lang
pawnbox has joined #crystal-lang
Philpax has quit [Ping timeout: 250 seconds]
umurgdk has quit [Remote host closed the connection]
fka_ has quit [Remote host closed the connection]
fka_ has joined #crystal-lang
<crystal-gh> [crystal] ysbaddaden closed pull request #2267: Add FileUtils#cp (master...fileutils_cp) https://git.io/v2daY
<travis-ci> crystal-lang/crystal#59de758 (master - Merge pull request #2267 from Dreauw/fileutils_cp): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/114802217
<travis-ci> crystal-lang/crystal#59de758 (master - Merge pull request #2267 from Dreauw/fileutils_cp): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/114802217
umurgdk has joined #crystal-lang
umurgdk has quit [Remote host closed the connection]
luislavena has joined #crystal-lang
umurgdk has joined #crystal-lang
umurgdk has quit [Ping timeout: 260 seconds]
emancu has quit []
umurgdk 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
umurgdk has quit [Remote host closed the connection]
umurgdk has joined #crystal-lang
umurgdk has quit [Ping timeout: 240 seconds]
umurgdk has joined #crystal-lang
sooli has joined #crystal-lang
umurgdk has quit [Remote host closed the connection]
umurgdk has joined #crystal-lang
tomchapin has joined #crystal-lang
shama has joined #crystal-lang
umurgdk has quit []
sooli has quit [Ping timeout: 248 seconds]
<crystal-gh> [crystal] asterite pushed 2 new commits to master: https://git.io/vaIrP
<crystal-gh> crystal/master fddb151 Ary Borenszweig: Added some type annotations on instance vars
<crystal-gh> crystal/master 89be6d5 Ary Borenszweig: Compiler: fixed a couple of issues with non generic module types
krtv` has quit [Ping timeout: 246 seconds]
pawnbox has quit [Remote host closed the connection]
alsm has quit [Ping timeout: 244 seconds]
pawnbox has joined #crystal-lang
krtv` has joined #crystal-lang
elia has quit [Quit: Computer has gone to sleep.]
<travis-ci> crystal-lang/crystal#89be6d5 (master - Compiler: fixed a couple of issues with non generic module types): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/114843708
fka_ has quit [Remote host closed the connection]
<crystal-gh> [crystal] asterite pushed 3 new commits to master: https://git.io/vaI5b
<crystal-gh> crystal/master e6529a7 Potapov Sergey: Implement Array#first(n : Int) and Array#last(n : Int)
<crystal-gh> crystal/master bb65c05 Potapov Sergey: Update doc for Array#first(n) and #last(n)
<crystal-gh> crystal/master 6f87300 Ary Borenszweig: Merge pull request #2281 from greyblake/array-first-n...
fka_ has joined #crystal-lang
shadeslayer has quit [Ping timeout: 252 seconds]
shadeslayer has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vaINF
<crystal-gh> crystal/master ac46f8c Ary Borenszweig: Rename `take` to `first`. Related to #2281
<travis-ci> crystal-lang/crystal#6f87300 (master - Merge pull request #2281 from greyblake/array-first-n): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/114856786
umurgdk has joined #crystal-lang
tomchapin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
umurgdk_ has joined #crystal-lang
umurgdk has quit [Ping timeout: 264 seconds]
kfpratt has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
luislavena has quit [Quit: Leaving]
fka_ has quit [Remote host closed the connection]
tomchapin has joined #crystal-lang
shadowbram has joined #crystal-lang
tomchapin has quit [Quit: Textual IRC Client: www.textualapp.com]
A124 has quit [Quit: '']
A124 has joined #crystal-lang
Philpax has joined #crystal-lang
kfpratt has joined #crystal-lang
shadowbram has quit [Remote host closed the connection]
Philpax has quit [Ping timeout: 248 seconds]
perks has joined #crystal-lang
fka_ has joined #crystal-lang
<perks> anyone know how to poll a websocket for incomming messages? looking at the specs I can't really seem to figure out how I would do that
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
<BlaXpirit> perks, Crystal does not have websocket in its standard library.
<ldlework> for a minute I was super impressed
<BlaXpirit> ldlework, nothing to be impressed about. the contrary even, because websockets should not be in standard library
<BlaXpirit> perks, wow I'm mistake
<BlaXpirit> n
<BlaXpirit> perks, instead of polling you use on_message
<perks> yeah I tried passing a proc literal that just printed out the string return
<BlaXpirit> perks, uh actually looks like you're meant to subclass it
<BlaXpirit> did you try that?
<perks> Oh not yet
<perks> Sorry, comming from a non ruby background so some of the conventions I guess (especially with the syntax) escape me sometimes
<BlaXpirit> perks, hah I'm mistaken yet again
<perks> It looks like maybe I call the run() function after setting up on_message
<BlaXpirit> this is so confusing... the empty body of on_message makes me think that you need to subclass it
<BlaXpirit> but actually the function is not no-op
<BlaXpirit> calling on_message with a proc sets an instance variable
<perks> oh yeah
<perks> when you instantiate the class it creates a buffer
<perks> and i guess when it recieves incomming msg it call on_message on the buffer that parsed the incomming response
<BlaXpirit> perks, anyway, the syntax is ws.on_message do |s| puts s end
<perks> now just gotta figure out how to do threads(fibers?)
<perks> thanks BlaXpirit
<BlaXpirit> but I can't check it cuz i have no idea what these websockets are
<perks> yeah it worked!
<BlaXpirit> perks, and do you want to run this websocket so that it doesnt block the rest of your program?
<perks> yeah that was the next step
<BlaXpirit> spawn &ws.run
<perks> with a spawn do block?
<BlaXpirit> perks, well this &thing replaces a block
<BlaXpirit> spawn do ws.run end
<BlaXpirit> or spawn &ws.run
<BlaXpirit> is the same
<perks> ahh
<perks> that causes the program to exist
<BlaXpirit> perks, well yeah it's like in the background but the main "thread" ends so it exits
<perks> ahh
<perks> is there anyway to do I guess like Thread joining and closing?
<BlaXpirit> perks, I wish I could remember
<perks> I know my terminology is off, but maybe there are some docs on general concurrency, parallleism
<BlaXpirit> perks, note that everything runs in 1 thread currently
<perks> Ahh so more of async/event loopish type deal
<BlaXpirit> perks, the concurrency model is planned to be similar to Go
<BlaXpirit> async/await is explicit context switching, but in crystal it can happen in any function that allows context to switch
<perks> ahhh
<perks> I guess Channels are then similar to queues in other languages
<BlaXpirit> perks, quite similar
<perks> mostly just picking up from snippets on the issues tracker haha
<perks> okay, thanks ill start playing around with this!
<BlaXpirit> perks, https://gist.github.com/Kilobyte22/e51a6b16703694f861a3 this is the only large enough piece of info that i know
<BlaXpirit> and it still doesnt explain a way to wait for a fiber, and i can't find it
<perks> oh thats an awesome doc
<perks> wait is this not on the main wiki haha
<BlaXpirit> it's okay, just something someone write hastily
<perks> thanks again!
trapped_ has joined #crystal-lang
pawnbox has joined #crystal-lang
A124 has quit [Ping timeout: 250 seconds]
A124 has joined #crystal-lang
Dreamer__ has quit [Ping timeout: 250 seconds]
ytti has quit [Ping timeout: 240 seconds]
Dreamer3 has joined #crystal-lang
trapped has quit [Ping timeout: 240 seconds]
krtv` has quit [Ping timeout: 240 seconds]
Dreamer3_ has quit [Ping timeout: 250 seconds]
pawnbox has quit [Ping timeout: 264 seconds]
<BlaXpirit> perks, well for waiting I suppose you can use a channel
Dreamer3_ has joined #crystal-lang
<BlaXpirit> just send something to it at the end of a fiber and wait for something at the other end
<BlaXpirit> but in this case you don't need it, the default is just fine for you. do something else in your program and the websocket will run while it runs
<perks> awesome, and yeah even the doc u linked me used ```loop { sleep 9001 } # Ensure the program does not exit``` to keep the thread from exiting while the fibers block
krtv` has joined #crystal-lang
perks has quit [Quit: perks]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
ytti has joined #crystal-lang
fka_ has quit [Remote host closed the connection]
ytti has quit [Ping timeout: 240 seconds]
Philpax has joined #crystal-lang
jhass has quit [Ping timeout: 246 seconds]
tliff has quit [Ping timeout: 252 seconds]
pawnbox has joined #crystal-lang
tliff has joined #crystal-lang
asterite has quit [Ping timeout: 244 seconds]