<FromGitter>
<sam0x17> is there a way I can use Process.run with a shell script? right now its saying file does not exist but its a shell script in my PATH and works when invoked from the command line
<FromGitter>
<sam0x17> figured it out -- crystal doesn't automatically resolve things in PATH for this purpose, but if you auto expand what you pass to Process.run with `command -v (my command)` it then works
ukd1 has joined #crystal-lang
sagax has quit [Remote host closed the connection]
early has quit [Quit: Leaving]
early has joined #crystal-lang
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Remote host closed the connection]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<andrius> Are named tuples ordered in a way how data were given? Can I expect that `{f5: 1, f3: 4, ... f0: xxx}.keys` will always return f5, f3... f0? same question about hash
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
alex`` has joined #crystal-lang
<FromGitter>
<naqvis> @andrius yes, they both preserve the order of insertion
<FromGitter>
<naqvis> though very contrived test case but it does shows that keys order is preserved ⏎ ⏎ ```pp Hash{"a" => 1,"b" => 2,"c" => 3,"d" => 4}.keys ⏎ pp ({a: 1, b: 2, c: 3, d: 4}).keys``` [https://gitter.im/crystal-lang/crystal?at=5d4bcce2beba830fff5572c3]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
devil_tux has joined #crystal-lang
sorcus has joined #crystal-lang
devil_tux has quit [Ping timeout: 258 seconds]
<FromGitter>
<bararchy> Is there some built-in method to parse a string\IO as `HTTP::Headers` ?
laaron has quit [Remote host closed the connection]
<FromGitter>
<straight-shoota> Actually `[] of String` is not a type. It's equivalent to `Array(String).new`. For a type, you always need to use `Array(String)`.
laaron has joined #crystal-lang
devil_tux has quit [Ping timeout: 248 seconds]
laaron has quit [Remote host closed the connection]
laaron- has joined #crystal-lang
<FromGitter>
<asterite> andrius: for named tuple it's not guaranteed
teardown has quit [Ping timeout: 245 seconds]
<FromGitter>
<naqvis> Thanks @asterite for confirmation. I tried to surf the documentation but couldn’t find such details.
alex`` has quit [Quit: WeeChat 2.5]
alex`` has joined #crystal-lang
<jokke>
heya
<jokke>
wasn't there a blog post about writing crystal extensions for ruby
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<petr-fischer> Hello! Is there any release plan of bugfixed 0.30.x version (issue #8044)? Tanks!
lucasb has joined #crystal-lang
<jokke>
Val: thanks!
<jokke>
Val: how is it outdated?
<FromGitter>
<bararchy> @asterite thanks for taking the time helping with the Header thingy, I know it might be a low priority as headers are supposed to be case incensative, but it wreck havoc on our ML model which is used to seeing things a certain way
duane has quit [Ping timeout: 272 seconds]
snapcase has quit [Quit: Lost terminal]
snapcase has joined #crystal-lang
snapcase has quit [Quit: leaving]
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
<FromGitter>
<Blacksmoke16> couldnt just make the model downcase everything or something?
duane has joined #crystal-lang
<FromGitter>
<asterite> @barachy sorry for breaking things :-S
<FromGitter>
<asterite> andrius: I was wrong, you can rely on the order :-)
<jokke>
is there a way to define a varadic function pointer for c bindings?
<jokke>
(as a type)
<jokke>
something like `type Func = (Int32, ...) -> Int32
<jokke>
something like `type Func = (Int32, ...) -> Int32`
<FromGitter>
<greenbigfrog> So, TIL that docker doesn't read log from STDOUT, but some other place (from the process with PID 1(?)) ⏎ <https://blog.eq8.eu/til/ruby-logs-and-puts-not-shown-in-docker-container-logs.html> ⏎ Somehow my mosquito worker isn't affected from this, but my website (kemal) is. ⏎ As far as I can tell, I've got them configured the same way. ⏎ You can find the dockerfiles at
<FromGitter>
<Blacksmoke16> mm, you got an example of what you're tryingto do jokke?
<FromGitter>
<greenbigfrog> (gonna be afk for a bit, just wanted to leave this here. Otherwise I would've fergotten this till I'm back)
<FromGitter>
<Blacksmoke16> id look into how you're logging in each
<jokke>
Blackmoke16: i'm trying to define `fun`s from an included hook
<jokke>
but that obviously doesn't work because of it being in the scope of the including type
<FromGitter>
<Blacksmoke16> vs the lib?
<jokke>
no not a lib fun but a fun with a body
<FromGitter>
<tenebrousedge> @greenbigfrog from the docs (https://docs.docker.com/config/containers/logging/): ⏎ ⏎ > The official httpd driver changes the httpd application’s configuration to write its normal output directly to /proc/self/fd/1 (which is STDOUT) and its errors to /proc/self/fd/2 (which is STDERR). See the Dockerfile.
<FromGitter>
<tenebrousedge> you could have the log location set by an ENV var
<FromGitter>
<Blacksmoke16> hmm sorry not sure i follow jokke
ukd1 has joined #crystal-lang
<FromGitter>
<wontruefree> I am looking to create a "react" like application
<FromGitter>
<tenebrousedge> D:
<FromGitter>
<wontruefree> is there a reactive like shard for crystal
<FromGitter>
<wontruefree> I want to build a ncurses app in crystal but was hoping to make it react like
<FromGitter>
<greenbigfrog> @tenebrousedge I already got that info (of redirecting to `/proc/self/fd/1`) from the article I linked. but I'm more interested in why it works for one and not the other. ⏎ Both use `Logger.new(STDOUT)` underneath
<FromGitter>
<tenebrousedge> are they built on the same image?
<FromGitter>
<greenbigfrog> Yes. Built with `crystallang/crystal:0.29.0` and run in `debian:stretch-slim`
duane has quit [Ping timeout: 268 seconds]
<FromGitter>
<tenebrousedge> one of these assumptions is wrong: the calling code is the same, or the file descriptor being written to is the same
duane has joined #crystal-lang
<FromGitter>
<greenbigfrog> mind elaborating wym?
<FromGitter>
<tenebrousedge> theoretically, the logging code is supposed to be writing to the STDOUT (file descriptor) that docker is listening to. Assuming that you're not running into non-deterministic behavior, then writing the same information to the same file descriptor should produce the same result each time
<FromGitter>
<tenebrousedge> so if the observation is that the results differ, one of the starting assumptions must be wrong
<FromGitter>
<tenebrousedge> either there's some code intercepting the call, or otherwise changing that code
<FromGitter>
<tenebrousedge> or the logger is pointed at some other file descriptor
<FromGitter>
<tenebrousedge> I would probably use `docker run -it` and a small test program and see what file descriptor crystal thinks that STDOUT is
<FromGitter>
<tenebrousedge> and generally speaking, being able to take the logging location as an ENV var isn't a bad thing
<FromGitter>
<greenbigfrog> STDOUT is the same in both AFAICT
<FromGitter>
<watzon> @wontruefree by "reactive" do you mean like all the RX packages that exist in different languages?
<FromGitter>
<tenebrousedge> @greenbigfrog and that matches what the main app thinks STDOUT is?
<FromGitter>
<greenbigfrog> Wdym? That's the same binary run in the 2 differently behaving containers. (or more like the code runs differently then I think it does.)
<FromGitter>
<tenebrousedge> well you're logging in your web app, yeah?
<FromGitter>
<tenebrousedge> so the question is whether the web app behaves the same as the test binary
<FromGitter>
<tenebrousedge> if so... 😦
<FromGitter>
<greenbigfrog> Just the default kemal logging (which I can't see.) I think I might be able to see STDERR though IIRC
<FromGitter>
<greenbigfrog> (s/default/standard/)
teardown has joined #crystal-lang
gangstacat has quit [Quit: Ĝis!]
alex`` has quit [Ping timeout: 246 seconds]
alex`` has joined #crystal-lang
<FromGitter>
<greenbigfrog> So I should just use `Logger.new(IO::FileDescriptor.new(1))` instead of `Logger.new(STDOUT)`?
<FromGitter>
<greenbigfrog> @tenebrousedge boop
<FromGitter>
<tenebrousedge> does it do the right thing?
<FromGitter>
<cllty> is crystal still single threaded?
<FromGitter>
<Blacksmoke16> yes
<FromGitter>
<Blacksmoke16> but MT is in progress
<FromGitter>
<cllty> it was in progress 2yrs back when I asked here
<FromGitter>
<watzon> From what I understand certain PRs haven't been getting merged because they're wanting to wait for MT to be finished, which means it's gotta be pretty close
<FromGitter>
<greenbigfrog> I'm not getting output using something like pp or puts (that uses STDOUT) but as soon as I add/use a `Logger.new(STDOUT)` in a custom log handler I'll get all stdout output
<FromGitter>
<greenbigfrog> wtf
blassin has joined #crystal-lang
<FromGitter>
<Blacksmoke16> dunno
<FromGitter>
<greenbigfrog> would be nice to know if the error is on my side, or not...
<FromGitter>
<greenbigfrog> Lemme know if anyone has any idea the slightest, I think I'll just have to sleep over it
laaron has quit [Remote host closed the connection]
laaron has joined #crystal-lang
sorcus has quit [Ping timeout: 252 seconds]
ht_ has quit [Remote host closed the connection]
<FromGitter>
<rmarronnier> Hey all, do you know if shards can include `git submodules` ? I created a shard that includes one and `shards install` fetches the main repo with the submodule folder without any content in it. Example : https://github.com/rmarronnier/fastText-crystal
<FromGitter>
<straight-shoota> @rmarronnier No, shards does not support submodules. It expects each shard to be fully in it's own repository.
<FromGitter>
<straight-shoota> If you want to use a different development strategy, that's completely fine, you just need a separate repo (or branch) as distribution channel for shards then.