ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.31.1 | Fund Crystal's development: http://is.gd/X7PRtI | GH: https://github.com/crystal-lang/crystal | Docs: http://crystal-lang.org/docs/ | API: http://crystal-lang.org/api/ | Gitter: https://gitter.im/crystal-lang/crystal
<FromGitter> <straight-shoota> Currently each instance of `HTTP::Client` uses exactly one socket for communication. So it's easy to mix up several requests-response-cycles when executed concurrently
<FromGitter> <straight-shoota> But I guess as long as the request/response data is small and fits into the buffer, a fiber switch in between a cycle might be relatively rare.
<FromGitter> <straight-shoota> @Souravgoswami I think `%w(\\)` should be a valid literal. That's likely a bug. Please open an issue!
<FromGitter> <Blacksmoke16> yea the response is pretty small
livcd has quit [Quit: Lost terminal]
<FromGitter> <Blacksmoke16> wish there was a class exec method that accepts a `HTTP::Request`
alex```6 has joined #crystal-lang
alex``` has quit [Ping timeout: 276 seconds]
alex```6 has quit [Quit: The Lounge - https://thelounge.chat]
f1refly has joined #crystal-lang
f1reflyylmao has quit [Ping timeout: 246 seconds]
_whitelogger has joined #crystal-lang
<FromGitter> <Souravgoswami> Thanks @straight-shoota
<FromGitter> <Souravgoswami> I have got another question (ugh): ⏎ ⏎ Aren't we intended to compare a String with a Character?
<FromGitter> <Souravgoswami> For example: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dcf840850010612b2c88b1d]
<FromGitter> <watzon> I found this a while ago. I think there might be an issue for it.
<FromGitter> <watzon> The two should definitely be comparable
<FromGitter> <Souravgoswami> Yeah I think so...
<FromGitter> <Souravgoswami> And this one: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dcf856135889012b1187ff0]
<FromGitter> <watzon> Hmm interesting
Raimondi has quit [Read error: Connection reset by peer]
Raimondi has joined #crystal-lang
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
ht_ has joined #crystal-lang
_whitelogger has joined #crystal-lang
_whitelogger has joined #crystal-lang
alexherbo2 has joined #crystal-lang
alexherbo2 is now known as alex```
<FromGitter> <lbarasti> A golang-inspired solution to @Souravgoswami's question on killing threads. Feedback welcome! ⏎ https://stackoverflow.com/questions/58877088/killing-a-thread-in-crystal-lang/58889744#58889744
CommanderViral has joined #crystal-lang
duane has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
alex``` has quit [Quit: The Lounge - https://thelounge.chat]
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
alexherbo2 has joined #crystal-lang
JuanMiguel has joined #crystal-lang
JuanMiguel has quit [Remote host closed the connection]
<Yxhuvud> No activity at all for half a day? Have the gitter bridge died again?
<FromGitter> <tenebrousedge> no, it's working
<FromGitter> <Souravgoswami> Yeah, just read that!
<FromGitter> <Souravgoswami> By the way guys, it's bad that step enumerator is 1/4th x slower than while loop! :C
<FromGitter> <Souravgoswami> I was telling my college pal that crystal is faster than his favourite programming language, weirdly Java! ⏎ ⏎ He proved me wrong, java took 0.7 second (after compilation) while crystal took 3 seconds
<FromGitter> <tenebrousedge> it's hard to write accurate benchmarks, and you should generally not write code based on microbenchmarks
<FromGitter> <Souravgoswami> Now after replacing the step loop with while loop, crystal takes 0.5 seconds
<FromGitter> <Souravgoswami> Actually I have done many benchmarks using step , times, upto, downto, map, each enumerators they are 4x slower in Ruby... Same for crystal!
<FromGitter> <tenebrousedge> that's nice
<FromGitter> <Souravgoswami> Because of the block, probably?
<Yxhuvud> Do you run your tests with --release?
<FromGitter> <tenebrousedge> it's easy to write bad benchmarks
<FromGitter> <Souravgoswami> Hi @FromIRC , nope!
<FromGitter> <Souravgoswami> :D
<FromGitter> <christopherzimmerman> I’ve run into the same issues with benchmarks and iterators
<Yxhuvud> What results do you get if you add that flag?
<FromGitter> <christopherzimmerman> The built in benchmark is awful
<FromGitter> <Daniel-Worrall> Benchmarks should always be run in --release
<FromGitter> <christopherzimmerman> And it closures lots of variables that really make the results inaccurate for small measurements
<FromGitter> <Souravgoswami> If you talk about that prime, step loops makes the thing 10x slower!
<FromGitter> <tenebrousedge> yes, the built in benchmark is an extremely blunt instrument
<FromGitter> <Souravgoswami> Better just use Time!
<FromGitter> <christopherzimmerman> Make sure you include ALL setup code inside the block to avoid closures, and measure the setup costs independently as well to factor them out
<FromGitter> <Souravgoswami> Sure, but that doesn't make step any equivalent to while loop!
<FromGitter> <Souravgoswami> https://stackoverflow.com/questions/54318071/what-makes-while-loop-in-ruby-faster-than-others ⏎ ⏎ I don't know if crystal's loop is from Ruby, but the same is absolutely true for Ruby as well...
<FromGitter> <Souravgoswami> I have been using while for tests where perf matters... I didn't hope that step() will make it 10x slower though... It got worse perf than java with step()...
alexherbo2 has quit [Quit: The Lounge - https://thelounge.chat]
hightower2 has joined #crystal-lang
<hightower4> Hey if a module defines some initialize functions, are they not carried over automatically to a class that includes the module?
<FromGitter> <tenebrousedge> it works
<hightower4> Strange. I have a case where it's telling me it can't find the matching initialize, yet if I define the same one and just call 'super', it works.
<hightower4> Let me play with it some more
<FromGitter> <tenebrousedge> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dd055c750010612b2ce5013]
<hightower4> Right...
<FromGitter> <tenebrousedge> do you have a minimal example?
<hightower4> just creating one
alexherbo2 has joined #crystal-lang
alexherbo2 is now known as alex```
<hightower4> works when extracted; need to look into it some more
<FromGitter> <tenebrousedge> :plus1:
DTZUZO has quit [Ping timeout: 240 seconds]
<FromGitter> <kingsleyh> hey - how can I get the month as a String from Time.utc? can't find it anywhere in the docs - time.month gives an Int32 - but I want the name of the month e.g. January
<FromGitter> <kingsleyh> I thought something would exist already that provides this
<FromGitter> <Daniel-Worrall> `.to_s`
<FromGitter> <Daniel-Worrall> or use `Time::Format`
<FromGitter> <tenebrousedge> `t.to_s("%B").should eq("January")`
<hightower4> Ah I see what the issue is... I had a couple overloads. But overloads only work based on argument types and not argument names. So when I had two methods, initialize(path : String) and initialize(builtin : String), one of these overrode the other.
<hightower4> is this expected/accepted behavior?
<FromGitter> <tenebrousedge> yes
<FromGitter> <tenebrousedge> it figures out which method you're after based on the types
<FromGitter> <kingsleyh> Thanks people :)
<hightower4> sync
<hightower4> fg
<hightower4> hm hm.. yeah, I'll need to figure something out here
<FromGitter> <didactic-drunk> @hightower4 use named args. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dd05a104adf071a84403e48]
<hightower4> ah yes, I used this now like (*, path : . builtin :). Didn't realize I could use * and keep them split. Thanks!
alex``` has quit [Ping timeout: 240 seconds]
alex``` has joined #crystal-lang
alex``` has quit [Quit: The Lounge - https://thelounge.chat]
alexherbo2 has joined #crystal-lang
alexherbo2 is now known as alex```
<FromGitter> <Souravgoswami> Hi, faced an issue while trying to install crystal on Linux Mint 32 bit: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dd06e9068ad1c4a0fdb922e]
<FromGitter> <Blacksmoke16> crystal on snap is only available on amd64 as the error says
<FromGitter> <Souravgoswami> Yup, but can't it be packed on 32 bit systems in the future? ⏎ ⏎ Also, I am unable to cross compile apps on Arch Linux system: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dd07126091dd14a0ed1972a]
<FromGitter> <Souravgoswami> Any idea why I am getting the error? ⏎ ⏎ Can't also use clang
<FromGitter> <Blacksmoke16> im pretty sure it supports 32 bit systems just not via snap, maybe its something they could enable?
ht_ has quit [Quit: ht_]
<FromGitter> <Souravgoswami> My ArchLinux is 64 bit where I am running the command. ⏎ ⏎ On linux mint, the same thing happens after copying the .o file
<FromGitter> <Souravgoswami> But on linux mint, I have to remove the last -lgc -lunwind line, otherwise I get: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dd072db4adf071a8440ea3e]
<FromGitter> <Souravgoswami> Same thing with clang 9
<FromGitter> <Souravgoswami> The GCC and clang came from the repository of the ArchLinux and Linux Mint systems
<hightower4> HEre's another standalone shard resulting from the work on crysterm: https://github.com/crystallabs/terminfo
<FromGitter> <Daniel-Worrall> This can't be good ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5dd07b5ac26e8923c439bf19]
<FromGitter> <Daniel-Worrall> Hmmm, I think sam.cr fails to build on alpine
<FromGitter> <Daniel-Worrall> Nevermind, just needed to `shards update`
alex``` has quit [Quit: The Lounge - https://thelounge.chat]
alexherbo2 has joined #crystal-lang
alexherbo2 is now known as alex```
<FromGitter> <Daniel-Worrall> oh, it's a "resolved" bug in shards 0.9.0