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
alex`` has quit [Ping timeout: 245 seconds]
duane has joined #crystal-lang
chemist69 has quit [Ping timeout: 276 seconds]
chemist69 has joined #crystal-lang
duane has quit [Ping timeout: 268 seconds]
ht_ has joined #crystal-lang
ht_ has quit [Quit: ht_]
user3 has quit [Ping timeout: 260 seconds]
user3 has joined #crystal-lang
alex`` has joined #crystal-lang
DTZUZO has quit [Ping timeout: 246 seconds]
alex`` has quit [Ping timeout: 276 seconds]
alex`` has joined #crystal-lang
<FromGitter> <j8r> Is it safe to use do a loop with `Dir.cd path {}`, with `path` being different everytime, inside spawn? ⏎ I don't want to `cd` to a directory and then the scheduler switching to another task
<FromGitter> <Daniel-Worrall> Put it in the spawn with a CD muted
<FromGitter> <Daniel-Worrall> Mutex
<FromGitter> <Daniel-Worrall> I think there's a mutex synchronise block method you can poop
<FromGitter> <Daniel-Worrall> Loop
<FromGitter> <Daniel-Worrall> The worst part of this spellcheck is that it processes the last word even if you press enter
<FromGitter> <Daniel-Worrall> So I always end up sending the wrong last word
<FromGitter> <tenebrousedge> that seems like a pretty vindictive spellcheck
<FromGitter> <j8r> haha :)
<FromGitter> <j8r> @Daniel-Worrall thanks
<FromGitter> <j8r> I'm not sure if a mutex will solve this
<FromGitter> <j8r> Ohh, I'm dumb
<FromGitter> <j8r> Forget it, I spawn some `Process`, but the `chdir` do a `cd` too
<FromGitter> <j8r> Hum ok, I can try the mutex
<FromGitter> <j8r> Too bad that the `Dir.cd {}` doesn't use a mutex
<FromGitter> <j8r> I can ask to the forum, too
blassin has quit [Quit: The Lounge - https://thelounge.chat]
blassin has joined #crystal-lang
DTZUZO has joined #crystal-lang
user3 has quit [Ping timeout: 260 seconds]
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
DTZUZO has quit [Ping timeout: 240 seconds]
<repo> mutexes are overhead. i think it's better to leave thread-safety to the user unless something is explicitly defined as a thread safe data structure (like channels)
<FromGitter> <j8r> it's not about thread safe, but concurrent-safe
<FromGitter> <j8r> I think it is
<FromGitter> <j8r> all the code inside a spawn is blocking, right?
<FromGitter> <Daniel-Worrall> I think a mutex is right (Though maybe share some code to check)
DTZUZO has joined #crystal-lang
DTZUZO has quit [Ping timeout: 276 seconds]
sagax has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
sagax has joined #crystal-lang
<FromGitter> <fridgerator> I'm in the process of binding TA-lib, in case anyone is interested : http://ta-lib.org/
<FromGitter> <fridgerator> writing bindings for*
<Welog> hello there. Should I replace Channel::Unbuffered by Channel in 0.31.0 ? thnaks
<FromGitter> <didactic-drunk> Yes.
<Welog> thanks didactic-drunk I wasn't sure
sagax has quit [Quit: Konversation terminated!]
sagax has joined #crystal-lang
ht_ has joined #crystal-lang
<FromGitter> <wontruefree> the links to the remote link is updated. We would like to have people from the community join our crystal meetup chicagocrystal.org/events/lxmhvqyznbfb/
<FromGitter> <fridgerator> 👍
<FromGitter> <wontruefree> I am excited for this
duane has quit [Ping timeout: 276 seconds]
kiliji has joined #crystal-lang
<kiliji> hi
<FromGitter> <Blacksmoke16> o/
duane has joined #crystal-lang
<kiliji> I'm new to crystal
<kiliji> i was looking through web frameworks
<FromGitter> <Blacksmoke16> what are you looking to make?
<kiliji> some small websites
<kiliji> i found kemal
<FromGitter> <Blacksmoke16> that would be the most simplistic
<kiliji> but it seems it hasn't been updated to support latest crystal version
<kiliji> is it abandoned
<FromGitter> <Blacksmoke16> not as far as i know
<FromGitter> <fridgerator> it would be strange if it were, since the creator of kemal is also on the crystal core team
<FromGitter> <Blacksmoke16> \cc @sdogruyol
<kiliji> oh!
<FromGitter> <fridgerator> Is there some compiler error when trying to use with the latest crystal?
<FromGitter> <Blacksmoke16> im looking now
<FromGitter> <Blacksmoke16> doesn't look like it, specs passed fine on `0.31.0`
<kiliji> no actually i looked in lucky before
<FromGitter> <Blacksmoke16> lucky is alot a popular one, more feature rich id say
<FromGitter> <Blacksmoke16> kemal is basically just a fancy router
<FromGitter> <Blacksmoke16> is another popular one*
<kiliji> lukcy's docs explicitly stated it is not supported with v31 yet
<FromGitter> <Blacksmoke16> do realize 0.31.0 came out like a week ago, and the `0.31.1` which fixed some issues came out like yesterday
<FromGitter> <Blacksmoke16> so support is coming
<kiliji> oh i was not aware of that
<FromGitter> <Blacksmoke16> just takes some time due to breaking changes happening now and then
<kiliji> and the last update to kemal was also 3months back
dannyAAM has quit [Quit: znc.saru.moe : ZNC 1.6.2 - http://znc.in]
dannyAAM has joined #crystal-lang
<FromGitter> <Blacksmoke16> afaik kemal is pretty much feature complete atm? so only changes would be bug fixes or fixes to support new crystal versions
<kiliji> is there a list of recommended packages that go with kemal
<kiliji> like authentication, interface to redis
<FromGitter> <Blacksmoke16> not that im aware of
<FromGitter> <Blacksmoke16> https://github.com/kemalcr?type=source are some extra repos in kemalcr org that might be helpful, but idk anything about them
<FromGitter> <Blacksmoke16> there is a kemal gitter channel that might be helpful as well
<FromGitter> <sam0x17> getting libcrypto / libssl / libz warnings for crystal 0.31.0 on alpine that I didn't get for the previous version, and I have openssl-dev and zlib-dev installed: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d939b5b24509b60469037df]
<FromGitter> <eliasjpr> Anyone has an idea of the following error this is build with `-Dpreview_mt` flag and release flag ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d939b6947de0a719d450be0]
<FromGitter> <Blacksmoke16> id make sure both of you are using `0.31.1`?
<FromGitter> <eliasjpr> I am
<FromGitter> <sam0x17> 1) 31.1 won't be out on alpine for a few days most likely
<FromGitter> <sam0x17> its usually a one week turnaround time minimum
rohitpaulk has joined #crystal-lang
<FromGitter> <Blacksmoke16> looks like you're on `0.31.0_1` @eliasjpr
<FromGitter> <Blacksmoke16> brew formula didnt get merged yet
<FromGitter> <eliasjpr> got it
<FromGitter> <Blacksmoke16> is it simple code?
<FromGitter> <eliasjpr> got confused on the naming convention 😓
<FromGitter> <Blacksmoke16> could test it in a docker container
<FromGitter> <eliasjpr> So it seems that the multithread flag is simply forking threads in the background
<FromGitter> <eliasjpr> does that explains the warning for Process.fork with mt flag on?
<FromGitter> <Blacksmoke16> dunno
<FromGitter> <fridgerator> Is t he correct way to pass a variable of type `Array(Float64)` to a c function expecting `double *` to use `variable.to_unsafe` ?
duane has quit [Read error: Connection reset by peer]
duane has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
duane has quit [Ping timeout: 240 seconds]
<FromGitter> <kinxer> Are class-subclass definitions intentionally ordered? (https://play.crystal-lang.org/#/r/7oev vs https://play.crystal-lang.org/#/r/7oew)
rohitpaulk has quit [Quit: Ping timeout (120 seconds)]
<FromGitter> <Blacksmoke16> probably has more to do with the compiler? it most likely goes from top to bottom, sees that type it hasnt seen before and errors
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/7oex oh but this works
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <kinxer> Yeah, that's what I assumed. I was just curious if that was an intentional choice about compiler behavior.
<FromGitter> <sam0x17> is there an easy way to disable a spec (like `xit` instead of `it`) without commenting it out?
<FromGitter> <Blacksmoke16> you can focus now
<FromGitter> <Blacksmoke16> but thats for the opposite, i dont think `focus: false` would do anything
<FromGitter> <kinxer> You can change `it` to `pending`.
<FromGitter> <Blacksmoke16> good call ^
kiliji has quit [Quit: Leaving]
<FromGitter> <sam0x17> ah ty
ht_ has quit [Quit: ht_]
<FromGitter> <fridgerator> anyone with c binding experience mind lending me a hand?
<FromGitter> <nsuchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d93d009bf625112c0168761]
<FromGitter> <nsuchy> I get an error can't return from top level
<FromGitter> <nsuchy> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d93d029fcb47b627ffd4aaa]
<FromGitter> <nsuchy> what does that mean?
<FromGitter> <Blacksmoke16> You can't return on the top level?
<FromGitter> <Blacksmoke16> I.e have to be within a method
<FromGitter> <nsuchy> oh
<FromGitter> <nsuchy> I feel stupid now
<FromGitter> <nsuchy> 😊
<FromGitter> <Blacksmoke16> thats prob not real efficient either
<FromGitter> <nsuchy> what's not?
<FromGitter> <nsuchy> the code?
<FromGitter> <nsuchy> this works for my purposes
<FromGitter> <nsuchy> I needed to check if the url parsing still worked
<FromGitter> <Blacksmoke16> you just want to parse out the `hypervisor-cust-hdd-01`?
HumanG33k has joined #crystal-lang
HumanG33k has quit [Remote host closed the connection]
HumanG33k has joined #crystal-lang
<FromGitter> <nsuchy> pretty much
<FromGitter> <nsuchy> this code is so messy
<FromGitter> <nsuchy> compared to my new code
<FromGitter> <nsuchy> I'm thinking what idiot wrote this and then realized its me lol
<FromGitter> <Blacksmoke16> was going to say you could use `URI.parse(URL).host.try &.split('.').first`
<FromGitter> <Blacksmoke16> but apparently that is slower than gsub
<FromGitter> <nsuchy> some of this code
<FromGitter> <nsuchy> was copied from ruby
<FromGitter> <nsuchy> for parsing the URLs
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d93d2fcfb131014e7212364]
<FromGitter> <nsuchy> no changes were needed
<FromGitter> <nsuchy> it was great
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5d93d301eb1eff63d65ced92]
<FromGitter> <Blacksmoke16> maybe the uri parser could be optimized a bit
<FromGitter> <nsuchy> it probably does more checks
<FromGitter> <nsuchy> our code trusts the URL is correct
<FromGitter> <Blacksmoke16> yea prob
<FromGitter> <nsuchy> only developers have access to the forms to enter in hypervisor urls so its not an issue atm
<FromGitter> <Blacksmoke16> 👍
hypercore has joined #crystal-lang
alex`` has quit [Quit: WeeChat 2.6]
go|dfish has quit [Ping timeout: 240 seconds]