ChanServ changed the topic of #crystal-lang to: The Crystal programming language | http://crystal-lang.org | Crystal 0.23.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> <codenoid> morning ,,, 🐣
<FromGitter> <codenoid> btw gets method (from IO) wont work if i compile it with S E N T R Y
greengriminal has joined #crystal-lang
oprypin has quit [Ping timeout: 240 seconds]
FromGitter has quit [Ping timeout: 248 seconds]
oprypin has joined #crystal-lang
FromGitter has joined #crystal-lang
FromGitter has quit [Ping timeout: 276 seconds]
FromGitter has joined #crystal-lang
<FromGitter> <domgetter> I can `build` just fine, but when I `build --release`, I'm getting this error: https://gist.github.com/domgetter/2da07138559cc4b86d3bcdbda66da398
<FromGitter> <domgetter> Any thoughts?
<FromGitter> <johnjansen> add `—no-debug` its a bug with 0.23.1
<FromGitter> <johnjansen> thats double dash
<FromGitter> <domgetter> oh man I just had to scroll up 10 lines to see someone else with the issue. Thanks @johnjansen
<FromGitter> <johnjansen> it was me ;-)
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #crystal-lang
<FromGitter> <domgetter> Now I can get back to figuring out why my SDL event handling is slow
rohitpaulk has quit [Ping timeout: 255 seconds]
greengriminal has quit [Quit: Leaving]
rohitpaulk has joined #crystal-lang
dhk has joined #crystal-lang
dhk has quit [Client Quit]
rohitpaulk has quit [Ping timeout: 260 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 255 seconds]
rohitpaulk has joined #crystal-lang
rohitpaulk has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #crystal-lang
_whitelogger has joined #crystal-lang
hightower2 has joined #crystal-lang
<FromGitter> <bigDaddyS1oth> Hey all, it's been awhile. I'm on a new comfy Linux distro called Void and I'm installing Crystal from source, and I was curious if it's taken awhile for those of you who've done the same.
<FromGitter> <bigDaddyS1oth> `make` is just taking awhile but I did give it the `-si` flags so that's probably why.
<hightower2> Did you run it with -jX?
<hightower2> (If not that's another reason why it's taking a while ;-)
<FromGitter> <bigDaddyS1oth> nope just`make -si`
<FromGitter> <bigDaddyS1oth> what do the j and X flags do?
<FromGitter> <bigDaddyS1oth> oh j is for jobs
hightower4 has joined #crystal-lang
hightower3 has quit [Ping timeout: 268 seconds]
<Groogy> Morning!
<Groogy> Though I don't think giving it more threads to compile will make it faster since Crystal compiles everything into one object file right?
mark_66 has joined #crystal-lang
crack08 has joined #crystal-lang
<FromGitter> <crisward> The standard crystal init command creates a shard.yml file with a version, it also create a `version.cr` file containing a version. I'm looking at a deploy system for our code at the moment and it seems odd to have two places to update. Should this be raised as an issue on Crystal? An obvious solution may be to load a parse shard.yml into app/version.cr at compile time so they're always the same. Thoughts?
<FromGitter> <konovod> btw there is a shard for updating both) https://github.com/elorest/crelease but yes, I don't understand point of having version in two places too.
<FromGitter> <crisward> @konovod Thanks for that, looks useful. Personally I think this should be part of either the shards or crystal commands. A bit like `npm version patch` and just update the yml file.
<FromGitter> <sdogruyol> Hey everyone
<Groogy> Hello!
<FromGitter> <crisward> Morning!
<FromGitter> <sdogruyol> How are you
<FromGitter> <crisward> Ok, now have 3 Kemal sites live - https://www.hmkdirect.com/ and http://www.itsnotokay.co.uk/ and ours. Some more in the pipeline. Just frustrated I can't run crystal with the --release flag due to https://github.com/crystal-lang/crystal/issues/4719
<FromGitter> <crisward> Also using my mysql-sessions on all which seems to be working well.
crack08 has quit [Ping timeout: 246 seconds]
Raimondii has joined #crystal-lang
<FromGitter> <sdogruyol> @crisward wow, that's great
Raimondi has quit [Ping timeout: 268 seconds]
Raimondii is now known as Raimondi
mjblack has quit [Quit: ZNC - http://znc.in]
hightower2 has quit [Ping timeout: 240 seconds]
<crystal-gh> [crystal] icyleaf closed pull request #4496: Markdown support mulit blockquotes (master...markdown-support-mulit-blockquotes) https://git.io/vHuyV
<FromGitter> <romain1189> Hello everyone!
<FromGitter> <romain1189> Does someone know if a compile-time flag can be set directly from crystal, through a macro?
<FromGitter> <straight-shoota> I don' think so. But you could probably use a constant for this purpose.
<FromGitter> <romain1189> Its value would depend on the result of a command executed in a subshell if the user doesn't specify the flag himself
<FromGitter> <straight-shoota> Just assign the constant with a macro
<FromGitter> <romain1189> Ah yes, thanks. I forgot this was possible
hightower2 has joined #crystal-lang
<FromGitter> <bigDaddyS1oth> Oh yea so I couldn't compile Crystal. The process went for 6 hours and didn't finish. .-.
<FromGitter> <straight-shoota> Is there a way to use a string symbol like `:"foo bar"` as a named argument? ⏎ It's possible to call a method like that with a double splat operator, but can I have it as a named argument? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=596f4a8876a757f808267425]
<Papierkorb> Probably not as named argument
<Papierkorb> would be quite funky
<oprypin> double_splat(**{:"23578":
<oprypin> wait what
<FromGitter> <straight-shoota> Fount it! External name works: 😄 ⏎ ⏎ ```def accept("foo bar" foo_bar); foo_bar; end ⏎ accept "foo bar": "baz" # => "baz"``` [https://gitter.im/crystal-lang/crystal?at=596f4b4176a757f80826773d]
<Papierkorb> ... Can we ban that?
<Papierkorb> surprised the parser accepts that
<FromGitter> <straight-shoota> makes sense
<FromGitter> <straight-shoota> otherwise you're screwed if you try doublesplatting a named tuple with string keys^^
<oprypin> why tho
<Papierkorb> Multiple word argument names sounds like something I'd rather not have
Philpax has joined #crystal-lang
<FromGitter> <straight-shoota> usually not, true
<crystal-gh> [crystal] MakeNowJust opened pull request #4726: Correct to parse string interpolation with trailing newline (master...fix/crystal/4713-parse-string-interpolation-newline) https://git.io/vQjUD
<FromGitter> <codenoid> i forget it, :( how to search with `string.includes?` with 2 / more give value
<FromGitter> <codenoid> haha, i'll use this `myarray.any? { |x| ["val1", "val2", "val3", "val4"].include?(x) }` when still forget about the syntax
Papierkorb has quit [Ping timeout: 268 seconds]
<crystal-gh> [crystal] straight-shoota opened pull request #4727: Add NamedTuple#update(other : NamedTuple) to merge values but keep type (master...named-tuple-update) https://git.io/vQjte
Papierkorb has joined #crystal-lang
Philpax has quit [Ping timeout: 255 seconds]
<FromGitter> <fridgerator> @codenoid do it backwards, and with array.includes?
<FromGitter> <fridgerator> `[array of strings].includes? the_string`
<FromGitter> <codenoid> oh, haha,, ok ["cat","dog","fish"].includes? "i belive to my cat, i belive my cat can fly",, 👍 thanks
<FromGitter> <straight-shoota> no, this won't work
<FromGitter> <straight-shoota> this would return true for `["cat", "dog", "fish"].includes? "cat"`
<FromGitter> <straight-shoota> you might wanna try using a regex: `"i belive to my cat, i belive my cat can fly".match(/cat|dog|fish/)
<FromGitter> <codenoid> 😆 👍 ,
<FromGitter> <codenoid> `Range(Int32, JSON::Any)#each()` , actually, my string (from JSON.parse), just have number value,
<FromGitter> <codenoid> i've tried to use .to_i but `undefined method 'to_i'`
<FromGitter> <codenoid> `.to_s.to_i
<FromGitter> <codenoid> hahah, its work,, 😆
pwned has joined #crystal-lang
<crystal-gh> [crystal] RX14 closed pull request #4592: Parser: fix #4590, correct to parse empty parenthesis "()" (master...fix/crystal/4590-wrap-paren-nop) https://git.io/vHjy5
hightower2 has quit [Ping timeout: 248 seconds]
<FromGitter> <codenoid> best crystal app in 2k17 😆 https://github.com/codenoid/chuck-norris-holy-quotes
<FromGitter> <MakeNowJust> I wanna become Crystal collaborator (maintainer) or join to GitHub crystal-lang org for more contributing to Crystal. Who have such a authority?
mark_66 has quit [Quit: Leaving.]
<FromGitter> <codenoid> but, can someone help me about eaching value from 2 / more result ?,, https://github.com/codenoid/chuck-norris-holy-quotes/blob/master/src/chucknorriscr.cr#L31
<FromGitter> <MakeNowJust> I think I should maintain `crystal tool expand` and `make help` at least because they are created by me.
<FromGitter> <sdogruyol> You should talk that with official team and I'm sure @mverzilli can help @MakeNowJust
<FromGitter> <MakeNowJust> @sdogruyol thx
<FromGitter> <codenoid> @bararchy 😆
<FromGitter> <bew> @codenoid instead of `to_s.to_i` you should use `as_i`, see https://crystal-lang.org/api/0.23.0/JSON/Any.html
fazibear has joined #crystal-lang
<FromGitter> <bew> Also, you can simply use `data["result"].as_a.each ...`
<FromGitter> <codenoid> and @bew when i try ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=596f6e71f5b3458e3060ec81]
<FromGitter> <codenoid> oh wait
<travis-ci> crystal-lang/crystal#eb52d56 (master - Parser: fix #4590, correct to parse empty parenthesis "()"): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/255277860
<FromGitter> <bew> i is already a JSON::Any object I think
<FromGitter> <bew> I just checked the ChuckNoris API you're using, you should use JSON.mapping and stuff to easily get what you want from the api's output
xiljin has joined #crystal-lang
<FromGitter> <codenoid> 😆 , ok @bew , i'll learn about json mapping,, ✨ https://github.com/codenoid/chuck-norris-holy-quotes/blob/master/src/chucknorriscr.cr#L32
<oprypin> MakeNowJust, the way this has happened so far is people who regularly and reliably contribute to the language get an invite from the core team. you probably can't just ask to be added. and you're not supposed to push commits by yourself anyway. you'd still be doing pull requests. so overall not a big deal, i would say.
<FromGitter> <bew> @codenoid `JSON.parse holyquote.to_json` oO
<FromGitter> <codenoid> i cant get directly from holyquote
<FromGitter> <codenoid> LOL
<xiljin> is it possible to get the remote/client IP address from HTTP::Server? I've looked through Context and Request but don't see anything obvious ..
<FromGitter> <bew> @codenoid use: `JSON::Any.new(holyquote)`
<FromGitter> <bew> It'll be way lighter ^^
<FromGitter> <codenoid> whoa,,, thanks 😆 @bew
<FromGitter> <bew> Yw :D
fazibear has quit [Ping timeout: 248 seconds]
<FromGitter> <straight-shoota> @xiljin, I think there is an open PR for this. It's not trivial though.
<FromGitter> <bew> It looks like you can even use `data["result"].each do |holyquote| holyquote["value"] end`
<FromGitter> <straight-shoota> ===1722===
<FromGitter> <bew> @codenoid
fazibear has joined #crystal-lang
<FromGitter> <codenoid> i've have been triend that, but it's wont work @bew
<Papierkorb> each != map
<FromGitter> <bew> According to the implementation, it should work @codenoid, what's not working for you?
<FromGitter> <codenoid> what,
<FromGitter> <codenoid> :/ work fine
<xiljin> @straight-shoota, ahh I see, thank you!
<travis-ci> crystal-lang/crystal#eb52d56 (master - Parser: fix #4590, correct to parse empty parenthesis "()"): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/255277860
<FromGitter> <codenoid> it's `magic`
<RX14> xiljin, remote IP is exposed on the TCP socket, it's just not made it's way up to the HTTP abstraction yet
<RX14> in addition you may also choose to trust your proxies and read the remote address from X-Forwarded-For
<RX14> it all depends on your usecase etc.
<RX14> it's a harder problem than it seems sometimes
<Papierkorb> truth be told, that client information should be exposed in any case
<RX14> yes both should be exposed
<RX14> which i think neither are currently
<RX14> well, not parsed
<xiljin> @RX14, yes, especially since #1722 has been open since 2015 :)
fazibear has quit [Ping timeout: 255 seconds]
fazibear has joined #crystal-lang
<FromGitter> <straight-shoota> In a handler you can read the header yourself but you have no information about the socket.
<FromGitter> <straight-shoota> In a handler you can read the header yourself but you have no information about the socket.
<FromGitter> <straight-shoota> In a handler you can read the header yourself but you have no information about the socket.
fenicks has joined #crystal-lang
<oprypin> 🤔
fazibear has quit [Ping timeout: 250 seconds]
fazibear has joined #crystal-lang
fazibear has quit [Ping timeout: 255 seconds]
<FromGitter> <bigDaddyS1oth> Hey is there are tarball for Crystal I can download? Void doesn't have a package for Crystal (yet) and to create it from sources doesn't work (I think it tries to use OpenSSL, which Void uses LibreSSL).
<Groogy> Eh ArchLinux compiles without OpenSSL from what I remember
<Groogy> so you should be able to compile without openssl unless you need it?
<FromGitter> <bigDaddyS1oth> well when you run make there's a `-noopenssl` tag and I let this computer run for 6 hours straight last night and `make` was still going.
<FromGitter> <bigDaddyS1oth> And I have no idea why nothing was seemingly getting done with `make`
<RX14> well wat was the output
<RX14> was the compiler hanging?
<FromGitter> <bigDaddyS1oth> I think so
<Groogy> also did you have LLVM installed as well?
<RX14> well it tells you
<FromGitter> <bigDaddyS1oth> Yup LLVM is here
<RX14> make echoes the commands it runs
<RX14> was there any output
<RX14> also -noopenssl isn't a thing
<Groogy> might work for you?
<RX14> `make crystal` adds -D without_openssl for you
<RX14> not that you'll magically be able to compile anything that depends on ssl either
<FromGitter> <bigDaddyS1oth> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=596f8a3e329651f46ea26654]
<RX14> so yes it runs the compiler
<RX14> add stats=true to make and see what happens
<FromGitter> <bigDaddyS1oth> but it runs for more than 6 hours
<RX14> well it's broken
<FromGitter> <bigDaddyS1oth> Yea it's just stuck in limbo there...with the `stats` option it still gives nothing
<RX14> well what happens when you run bin/crystal -v
<FromGitter> <bigDaddyS1oth> lol it's stuck in limbo too
<RX14> what about crystal -v
<FromGitter> <bigDaddyS1oth> same thing
<RX14> what is which crystal
<FromGitter> <bigDaddyS1oth> Sorry "what is which crystal" ?
<RX14> `which crystal`
<FromGitter> <bigDaddyS1oth> weird it gives `/bin/crystal`
<RX14> well what is at /bin/crystal?
<RX14> `file /bin/crystal`
<Groogy> executable might be borked?
<FromGitter> <bigDaddyS1oth> Says there's a POSIX shell script
<RX14> i'm guessing it ends up calling itself in a loop
<RX14> check top
<FromGitter> <bigDaddyS1oth> I had `htop` running when I ran it some last night before I went to bed and it was just taking ~20% CPU
<RX14> yes but which process
<FromGitter> <bigDaddyS1oth> `/bin/sh /bin/crystal etc etc etc`
<RX14> well then thats it then
<RX14> what installed /bin/crystal?
<FromGitter> <bigDaddyS1oth> I just git a `git clone` of the official repo
<FromGitter> <bigDaddyS1oth> then installed `llvm` then `cd crystal && make`
<RX14> well that didn't put bin/crystal there
<RX14> does it belong to a package?
<FromGitter> <bigDaddyS1oth> Oh Christ, yea I forgot that it wasn't accepting `/home/my-user/crystal/bin` to my path
<FromGitter> <bigDaddyS1oth> so I copied the contents of `crystal/bin` into my `/usr/bin`
<FromGitter> <bigDaddyS1oth> but apparently it doesn't want to use any path that I specify outside of the normal bin directories
<FromGitter> <bigDaddyS1oth> this is in my `.bashrc`
<FromGitter> <bigDaddyS1oth> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=596f8d6f1c8697534a3dc2a9]
<FromGitter> <bigDaddyS1oth> okay the formating is fucked up but yea
<FromGitter> <bigDaddyS1oth> those `/home/` directories are stuff that I have and bash just says "Fuck you I'm not going to run anything in those directories. Even if the scripts are able to run"
<RX14> you sure they chmod +x ?
<RX14> and that there's no conflicting entries earlier in the PATH
<RX14> and that PATH is set
<FromGitter> <bigDaddyS1oth> yup
<FromGitter> <bigDaddyS1oth> Checked all of that like 2 weeks ago multiple times
<jhass> oprypin: I'm totally accepting pull requests on DeBot ;)
<FromGitter> <bigDaddyS1oth> @RX14 I actually tried removing some of those entries in the PATH statement to see if it would fuck anything up, and it did.
<RX14> putting it at the front
<RX14> have you tried putting it at the front*
<FromGitter> <bigDaddyS1oth> let me see
<FromGitter> <johnjansen> @jhass consider it forked ;-)
<RX14> also why's there a big space in it
<FromGitter> <bigDaddyS1oth> By at the front you mean `/home/x/bin`
<FromGitter> <bigDaddyS1oth> move `/home/x/bin` to the front that is
<RX14> yes
<oprypin> jhass, well i said previously, the functionality would need sandboxing anyway and then it ends up as ugly specific features in carc.in
<FromGitter> <bigDaddyS1oth> doesn't seem to do anything..let me just make a script that'll echo something in `~/bin` and see if it runs
<jhass> well, you could try a wrapper that's a script that then again runs crystal in the sandbox
<FromGitter> <bigDaddyS1oth> @RX14 okay putting it at the front did work
<RX14> well there's something in your path already then with the same name
<RX14> or you typed it wrong when it was at the end
<jhass> command -v crystal should tell you what
<FromGitter> <bigDaddyS1oth> `command -v crystal` gives `/home/bigdaddytank/crystal/bin/`
<FromGitter> <bigDaddyS1oth> so there's that
<FromGitter> <bigDaddyS1oth> let me get rid of the copy that I made in `/usr/bin` that's the issue right now
<oprypin> oh.....
<FromGitter> <bigDaddyS1oth> yea that was stupid
<FromGitter> <bigDaddyS1oth> I just panicked and thought that was the best solution
<FromGitter> <bigDaddyS1oth> -___-
<FromGitter> <bigDaddyS1oth> Hey at least I've never claimed to be good at this stuff xD
<FromGitter> <bigDaddyS1oth> Oooookay so now I'm getting `You need to have a crystal executable in your path!`
<FromGitter> <bigDaddyS1oth> Fuck I'll deal with this later
hightower has joined #crystal-lang
<FromGitter> <Rhundom> Hey
<hightower> yo
<FromGitter> <Rhundom> Was thinking of giving Crystal a shot, How finished is it?
<FromGitter> <johnjansen> enough … depending on your needs
<FromGitter> <johnjansen> what were you going to use it for @Rhundom
<FromGitter> <Rhundom> Wasn't going to use it for much , Just going to see how fast it was compared to using Ruby.
fazibear has joined #crystal-lang
u_nuSLASHkm8 has joined #crystal-lang
u_nuSLASHkm8 has left #crystal-lang [#crystal-lang]
<FromGitter> <bew> @Rhundom that's ok, feel free to ask questions here if needed ;)
<FromGitter> <johnjansen> @Rhundom very … no comparison
pwned has quit [Ping timeout: 248 seconds]
fazibear has quit [Ping timeout: 240 seconds]
greengriminal has joined #crystal-lang
fazibear has joined #crystal-lang
fazibear has quit [Quit: leaving]
olbat has joined #crystal-lang
tinyurl_comSLASH has joined #crystal-lang
tinyurl_comSLASH has left #crystal-lang [#crystal-lang]
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
olbat has quit [Quit: Bye ...]
DTZUZU has joined #crystal-lang
hightower has quit [Ping timeout: 255 seconds]
fenicks has left #crystal-lang [#crystal-lang]
<crystal-gh> [crystal] straight-shoota opened pull request #4729: Add formatter and parser for standards ISO8601, RFC1123, RFC2822 (master...time-formats) https://git.io/v7e1M
greengriminal has quit [Quit: This computer has gone to sleep]
greengriminal has joined #crystal-lang
Groogy2 has quit [Read error: Connection reset by peer]
greengriminal has quit [Quit: This computer has gone to sleep]
Renich has joined #crystal-lang
greengriminal has joined #crystal-lang
Disrecollection has joined #crystal-lang
Renich has quit [Quit: Renich]