ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Fund Crystal's development: https://crystal-lang.org/sponsors | GH: https://github.com/crystal-lang/crystal | Docs: https://crystal-lang.org/docs | Gitter: https://gitter.im/crystal-lang/crystal
richbridger has quit [Remote host closed the connection]
richbridger has joined #crystal-lang
<FromGitter> <jrei:matrix.org> @wyhaines you may say the same thing in 10 years, on another new language's channel 😀
f1refly has quit [Ping timeout: 258 seconds]
f1refly has joined #crystal-lang
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 246 seconds]
aquijoule_ has joined #crystal-lang
richbridger has quit [Ping timeout: 265 seconds]
<FromGitter> <ibraheemdev> Does crystal have a 1.0 roadmap?
<FromGitter> <ibraheemdev> Or timeline?
<FromGitter> <Blacksmoke16> it'll be the next release
<FromGitter> <ibraheemdev> really?
<FromGitter> <ibraheemdev> wow
<FromGitter> <ibraheemdev> Do you have any idea when (months) that will be?
<FromGitter> <Blacksmoke16> Not officially no
<FromGitter> <Daniel-Worrall> any time between 0 and 6 months
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 272 seconds]
avane has quit [Quit: ZNC - https://znc.in]
avane has joined #crystal-lang
<FromGitter> <djberg96> "Christmas"
deavmi has joined #crystal-lang
_ht has joined #crystal-lang
alexherbo2 has joined #crystal-lang
deavmi has quit [Quit: Eish! Load shedding.]
deavmi has joined #crystal-lang
<FromGitter> <alexherbo2> hello
<FromGitter> <alexherbo2> is there a way to create fifo in crystal?
<FromGitter> <alexherbo2> my use case is to get a value from Kakoune, by creating a fifo and make Kakoune write a state to it, and waiting for reading the value.
<FromGitter> <alexherbo2> I can use `mkfifo` in Crystal, but I would like a built-in way or another approach
<FromGitter> <alexherbo2> when I send a command with `:send` it is async, so I used a fifo for waiting the value
<yxhuvud> alexherbo2: Yes, IO.pipe
<FromGitter> <oprypin:matrix.org> also i guess UNIXSocket is a
<FromGitter> <oprypin:matrix.org> more direct match for the question
<yxhuvud> Right.
<FromGitter> <alexherbo2> thanks o/
<FromGitter> <alexherbo2> unix socket is what I was looking for
<FromGitter> <alexherbo2> can tempfile be used for creating unix sockets?
<FromGitter> <alexherbo2> I just need the socket for a one shot reading
jetpack_joe has quit [Quit: Connection closed for inactivity]
<FromGitter> <oprypin:matrix.org> wow this sucks. https://carc.in/#/r/adct works but https://carc.in/#/r/adcu the block gets ignored
<FromGitter> <naqvis> @oprypin:matrix.org true but seems that's intentional, as if you change that to `new`, one would still need to redefine `around_exec` or else macro expansion will yell at you saying `there is no previous definition of 'around_exec'`
<FromGitter> <oprypin:matrix.org> yea but then i just dont use `def_around_exec`
<FromGitter> <oprypin:matrix.org> can do `def around_exec(request); yield super; end`
<FromGitter> <naqvis> seems this decision was intentional or with assumption that `HTTP::Client` won't get extended by 3rd party
<FromGitter> <naqvis> as stdlib `Log` module is utilizing this macro by just reopening the class
<FromGitter> <oprypin:matrix.org> jsut wrong decision
<FromGitter> <HertzDevil> does `:nodoc:` prevent a particular reopening of a type from appearing under the "defined in" section?
deavmi has quit [Ping timeout: 272 seconds]
<FromGitter> <HertzDevil> hmm doesn't seem so
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 265 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 265 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 265 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 246 seconds]
<FromGitter> <asterite> What's the issue with http client?
<oprypin> asterite, i wanted to make a customized subclass of HTTP::Client but it doesn't respect subclasses and only expects to be monkeypatched
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 246 seconds]
deavmi has joined #crystal-lang
<yxhuvud> oh, my logic is totally borked. No wonder it doesn't work.
deavmi has quit [Ping timeout: 246 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 246 seconds]
deavmi has joined #crystal-lang
<oprypin> i forgot, how to make a variable accessible to all specs?
<oprypin> best i can think of is either a constant or a method
<oprypin> hm a `describe` block makes it work, although it's meaningless for me
deavmi has quit [Ping timeout: 264 seconds]
deavmi has joined #crystal-lang
<FromGitter> <Blacksmoke16> Class getter or const prob
alexherbo2 has quit [Ping timeout: 246 seconds]
deavmi has quit [Read error: Connection reset by peer]
deavmi has joined #crystal-lang
alexherbo2 has joined #crystal-lang
<FromGitter> <alexherbo2> it looks the compiler does not know my variable is a string, with `case` matching the type.
<FromGitter> <alexherbo2> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60203fc15500a97f82f1f98d]
<FromGitter> <alexherbo2> with `my_method(String, String) or my_method(String)`, the compiler tells me no overload matches `(String | Nil)`
<FromGitter> <oprypin:matrix.org> @alexherbo2: can u provide actual runnable code
<FromGitter> <alexherbo2> it is trash x(
<FromGitter> <alexherbo2> @oprypin:matrix.org https://gist.github.com/alexherbo2/3fc009fcaabb7b41d81e122db1433a73
<FromGitter> <alexherbo2> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=602040bc1ed88c58d828de7c]
<FromGitter> <alexherbo2> I explicitely check the type in `cli.cr` before passing, so it should know I'm passing a string no?
deavmi has quit [Ping timeout: 272 seconds]
<FromGitter> <alexherbo2> I would like to avoid flow control and the `argv.shift` to separate the `command` from the `arguments` to pass to my method
<FromGitter> <alexherbo2> I tried splat, but it is not allowed
deavmi has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 264 seconds]
<FromGitter> <asterite> oprypin because of around? Yeah, when it was introduced I mentioned that this should be done with actual callbacks, not macro code. But I think they were in a hurry to add logging to http
alexherbo2 has joined #crystal-lang
<FromGitter> <asterite> Taupiquer session and the other one are closured by the option parser callbacks so they cant be type filteted
<FromGitter> <asterite> Ideally the compiler should tell you that
<FromGitter> <alexherbo2> oh :o
<FromGitter> <asterite> Assign them first to another variable after the option parser finiishes
<FromGitter> <asterite> Or finishes, depending on how bad an autocorrector you are using
<FromGitter> <alexherbo2> is there a way to forward a hash as the named parameters of the method?
<FromGitter> <alexherbo2> something like `my_method(**named_params)`
<FromGitter> <alexherbo2> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60204729a0246860dc3a9d9e]
<FromGitter> <asterite> No
<FromGitter> <djberg96> ok, moved it: https://github.com/djberg96/crystal-uname :)
<FromGitter> <alexherbo2> should `record` be documented here? https://crystal-lang.org/reference/syntax_and_semantics/structs.html
<FromGitter> <alexherbo2> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=602049589fa6765ef804d2db]
alexherbo23 has joined #crystal-lang
alexherbo2 has quit [Ping timeout: 265 seconds]
alexherbo23 is now known as alexherbo2
deavmi has quit [Ping timeout: 265 seconds]
_ht has quit [Remote host closed the connection]
deavmi has joined #crystal-lang
postmodern has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
<FromGitter> <asterite> Possibly
<postmodern> how do you handle compiler errors for C bindings when a function is missing from the library? or should you guard that code with flags?
deavmi has joined #crystal-lang
<FromGitter> <asterite> Good question. How do you do it in C or Ruby?
<FromGitter> <oprypin:matrix.org> postmodern (https://matrix.to/#/@postmodern:matrix.org): i think you mean linker errors?
<postmodern> oprypin, ah correct. wasn't sure if the crystal compiler did some extra checks before linking
<FromGitter> <oprypin:matrix.org> C handles it with ./configure, Crystal just doesnt
<postmodern> asterite, in Ruby I'd use FFI which is 100% runtime (uses dlopen and dlsym under the hood).
<FromGitter> <oprypin:matrix.org> openssl bindings is a decent example, it just checks the version before assuming a fucntion is available (I *think*, not sure)
<FromGitter> <asterite> I think in Ruby without ffi there's extrb which lets you check if a function exists
<FromGitter> <asterite> They do it by compiling a small program and see if it's successful or not
<FromGitter> <asterite> I think we should do the same, eventually
<FromGitter> <oprypin:matrix.org> > They do it by compiling a small program and see if it's successful or not ⏎ ⏎ that's what ./configure does typically too
<FromGitter> <oprypin:matrix.org> thats why is so slow lol
<FromGitter> <asterite> extconf rb
<postmodern> asterite, correct you'd use extconf and mkmf to generate C test programs to figure out things
<FromGitter> <asterite> But with an install hook you could do it then?
<postmodern> yeah i could probably roll my own configure script or add some auto-generated config.cr file that a Makefile generates
<postmodern> maybe in the future we could port over mkmf (it's code may be ugly, but it provides the necessary logic)