ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.21.1 | 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
akwiatkowski has quit [Ping timeout: 260 seconds]
<FromGitter> <elorest> <RX14> So I finally got it to compile but when i try to run a simple helloworld.cr I get this error, `Error in hello.cr:1: while requiring "prelude": can't find file 'prelude' relative to '/home/pi/crystal'`
akwiatkowski has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 240 seconds]
mgarciaisaia has quit [Quit: Leaving.]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
<FromGitter> <jipiboily> Unrelatted to Crystal, but did you see GitLab acquired Gitter?
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
<FromGitter> <drosehn> I received an email from gitter about it.
<Papierkorb> just saw it in /.
Raimondi has quit [Remote host closed the connection]
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondi has joined #crystal-lang
<FromGitter> <ukd1> @jipiboily yep - was leaked this morning1
pawnbox has joined #crystal-lang
<FromGitter> <elorest> Does anyone know how to fix that issue I posted above about `Error in hello.cr:1: while requiring "prelude": can't find file 'prelude' relative to '/home/pi/crystal'` I can only find one other reference to that error from 2014 but the solution seems out of date. Tried it anyway though.
pawnbox has quit [Ping timeout: 260 seconds]
Raimondi has quit [Ping timeout: 268 seconds]
<FromGitter> <fridgerator> dumb question, but is prelude.cr in /home/pi/crystal ?
<FromGitter> <fridgerator> or /home/pi/crystal/lib
pawnbox has joined #crystal-lang
<FromGitter> <piyushranjan> hello. I am new to crystal. I am trying out this kafka lib https://github.com/maiha/kafka.cr and I am getting this error: in lib/kafka/src/kafka/protocol/structure/accessor.cr:34: undefined method 'crc32' for Zlib:Module ⏎ ⏎ ``` crc32 = Zlib.crc32(slice).to_i32``` [https://gitter.im/crystal-lang/crystal?at=58ca0a752215a08f048f0c1a]
<FromGitter> <piyushranjan> I checked zlib doc on crystal and cannot find this method
pawnbox has quit [Ping timeout: 240 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
<FromGitter> <fridgerator> There has probably been a breaking change since that library was last updated
<FromGitter> <fridgerator> it looks like `CRC32` is its own module now: https://crystal-lang.org/api/0.21.1/CRC32.html
<FromGitter> <fridgerator> I don't see an `crc32` method on Zlib: https://crystal-lang.org/api/0.21.1/Zlib.html
<FromGitter> <Sija> it'd probably be `CRC32.cheksum` now
<FromGitter> <Sija> passing sth with `#to_slice`
Raimondi has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 268 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
<FromGitter> <elorest> @fridgerator i even tried moving the both hello.cr and the crystal binary to the src folder which definitely has prelude.cr. https://dl.dropboxusercontent.com/s/2jrd3in3mrra91r/2017-03-15%20at%2010.30%20PM.png
Raimondi has quit [Ping timeout: 268 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 256 seconds]
pawnbox has joined #crystal-lang
A124 has joined #crystal-lang
pawnbox has quit [Ping timeout: 256 seconds]
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 256 seconds]
Raimondi has joined #crystal-lang
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
akwiatkowski has joined #crystal-lang
Raimondi has joined #crystal-lang
<FromGitter> <KCreate> Could you check if crystals environment variables are set?
Raimondi 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
mark_66 has joined #crystal-lang
pawnbox has quit [Read error: Connection reset by peer]
pawnbox has joined #crystal-lang
Raimondi has joined #crystal-lang
A124 has quit [Ping timeout: 240 seconds]
A124 has joined #crystal-lang
akwiatkowski has quit [Ping timeout: 260 seconds]
Raimondi has quit [Ping timeout: 268 seconds]
rolha has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
pawnbox has joined #crystal-lang
akwiatkowski has joined #crystal-lang
Raimondi has joined #crystal-lang
gloscombe has joined #crystal-lang
Qchmqs has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
qchmqs_ has joined #crystal-lang
Qchmqs has quit [Ping timeout: 240 seconds]
qchmqs_ has quit [Client Quit]
Qchmqs has joined #crystal-lang
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Qchmqs has quit [Read error: Connection reset by peer]
Qchmqs has joined #crystal-lang
bjz has joined #crystal-lang
alibby has quit [Ping timeout: 264 seconds]
alibby has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
Qchmqs has quit [Ping timeout: 240 seconds]
pawnbox has quit [Ping timeout: 260 seconds]
Raimondi has joined #crystal-lang
sija has quit [Quit: Connection closed for inactivity]
Raimondi has quit [Ping timeout: 268 seconds]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pawnbox has joined #crystal-lang
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
mgarciaisaia has joined #crystal-lang
Philpax_ has quit [Ping timeout: 240 seconds]
Raimondi has joined #crystal-lang
Raimondi has quit [Ping timeout: 268 seconds]
Raimondi has joined #crystal-lang
<FromGitter> <lucas-aragno> hey guys, does anyone knows a way/plugin to simulate the `resolve` key from webpack 2 on webpack 1?
Raimondi has quit [Ping timeout: 268 seconds]
pawnbox has quit [Remote host closed the connection]
pawnbox has joined #crystal-lang
marius is now known as marius_
bjz has joined #crystal-lang
mgarciaisaia has quit [Ping timeout: 258 seconds]
mgarciaisaia has joined #crystal-lang
pawnbox has quit [Ping timeout: 240 seconds]
akwiatkowski has quit [Ping timeout: 256 seconds]
marius_ is now known as Marius
Raimondi has joined #crystal-lang
mark_66 has quit [Remote host closed the connection]
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sija has joined #crystal-lang
Yxhvd has quit [Remote host closed the connection]
Yxhuvud has joined #crystal-lang
Yxhuvud has quit [Read error: Connection reset by peer]
Yxhuvud has joined #crystal-lang
metacortex has joined #crystal-lang
metacortex has quit [Client Quit]
<FromGitter> <KCreate> Can someone from the Core team please take a look at issue #4115 (https://github.com/crystal-lang/crystal/issues/4115)? ⏎ `File.link` incorrectly creates a symlink instead of a hardlink.
<DeBot> https://github.com/crystal-lang/crystal/issues/4115 (Incorrect behaviour for File.link)
<RX14> the core team look like they're mostly on holiday right now
leonardschuetz has joined #crystal-lang
leonardschuetz has quit [Client Quit]
leonardschuetz has joined #crystal-lang
leonardschuetz has quit [Quit: leaving]
KCreate has joined #crystal-lang
<KCreate> Okay thanks
<FromGitter> <sdogruyol> @RX14 how's crane going
<RX14> it installs crystal from source
<RX14> but i havent built the wrapper commands yet
<FromGitter> <sdogruyol> that's a nice start :)
<RX14> i.e. it installs crystal to a directory but you can't use it
<RX14> well you can but it's a lot more effort
<FromGitter> <elorest> <RX14> So I added that environment variable you recommended and now I get a different error related to things prelude calls. https://dl.dropboxusercontent.com/s/m5mvghbb8q043be/2017-03-16%20at%2012.19%20PM.png
pawnbox has joined #crystal-lang
<RX14> that's weird
<FromGitter> <elorest> I thought so too.
<RX14> try adding --target arm-linux-gnueabihf *without* adding --cross-compile, when compiling on the raspi
<RX14> you'll need to use `crystal build` to add those arguments
<RX14> instead of just crystal <file>
<FromGitter> <elorest> yeah.
<FromGitter> <elorest> when compiling my hello.cr or are you suggesting I rebuild from the .o file?
<RX14> no
<RX14> i suggest just trying `crystal run --target arm-unknown-linux-gnueabihf hello.cr`
<RX14> instead of your current command
<RX14> try adding the -unknown bit
<FromGitter> <elorest> how do I add that? --unknown?
<FromGitter> <elorest> sorry go it
<RX14> i meant in the target :)
<FromGitter> <elorest> Yeah I saw you had put that above.
<FromGitter> <elorest> also it appears to work...
<RX14> nice!
<FromGitter> <elorest> so let me just try to debrief here really fast. Why do i need to have all the source files available to the binary on my raspberry pi but not when I install it on mac or linux from crenv.
KCreate has quit [Ping timeout: 264 seconds]
<RX14> when you install using homebrew or crenv you do have all the sources available
<RX14> it's just handled transparently:
<RX14> the sources are copied to a location, and then the path to those sources is compiled in to the compiler binary
gloscombe has quit [Remote host closed the connection]
<RX14> I didn't want to complicate my tutorial with instructions on how to do that because I thought that specifying a path on the raspberry pi while compiling on the desktop could get a bit confusing
<RX14> if you want you can set CRYSTAL_CONFIG_PATH when cross-compiling the compiler to the same value as you set CRYSTAL_PATH at runtime, and it'll become the default when crystal_path doesn't exist
<FromGitter> <elorest> So is CRYSTAL_CONFIG_PATH an env var is an option on my cc compiling.
<RX14> no, on the crystal command you run on the host
<RX14> CRYSTAL_CONFIG_PATH is read by a macro when compiling the crystal source into the crystal.o you copy to the raspi
<RX14> so you need to set it on the host
<RX14> which is why it's confusing :)
<FromGitter> <elorest> So it's an envvar on my mac or an option?
<RX14> env var
<FromGitter> <elorest> Awesome. Thanks. Is there a way to set it so that I don't have to specify the target everytime on my rapsi?
KCreate has joined #crystal-lang
<RX14> no, that's a compiler bug
<RX14> i'd report it in the ARM thread you posted in before
<FromGitter> <elorest> Ok. Thanks so much for your help. Sorry it took so long.
<FromGitter> <elorest> Hope I don't run into any other weird issues.
KCreate has left #crystal-lang [#crystal-lang]
<RX14> hopefully we'll be providing release builds for more architectures soon
<RX14> including ARM
<FromGitter> <jclem> Does anyone know if it's possible to compile Crystal binaries that can be shared on OS X? Everything I can see seems to imply that it's not possible.
<FromGitter> <jclem> For example, this issue: https://github.com/crystal-lang/crystal/issues/2003
<RX14> well they can be shared, it's just they need a bunch of libraries from homebrew to be installed
<FromGitter> <jclem> Yeah, I was kind of starting to see that, but there doesn't appear to be a very easy way to know exactly which libraries my Homebrew formula should require.
<FromGitter> <jclem> Without trial and error on an OS X VM or something.
<RX14> run ldd on the executable
<RX14> or at least thats how it works on linux
<RX14> you can see the shared libraries it requires
<RX14> should be libgc, libevent, openssl maybe
<RX14> libpcre
<RX14> there's a list of packages which the compiler needs here: https://github.com/Homebrew/homebrew-core/blob/master/Formula/crystal-lang.rb#L18
<RX14> you might not need all of them
<RX14> especially not llvm
<FromGitter> <jclem> Ah, okay. yeah it's `otool -L $executable` on Mac OS X apparently
<RX14> macos has to be different :)
<Papierkorb> btw, does Mac use ELF or what format is it?
<RX14> i think it's called mach-o
<RX14> but it's not ELF
<Papierkorb> Oh right, it's Mach
<Papierkorb> what a shame, but probably historic reasons or something
<FromGitter> <jclem> Eh...I wouldn't know.
<FromGitter> <jclem> I came across Crystal from @will's recommendation—I'm used to building binaries for CLIs with Go, but Crystal seemed like a better language for building them in (in part because of `OptionParser` vs Go's `flag`), but the compilation part is a bit of a bummer, but it's understandable.
<crystal-gh> [crystal] bcardiff closed pull request #4116: Fixed invalid File.link behaviour (master...patch-1) https://git.io/vyW9S
mgarciaisaia has quit [Quit: Leaving.]
mgarciaisaia has joined #crystal-lang
<FromGitter> <jclem> @RX14 Thanks for your help—ended up having to require installation via Homebrew to get the libraries, but that's not terrible.
<RX14> yeah hopefully we can figure out a proper solution to this in the future
<RX14> for linux we can statically compile using musl on an alpine chroot
<RX14> but for osx? i'm really not sure
Renich has joined #crystal-lang
Renich has quit [Client Quit]
<FromGitter> <jclem> Does that work for any linux distro, though?
<FromGitter> <jclem> I just ran `crystal build` on the `crystal-lang/crystal` Docker image, but I haven't tested it yet.
<FromGitter> <jclem> Seemed easier than using `--cross-compile`.
Renich has joined #crystal-lang
<FromGitter> <agibralter> Can anyone share an example of Process.run that directs the STDOUT/STDERR from the process to the crystal program's STDIN/STDOUT?
<RX14> @jclem if it's statically linked why would it not work for any distro?
<RX14> @agibralter if you check out the docs, you'll see that `output`, `error` and `input` are of type `Stdio`, if you click that you'll see you can set the values to be true to inherit from the parent: https://crystal-lang.org/api/0.21.1/Process.html#run%28command%3AString%2Cargs%3Dnil%2Cenv%3AEnv%3Dnil%2Cclear_env%3ABool%3Dfalse%2Cshell%3ABool%3Dfalse%2Cinput%3AStdio%3Dfalse%2Coutput%3AStdio%3Dfalse%2Cerror%3AStdio%3Dfalse%2Cchdir%3AString%3F%3Dnil%29%3AProcess
<RX14> %3A%3AStatus-class-method
<RX14> these doc URLs are way too long
<RX14> and yes, the docs are pretty confusing on that part
rolha has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<FromGitter> <agibralter> :) awesome, thank you!
<FromGitter> <agibralter> And how about this... let's say you have a process that's like a log tail... is there a nice way to Signal::INT.trap { } in the crystal program and then interrupt the Process.run?
<RX14> keep the process handle around and then terminate it
<RX14> you'd use Process.new to start the command
<RX14> which doesn't wait until the cxommand finishes
<RX14> and then use #kill on the process object you recieve
<RX14> from the handler
<RX14> or just exit() and let the kernel kill the children
<RX14> but that's not quite as nice
alibby1 has joined #crystal-lang
alibby has quit [Ping timeout: 260 seconds]
alibby2 has joined #crystal-lang
<FromGitter> <agibralter> Ah cool, I'm going to try to give this a whirl
alibby1 has quit [Ping timeout: 246 seconds]
<travis-ci> crystal-lang/crystal#d9abe28 (master - Fixed invalid File.link behaviour (#4116)): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/211867858
<DeBot> https://github.com/crystal-lang/crystal/pull/4116 (Fixed invalid File.link behaviour)
Renich has quit [Quit: Renich]
Renich has joined #crystal-lang
<FromGitter> <agibralter> running `docker-compose -f docker-compose.yml logs -f` should look like: `Process.new("docker-compose", ["-f", "#{@dir}/docker-compose.yml", "logs", "-f"], ...)`>
Renich_ has joined #crystal-lang
<FromGitter> <agibralter> For some reason I'm not sure the args are getting passed correctly
pawnbox has quit [Remote host closed the connection]
Renich has quit [Ping timeout: 240 seconds]
Renich__ has joined #crystal-lang
<RX14> it should do
<RX14> it looks right to me
Renich_ has quit [Ping timeout: 260 seconds]
p0p0pr37 has joined #crystal-lang
p0p0pr37 has joined #crystal-lang
<FromGitter> <agibralter> :facepalm: oh man, it was another typo
<FromGitter> <agibralter> tthank you!!
bjz has joined #crystal-lang
<txdv> how do i call another constructor from a constructor?
<BlaXpirit> txdv, well you can just call it no problem, but variable initialization is not proven if you delegate to another method
<BlaXpirit> that's why to delegate to another constructor you usually write def self.new(some args); self.new(other args)
<Papierkorb> txdv: If possible, try to use default values for arguments to #initialize instead
<txdv> hm
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<FromGitter> <agibralter> https://gist.github.com/agibralter/37573a57810db641980fa3897cbf64d3 => does this seem to make sense? I feel like there's a race condition in the way I'm trapping the signal
bjz has joined #crystal-lang
bjz has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<txdv> is crystals xml parsing facility as good as nokogiri?
<RX14> probably not
<FromGitter> <jclem> Are `getter` and `setter` documented anywhere?
sardaukar has joined #crystal-lang
<FromGitter> <jclem> I happened upon them on an old blog post, had no idea they were in the language.
<sardaukar> hello all
<sardaukar> is there a way to know if a socket has more bytes to read, without blocking on it?
<sardaukar> meaning: try to read, and return either the byte or nil immediately
<RX14> @jclem they're documented in the macros section on object here: https://crystal-lang.org/api/0.21.1/Object.html
<RX14> sardaukar, no
<sardaukar> RX14: bummer
<FromGitter> <jclem> Ah, okay thanks RX14. I wonder how much work it'd be to have the API search also search method names?
<RX14> yeah i'd really love that too
<RX14> a fuzzy search on everything on the API docs would be an absolute godsend
<sardaukar> it sounds complicated to implement
<RX14> also a way to generate a combined API documentation for all types in a project and it's dependencies
<RX14> it probably wouldn't be that hard to implement
<FromGitter> <jclem> Oh, that'd be great.
<RX14> just export symbols as json and a bit of JS
<RX14> it's been discussed before
<FromGitter> <jclem> I think Hexdocs's search and general interface are really great: https://hexdocs.pm/elixir/Kernel.html
<sardaukar> RX14: I meant non-blocking IO seems complicated
<RX14> sardaukar, the IO is already non-blocking in terms of the whole application
<RX14> what do you need to implement
<RX14> maybe I can help you with an IO model
<sardaukar> it's a telnet server - I need to know if a client sends me a message or not
<sardaukar> so some clients request negotiation params and others don't
<sardaukar> the only wait to tell is to read on the socket if there's a new message
<sardaukar> but clients that don't send extra negotiation bytes will freeze if I wait on reads from the socket
<sardaukar> I guess I could maybe use a channel to send all inbound messages to, but then I guess I'd have two problems :D
<RX14> well
<FromGitter> <jclem> Oh, I've been meaning to ask this. Can I initialize an empty hash with a type alias? It's a little annoying to `alias Foo = Hash(String, Bool)` and then immediately `foo = {} of String => Bool` instead of something like `foo = {} of Hash` or `foo : Hash = {}`
<RX14> Foo.new should work
<RX14> but it might not
<RX14> sardaukar, why would using a channel be a problem?
<FromGitter> <jclem> Oh looks like it does @RX14
<FromGitter> <jclem> thanks!
<sardaukar> because then I'd separate the "talking" and "listening" and that sounds like a hassle to keep un sync
<sardaukar> *in
<RX14> Hash(Foo, Bar).new >> {} of Foo => Bar in my opinion
<RX14> butuse whichever you want
<RX14> sardaukar, do they need to be in sync
<sardaukar> telnet is request/response so yeah
<RX14> well it's going to be the same either way isn't it
<RX14> if you don't respond they won't send a message
<sardaukar> yeah, I see your point
<sardaukar> I could give it a show
<RX14> so you'll read 1 message from the channel and respond
<sardaukar> *shot
<RX14> Channel#read will be the same as a libc read
<RX14> except you can model your message splitting as a blocking loop
<RX14> instead of having to put your logic in the loop too
<sardaukar> I'll give it a shot, thanks!
<RX14> actually no that doesn't buy you anything does it
<sardaukar> I think you can "funnel" new data onto a channel, right?
<sardaukar> that's my perception, anyway
<RX14> yes but then you could just replace channel.send with a function call
<RX14> which handles the message
<RX14> this is one place where channels don't help I think
<sardaukar> crap
<RX14> except if you need to use a select primitive
<txdv> If I have Type | Nil, how do I check if it is not equal nil and convert it to Type?
<RX14> because you can do select over multiple channels including timeout sardaukar
<sardaukar> oh, select tells you which descriptor has data, right?
<RX14> well
<RX14> not quite in crystalk
<sardaukar> I'm thinking C
<RX14> in crystal you use it like a case statement
<RX14> and you provide a block of code for each channel
<RX14> txdv, use an if statement
<RX14> if var
<RX14> and inside the if block if won't be nil
<RX14> sardaukar, so how does it even work with that negotiation params then
<RX14> because if it's like you describe there must be a timeout
<RX14> a small period where you can send it
<sardaukar> the server sends command as part of the "handshake"
<sardaukar> and the client, after those, is free to ask for more
<RX14> but what if it doesn't send it
<txdv> if i have @chan : Channel(Nil) | Nil
<sardaukar> command line telnet doesn't (for my current server)
<txdv> i just have to check if @chan.is_a?(Channel(Nil)); ....; end ?
<sardaukar> but a specialized client does ask for more, immediately after I send my handshake
<RX14> txdv, you need to set it as a local variable
<Papierkorb> txdv: That's not enough. Instead, do: `if chan = @chan; ...; end`
<RX14> a class variable could change
<Papierkorb> txdv: that'll assign `chan` to be your Channel if @chan is not-nil.
<RX14> sardaukar, but i assume that you need to know if that message has been sent to respond with something
<RX14> if not then it's stateless and you can handle it in your mail loop
<Papierkorb> txdv: Also, you can use a question mark as short-hand for a nilable type: `@chan : Channel(Nil)?`
<txdv> that makes code look so much better
<RX14> sardaukar, because think about what would happen if the client didn't send it, how long should you wait for it to arrive?
<sardaukar> RX14: I don't get your last comment: if that message has been sent?
<sardaukar> oh I wouldn;t
<RX14> things aren't 0-latency
<sardaukar> after the handshake, I send my login prompt
<RX14> you can't tell whether something is going to be sent or not
<sardaukar> but with that other special client, the first part of the username is the extra negotiation bytes
<sardaukar> I could filter that out
<sardaukar> but I'd like to have a better solution
<RX14> yeah i don't get it
<sardaukar> ok, so client A connects, I send 4 negotiation params (one by one, after receiving the reply to the last one) and then my login prompt
<sardaukar> this works
<sardaukar> but client B, after my 4 params, send negotiation bytes for more params
<sardaukar> in telnet, there's no "I'm done" string
<sardaukar> negotiation messages can flow between client and server seemingly forever
<sardaukar> in practice, they don't
<RX14> C has the same limitations
<RX14> so there must be a way of telling
<sardaukar> in C, I'd do a select with a timeout after my handshake
<RX14> see you need a timeout
<sardaukar> if no more bytes are in after say 2/3 seconds, I send my login prompt
<RX14> that's shit protocol design
<sardaukar> telnet is quite shitty, yes
<RX14> ok then
<RX14> you'll just have to set read_timeout on the IO to be honest
<sardaukar> socket.read_timeout = 1, then read?
<RX14> then set it back to nil, yes
<RX14> and rescue the IO::Timeout
<sardaukar> cool! will try that
<RX14> that's a really dumb protocol lol
<sardaukar> that's why it's dead
<sardaukar> but I'm working on a 90s BBS revival project :D
<sardaukar> lots of clients only do telnet
<sardaukar> normal telnet can't do these ANSI graphics
<sardaukar> and now I get why every telnet BBS has a wait period on login...
<sardaukar> just read about the protocol this week
<sardaukar> yep, that works - thanks RX14!
<RX14> well it's an ugly hack
<RX14> but it's an ungly protocol
<sardaukar> indeed
<RX14> ugly like my typos
<txdv> how do i yield current execution?
<RX14> for how long?
<RX14> you eman with fibers right?
<txdv> yeah
<RX14> you can use `sleep` with no args to sleep forever and let other fibers do work right now
<txdv> Scheduler.reschedule?
<txdv> i literally just need to let the other fibers run first
<RX14> you can use `Fiber.yield` to just run the other fibers
<RX14> Scheduler.reschedule would be the same as sleeping forever
<txdv> something is fucky and im too tired
<txdv> thanks for the help!
<txdv> good night guys
leex_ is now known as leex
<sardaukar> I'll be turning in too
<sardaukar> thanks, everyone! (special thanks to RX14)
sardaukar has quit [Quit: Leaving]
endou_ has quit [Read error: Connection reset by peer]
endou has joined #crystal-lang
<travis-ci> crystal-lang/crystal#9a2dca2 (fix-travis-osx - Build me!): The build has errored. https://travis-ci.org/crystal-lang/crystal/builds/211921396
pawnbox has joined #crystal-lang
pawnbox has quit [Ping timeout: 260 seconds]
Renich__ has quit [Quit: Renich__]
Renich__ has joined #crystal-lang
Renich__ is now known as Renich