RX14 changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.20.4 | Fund Crystal's 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
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
soveran has quit [Ping timeout: 245 seconds]
Ven has joined #crystal-lang
ome has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
akwiatkowski has quit [Ping timeout: 245 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 260 seconds]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Kug3lis has joined #crystal-lang
Kug3lis is now known as Kug3lis_off
Ven has joined #crystal-lang
greengriminal has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
soveran has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
<FromGitter> <MaxLap> where is the allocate method defined? is it the one of pointer?
Ven has quit [Ping timeout: 256 seconds]
txdv has quit [Ping timeout: 256 seconds]
triangles2 is now known as triangles
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
<splitty_> MaxLap, pointer only has #malloc for allocation
txdv has joined #crystal-lang
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Philpax has joined #crystal-lang
<FromGitter> <MaxLap> You're right, i mixed myself up with the comments. But i really can't find allocate, which confuses me
soveran has joined #crystal-lang
Ven has joined #crystal-lang
soveran has quit [Ping timeout: 240 seconds]
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
pawnbox has quit [Remote host closed the connection]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 255 seconds]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Ven has joined #crystal-lang
soveran has joined #crystal-lang
greengriminal has quit [Quit: Leaving]
soveran has quit [Ping timeout: 245 seconds]
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 245 seconds]
Ven has joined #crystal-lang
Ven has quit [Read error: Connection reset by peer]
Kug3lis_off is now known as Kug3lis
Ven has joined #crystal-lang
Kug3lis is now known as Kug3lis_off
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
bjz has joined #crystal-lang
triangles has quit [Quit: Leaving]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has quit [Ping timeout: 248 seconds]
Ven has joined #crystal-lang
bjz has joined #crystal-lang
Kug3lis has joined #crystal-lang
Kug3lis has quit [Client Quit]
Kug3lis has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 260 seconds]
Ven has quit [Ping timeout: 240 seconds]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Kug3lis has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 248 seconds]
soveran has joined #crystal-lang
soveran has quit [Ping timeout: 245 seconds]
akwiatkowski has joined #crystal-lang
mark_66 has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
Ven has quit [Ping timeout: 258 seconds]
Ven has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has quit [Ping timeout: 240 seconds]
Kug3lis has joined #crystal-lang
Ven has joined #crystal-lang
gloscombe has joined #crystal-lang
Ven has quit [Ping timeout: 248 seconds]
Ven has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
bjz has quit [Ping timeout: 260 seconds]
bjz has joined #crystal-lang
Vallkury[m] has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rokf has joined #crystal-lang
Kug3lis has joined #crystal-lang
Kug3lis has quit [Client Quit]
Kug3lis has joined #crystal-lang
pawnbox has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
pawnbox has quit [Ping timeout: 255 seconds]
Kug3lis has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 245 seconds]
ome has joined #crystal-lang
gloscombe has quit [Ping timeout: 255 seconds]
gloscombe has joined #crystal-lang
Ven has joined #crystal-lang
soveran has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 240 seconds]
matp_ has joined #crystal-lang
matp has quit [Ping timeout: 255 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter> <zatherz> is there a better way to check if a message has been sent in a channel than just having a buffered channel with capacity 2 and `!channel.empty?`?
<FromGitter> <zatherz> this (https://crystal-lang.org/api/0.20.1/Channel.html) channel of course
<Yxhuvud> What is the actual problem you are trying to solve? Please zoom out a little and perhaps we can give a more fitting solution.
<FromGitter> <zatherz> I have a channel that I want to use to send "events" to a loop from another fiber
<FromGitter> <zatherz> however, I don't want it to block until an event is sent every single time
Kug3lis has joined #crystal-lang
<RX14> what?
<FromGitter> <zatherz> I have a loop, and another loop running in a separate fiber
<FromGitter> <zatherz> the other loop running in a separate fiber polls stuff and from time to time sends an Event object through a channel
<FromGitter> <zatherz> the main loop is supposed to receive those events, but I don't want it to block on `channel.receive` until an Event object gets through
<FromGitter> <zatherz> but I think I see how I can make it properly
<FromGitter> <zatherz> just a separate dispatch fiber
<RX14> no...
<RX14> you need a nonblocking recieve
<RX14> right?
<RX14> so
<RX14> literally recieve?
<RX14> or wait does that block too
<RX14> thats just confusing
<RX14> you can use select regardless
Ven has quit [Ping timeout: 240 seconds]
<FromGitter> <mjago> What can you do with an empty Slice (Slice(UInt8).empty) ?
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 252 seconds]
Ven has joined #crystal-lang
<FromGitter> <zatherz> hmmm
<FromGitter> <zatherz> I'm having difficulties printing to stdout from other fibers
<FromGitter> <zatherz> it only prints if I also print from the "main" fiber (not in any `spawn` block)
<FromGitter> <zatherz> and if I redirect it into a file it only prints what the main fiber printed
<FromGitter> <zatherz> even if I do `STDOUT.flush` it's still the same
<FromGitter> <zatherz> is this a bug, or is it intended? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=587e0a66873d96e16d7bb3ed]
<FromGitter> <zatherz> if you run that, it'll not print anything
<FromGitter> <zatherz> if you uncomment `puts "x"`, it'll print both `x` and `hi`
<FromGitter> <zatherz> and seemingly unconsistently
<FromGitter> <mjago> looks like the program finishes before it has time to print
<FromGitter> <mjago> @zatherz sri theres a loop! The loop is blocking. try ```loop do sleep 0.001 end```
matp_ has quit [Remote host closed the connection]
matp has joined #crystal-lang
<RX14> @zatherz a loop will never yield to the scheduler
<FromGitter> <zatherz> Ooooooooh
<FromGitter> <mjago> ``````
<FromGitter> <zatherz> so I just have to call literally anything to yield to the scheduler?
<FromGitter> <zatherz> I guess I'm gonna do it differently
Philpax has quit [Ping timeout: 260 seconds]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<FromGitter> <mverzilli> `send` expects the body to be a `Bytes`, but some operations have a zero length body
Kug3lis has joined #crystal-lang
<FromGitter> <mverzilli> and `Bytes` is an alias for `UInt8`: https://github.com/crystal-lang/crystal/blob/master/src/slice.cr#L466
<FromGitter> <mjago> Yes I see the use there. Thanks for the info
<FromGitter> <mverzilli> you're welcome! usually when you want to know what's the use of something there's a good chance you'll find it out by searching for references in the stdlib or the compiler itself
<FromGitter> <mverzilli> that's a cool benefit of working with a self-hosted language
<FromGitter> <mverzilli> *sorry, should have said `Bytes` is an alias for `Slice(UInt8)`
<FromGitter> <mjago> :+1: I knew what you meant! I’m not sure an empty Slice should blow up with hexdump though since it is a legitimate Slice. I submitted an issue for that.
<FromGitter> <mjago> I love that Crystal is self-hosted :smile:
<FromGitter> <bcardiff> @zatherz also check for `Fiber.yield`
<RX14> @zatherz you have to either use IO or sleep to yield to the scheduler
<RX14> except file IO doesn't count
pawnbox has quit [Remote host closed the connection]
<FromGitter> <mverzilli> @mjago, yeah, it definitely shouldn't blow up. it's an unhandled case
pawnbox has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 248 seconds]
Ven has joined #crystal-lang
<Kug3lis> I am trying to dump crystal-db result set to json
<Kug3lis> but I got stuck with Slice(UInt8) aka Bytes type...
<FromGitter> <mverzilli> can you show how you're using it?
<FromGitter> <bcardiff> @Kug3lis, to define a to_json you should define `def to_json(json : JSON::Builder)` which allow you to use the build for efficient json output. Note: the `: JSON::Builder` is mandatory here otherwise some overload will collide. Check https://gist.github.com/bcardiff/58d2c8cec73b0971b6eb990d6311485c
<crystal-gh> [crystal] aurimasniekis opened pull request #3908: Added Int32 and Float32 to JSON::Type (master...feature/lower-size-types-for-json-type) https://git.io/vM6yf
<DeBot> https://github.com/crystal-lang/crystal/pull/3908 (Added Int32 and Float32 to JSON::Type)
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vM6Si
<crystal-gh> crystal/master aca9433 Ary Borenszweig: Fixed Slice#hexdump for empty slice. Fixes #3906
<DeBot> https://github.com/crystal-lang/crystal/issues/3906 (Slice#hexdump fails with negative capacity (ArgumentError) for empty Slice)
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
ome has quit [Quit: Connection closed for inactivity]
<crystal-gh> [crystal] bcardiff pushed 1 new commit to master: https://git.io/vM6dJ
<crystal-gh> crystal/master 1b97c99 TSUYUSATO Kitsune: Annotate private to spec methods/classes more (#3892)
<DeBot> https://github.com/crystal-lang/crystal/pull/3892 (Annotate private to spec methods/classes more)
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
snsei has joined #crystal-lang
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has joined #crystal-lang
<travis-ci> crystal-lang/crystal#aca9433 (master - Fixed Slice#hexdump for empty slice. Fixes #3906): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/192701475
<DeBot> https://github.com/crystal-lang/crystal/issues/3906 (Slice#hexdump fails with negative capacity (ArgumentError) for empty Slice)
<crystal-gh> [crystal] asterite pushed 1 new commit to master: https://git.io/vM6j6
<crystal-gh> crystal/master 0cda903 Ary Borenszweig: Fixed #3907: ICE on tuple assignment
<crystal-gh> [crystal] Sija opened pull request #3910: Tweak OpenSSL docs (master...tweak-openssl-docs) https://git.io/vMiUO
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
<travis-ci> crystal-lang/crystal#1b97c99 (master - Annotate private to spec methods/classes more (#3892)): The build was broken. https://travis-ci.org/crystal-lang/crystal/builds/192711582
<DeBot> https://github.com/crystal-lang/crystal/pull/3892 (Annotate private to spec methods/classes more)
Ven has quit [Ping timeout: 240 seconds]
snsei has quit []
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ven has joined #crystal-lang
Kug3lis has joined #crystal-lang
Ven has quit [Ping timeout: 255 seconds]
Ven has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AckZ has joined #crystal-lang
pawnbox has joined #crystal-lang
Kug3lis has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
<travis-ci> crystal-lang/crystal#0cda903 (master - Fixed #3907: ICE on tuple assignment): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/192728357
Kug3lis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has joined #crystal-lang
soveran has quit [Remote host closed the connection]
Yxhuvud has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
Ven has quit [Ping timeout: 260 seconds]
Ven has joined #crystal-lang
<crystal-gh> [crystal] mjago opened pull request #3911: Fix example for NamedTuple.from (master...master) https://git.io/vMiE2
<DeBot> https://github.com/crystal-lang/crystal/pull/3911 (Fix example for NamedTuple.from)
Kug3lis_off is now known as Kug3lis
<crystal-gh> [crystal] firejox opened pull request #3912: [WIP] rewrite channel (master...rewrite-channel) https://git.io/vMi2N
<crystal-gh> [crystal] bcardiff closed pull request #3908: Added Int32 and Float32 to JSON::Type (master...feature/lower-size-types-for-json-type) https://git.io/vM6yf
<DeBot> https://github.com/crystal-lang/crystal/pull/3908 (Added Int32 and Float32 to JSON::Type)
gloscombe has quit [Quit: Lost terminal]
hako has joined #crystal-lang
michael_campbell has joined #crystal-lang
akwiatkowski has joined #crystal-lang
hako_ has joined #crystal-lang
hako has quit [Read error: Connection reset by peer]
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
unshadow_ has joined #crystal-lang
michael_campbell has quit [Quit: ZNC 1.6.1 - http://znc.in]
havenwood has quit [Quit: mIRC 5.91 (16 bit) for Microsoft © Windows For WorkGroups 3.11®]
havenwood has joined #crystal-lang
havenwood has joined #crystal-lang
unshadow has quit [Ping timeout: 240 seconds]
bjz has joined #crystal-lang
bjz_ has joined #crystal-lang
bjz has quit [Ping timeout: 240 seconds]
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
matp has quit [Remote host closed the connection]
matp has joined #crystal-lang
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
Ven has quit [Ping timeout: 255 seconds]
unshadow_ has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
unshadow has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
unshadow has quit [Ping timeout: 240 seconds]
Ven has quit [Ping timeout: 240 seconds]
unshadow has joined #crystal-lang
Ven has joined #crystal-lang
bjz_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
unshadow has quit [Ping timeout: 240 seconds]
hako_ has quit [Ping timeout: 240 seconds]
unshadow has joined #crystal-lang
soveran has joined #crystal-lang
soveran has joined #crystal-lang
soveran has quit [Changing host]
michael_campbell has joined #crystal-lang
Philpax has joined #crystal-lang
Philpax has quit [Ping timeout: 240 seconds]
Ven has quit [Ping timeout: 256 seconds]
Ven has joined #crystal-lang
bjz has joined #crystal-lang
bjz has quit [Ping timeout: 260 seconds]
Ven has quit [Ping timeout: 240 seconds]
Ven has joined #crystal-lang
DeBot has quit [Remote host closed the connection]
andrzejku has joined #crystal-lang
<andrzejku> hey
DeBot has joined #crystal-lang
pawnbox has joined #crystal-lang
andrzejku has quit [Quit: Leaving]
<crystal-gh> [crystal] Sija opened pull request #3914: Remove reduntant “?” from type definitions in bang accessors! (master...remove-question-marks-from-bang-accessors) https://git.io/vMPUT
<DeBot> https://github.com/crystal-lang/crystal/pull/3914 (Remove reduntant “?” from type definitions in bang accessors!)
pawnbox has quit [Ping timeout: 258 seconds]
hako has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 255 seconds]
rokf has quit [Quit: rokf]
Philpax has joined #crystal-lang
sz0 has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
akwiatkowski has quit [Ping timeout: 255 seconds]