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
<FromGitter> <Blacksmoke16> gl
<FromGitter> <636f7374> Hi guys, I found an interesting problem, this invalid code can be compiled but causes the program to exit, no Invalid Memory Access, no segfault, I don't know why.
<FromGitter> <636f7374> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=62351d9409092523182f7974]
<FromGitter> <Blacksmoke16> if i had to guess `exit` exits the program
<FromGitter> <Blacksmoke16> since its a method call
<FromGitter> <Blacksmoke16> https://crystal-lang.org/api/master/toplevel.html#exit%28status%3D0%29%3ANoReturn-class-method
<FromGitter> <636f7374> @Blacksmoke16 Well, that's the problem, thank you, I should rename exit to exit_node, or something else, bye 👋
<FromGitter> <Blacksmoke16> still dont know why they always delete their account after they get an answer :S
<FromGitter> <moe:busyloop.net> i've noticed that too. strange numeric usernames.
<FromGitter> <moe:busyloop.net> i think the new generation kinda treats gitter like a support bot. not necessarily a bad thing for crystal i guess. just a weird cultural shift.
<FromGitter> <moe:busyloop.net> or maybe it's just a bug in the bridge lol
<FromGitter> <Blacksmoke16> naw pretty sure thats their actual username :S
<FromGitter> <Blacksmoke16> no idea what it means, but they're deff a real person id say
<FromGitter> <moe:busyloop.net> woah, yes, he is for sure.
<FromGitter> <moe:busyloop.net> hm. looks like the type who will suddenly submit a giant GC patch that boosts perf by 3x at some point, and then randomly disappear again for a couple years.
<FromGitter> <Blacksmoke16> *wizzards*
<FromGitter> <Blacksmoke16> ah crap, there's only one z
zantrax has quit [Quit: Client closed]
ur5us has joined #crystal-lang
ur5us_ has joined #crystal-lang
ur5us has quit [Read error: Connection reset by peer]
ur5us_ has quit [Ping timeout: 240 seconds]
nq has quit [Quit: Leaving]
taupiqueur has joined #crystal-lang
ur5us_ has joined #crystal-lang
ur5us_ has quit [Ping timeout: 240 seconds]
taupiqueur has quit [Ping timeout: 240 seconds]
<holst> I am trying out HTTP::Client with a simple get and getting this stack trace. Any ideas?
<holst> Invalid encoding: %s (ArgumentError)
<FromGitter> <Blacksmoke16> whats the content of the response?
<FromGitter> <Blacksmoke16> does it work fine in like curl or?
<holst> oh sorry, that file did not exist. The web server returned a 404 :)
<holst> still, a weird error message
<FromGitter> <Blacksmoke16> is the url public?
<holst> but I am using mini_httpd so the file serving might be noncompliant because I did not configure it just started it in a file share directory :)
<FromGitter> <Blacksmoke16> ah, gotcha
ua_ has quit [Ping timeout: 240 seconds]
ua_ has joined #crystal-lang
<holst> blacksmoke16: < Content-Type: text/html; charset=%s
<holst> the web server was actually returning that :)
<holst> I just wonder why HTTP::Client cared at all about that
<holst> even before I tried to access the body
<FromGitter> <Blacksmoke16> probably because it uses it to ensure it reads the body in the proper charset
<holst> mm, it says text/html.. still a bit too high level for my taste to do the encoding to text in the GET
<holst> (The content-type that is)
<FromGitter> <Blacksmoke16> right, the content is html, but `charset` was invalid
<FromGitter> <Blacksmoke16> e.g. it should have been like `UTF-8`
<FromGitter> <Blacksmoke16> but it was `%s`, which is invalid, so it was unable to handle it
<FromGitter> <Blacksmoke16> that property is optional, so could just not include it
notzmv has quit [Ping timeout: 240 seconds]
<holst> that was probably what the author of mini_httpd intended, but its hard to test all failures :)
<holst> I have VERSION in both the app.cr and in shard.yml
<holst> is it possible to reference the version in app.cr via some compiler/build magic?
<holst> reference the shard.yml version I mean
SamantazFox has joined #crystal-lang
SamantazFox has quit [Killed (NickServ (GHOST command used by SamantazFox_))]
SamantazFox_ has joined #crystal-lang
notzmv has joined #crystal-lang
<FromGitter> <Blacksmoke16> `VERSION = {{read_file("./shard.yml").split("version: ")[1].split("\n")[0]}}` found this in GH search
<FromGitter> <Blacksmoke16> tho id just keep it simple and keep em static
SamantazFox has joined #crystal-lang
SamantazFox_ has quit [Ping timeout: 252 seconds]
<holst> mm, if there was a Shard stdlib that did this I'd be ok with it :)
nq has joined #crystal-lang
<FromGitter> <moe:busyloop.net> yeh, this duplication is not great. `shard.yml`, `app.cr`, git tag...
<FromGitter> <Blacksmoke16> its only 2 places
<FromGitter> <Blacksmoke16> not a huge deal
<FromGitter> <Blacksmoke16> technically you dont *need* a `VERSION` const, but its good to have
<FromGitter> <moe:busyloop.net> it's a bug
<FromGitter> <Blacksmoke16> whats a bug?
<FromGitter> <moe:busyloop.net> having a const duplicated in multiple places
<FromGitter> <Blacksmoke16> not really a trivial way to share it
<FromGitter> <moe:busyloop.net> didn't say it's a trivial bug :)
<FromGitter> <Blacksmoke16> high effort, low reward ;)
<FromGitter> <moe:busyloop.net> yeh, eventually it will get fixed, when people get tired of ⏎ https://github.com/didactic-drunk/zstd.cr/issues/4
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <moe:busyloop.net> one of those unsung hero tales. 5 hearts on the merge commit. and a month later nobody will even remember it ever was an issue.