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
vivus has left #crystal-lang ["Leaving"]
gtramontina has quit [Quit: WeeChat 1.9.1]
snsei has quit [Remote host closed the connection]
gtramontina has joined #crystal-lang
gtramontina has quit [Client Quit]
illyohs has quit [Read error: Connection reset by peer]
illyohs has joined #crystal-lang
snsei has joined #crystal-lang
<faustinoaq> ![Imgur](https://i.imgur.com/pVjyqrV.png) lol
<faustinoaq> XD
<faustinoaq> so many name for crystal projects :)
<faustinoaq> s/name/names/
<oprypin> :|
snsei has quit [Ping timeout: 250 seconds]
<FromGitter> <faultyserver> I love that Railsconf is in Phoenix this year
<FromGitter> <faultyserver> seems almots too coincidental
faustinoaq has quit [Quit: Konversation terminated!]
<FromGitter> <fridgerator> was it there last year too?
<FromGitter> <fridgerator> I thought it was, could be wrong
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
<FromGitter> <fridgerator> but yeah, a little ironic
<FromGitter> <drosehn> If only I cared about Rails... My sister lives in Phoenix!
ome has quit [Disconnected by services]
<FromGitter> <lilijreey> Who to use Cryn complete code?
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 258 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 260 seconds]
illyohs has quit [Ping timeout: 248 seconds]
snsei has joined #crystal-lang
alex`` has joined #crystal-lang
snsei has quit [Ping timeout: 240 seconds]
mbarbar has joined #crystal-lang
<FromGitter> <codenoid> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a07d0c1505b630c05d0d197]
<oprypin> codenoid, there is no string `"/\n/"` anywhere in the text, so the split does not happen
<oprypin> you want `"\n"` or `/\n/`
<FromGitter> <codenoid> :# it's silly mistake
<FromGitter> <codenoid> lol
<FromGitter> <codenoid> split a new line, okay then
mbarbar has quit [Ping timeout: 248 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 250 seconds]
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 248 seconds]
snsei has joined #crystal-lang
faustinoaq has joined #crystal-lang
<FromGitter> <GavinRay97> I have what is in all likelihood a really dumb question.
<FromGitter> <GavinRay97> I'm trying to use Kemal + Kemal REST API to spin up a quick API from a SQLite DB.
<FromGitter> <GavinRay97> The schema of the DB is such that ⏎ ⏎ Nutrition Ingredient has the base information for an ingredient item, with values for fat/protein/carbs and kcal in 100g increments. ⏎ ⏎ Nutrition Ingredient has many Nutrition Ingredient Weight Units. A Nutrition Ingredient Weight Unit has one Weight Unit, which contains the human readable name for the weight Unit. [http
<FromGitter> ... s://gitter.im/crystal-lang/crystal?at=5a080d5c505b630c05d19bb0]
<FromGitter> <GavinRay97> Don't ask me why the DB was constructed this way, it's a DB from an Open Source API I ripped.
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
<FromGitter> <GavinRay97> Here is what the output currently looks like: ⏎ ⏎ /api/ingredient/2 ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a080eee982ea2653f6bc442]
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <GavinRay97> Is there any way for me to return the Ingredient Weight Units with Weight Unit name? They're associated by foreign and primary keys in the DB, I'm just used to have Rail's Active Record models map associations for me.
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
<FromGitter> <GavinRay97> This is the code I currently have running, first 20 minutes experimenting with Crystal. I love it, it's blazing fast and I felt like I was just writing Ruby: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a080fef86d308b755da86a3]
snsei has joined #crystal-lang
snsei has quit [Remote host closed the connection]
claudiuinberlin has joined #crystal-lang
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qard has joined #crystal-lang
ShalokShalom_ has joined #crystal-lang
ShalokShalom has quit [Ping timeout: 240 seconds]
<literal> is there no terser way than doing "ints = IntOrNil.new; ints.push 6, 7" ?
<literal> or separating the type alias, having one for the contents and one for the array of those contents, so it would be "alias IntOrNil = Int32 | Nil; alias ArrayOfIntOrNil = Array(IntOrNil); array_storage = [] of ArrayOfIntOrNil.new; array_storage << [6, 7] of IntOrNil"
<Yxhuvud> I think the best answer would be to not create that kind of arrays in the first place. Why do you need them?
<literal> never create arrays of Int32 | Nil ? why not?
<literal> I'm just curious about syntax here, as I'm learning the language
<literal> I'm iterating over an array of things, and creating chained links of [thing, thing], and the ends will produce [nil, thing] and [thing, nil]
<Yxhuvud> because, as you have noticed, they are not nice to work with. very often a better answer is to not include the nils in the array, or to wrap your composite datatypes in a tuple/struct instead of in a generic union type.
<literal> yeah, I could try tht
<literal> that
baweaver is now known as baweaver_away
<Yxhuvud> also note that I am not saying to never create them, but rather to think through your types - often there are better ways
<crystal-gh> [crystal] MakeNowJust opened pull request #5278: Format: insert space between `{` and `%` to prevent writing `{%` (master...fix/crystal-format/5277-insert-space-between-brace-and-percent) https://git.io/vFwS9
<jhass> anybody did something for cookie signing yet?
qard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Groogy> hmm don't get why my texts gets so destroyed on smaller size :/ looks ok in the font texture though
<Yxhuvud> groogy: alignment? (and yeah, it is not certain it is possible to align properly).
<Groogy> Yeah tried that but like, moved the sprite rendering the font texture to like 200.5 and stuff like that
<Groogy> still looks fine there
<Groogy> though I guess the text is doing this with a lot of small squares so maybe more likely to happen there
<Groogy> I'm asking on the opengl channel but still no response on ideas
<Groogy> BAh I give up, it will have to look like crap for now
snsei has joined #crystal-lang
snsei has quit [Ping timeout: 258 seconds]
<FromGitter> <Sevensidedmarble> since crystal doesnt have globals, whats the best approach for flags like 'debug' that you may have to set dynamically and cant use a constant for?
<FromGitter> <bararchy> instance var with accesor ?
<FromGitter> <bararchy> or you mean "for all the program to know about the status" ?
<FromGitter> <Sevensidedmarble> yes the latter
<FromGitter> <Sevensidedmarble> I want everything to be able to see if debug is true or not
<FromGitter> <bararchy> ENV var ?
<FromGitter> <Sevensidedmarble> ah, that could work
<FromGitter> <bararchy> :)
<FromGitter> <Sevensidedmarble> can you reopen modules and use them like namespaces?
<FromGitter> <Sevensidedmarble> I guess I could just make sure my seperate files are all in the same module if they work like namespaces
<Groogy> you could also make a module
<Groogy> Debug.is_on?
<FromGitter> <Sevensidedmarble> there we go, that might be the best option
<Groogy> and yeah modules work as namespaces as well
<Groogy> also oh boy I love Crystal
<Groogy> it seems like it does a runtime lookup when matching arguments on a method call as well which is freaking sweet
<FromGitter> <Sevensidedmarble> what do you mean?
<Groogy> it's made my ui code so freaking easy to read/follow
<Groogy> I have a design class that defines "How do we render let's say a button"
<Yxhuvud> groogy: iirc it expands to something that works like a switch statement, so if ou have a billion choices it could get slow.
<Groogy> and all it does is rewrite get_drawer(wdiget) with a defined type like GUI::Button
<Groogy> and it just maps by itself even if the compile time the type isn't known
<Groogy> yeah probably but this should only be done when something changes
<Groogy> I've yet to do the "only re-render this part of the screen" portion but should be coming soon
<Groogy> it's nice because this is the only code I need for the cointainer class https://pastebin.com/XBMzSTXj
<Groogy> crystal just handles the rest
<FromGitter> <Sevensidedmarble> huh I'm not sure I get it
<FromGitter> <Sevensidedmarble> also wtf I didnt know crystal had abstract classes lol
<Groogy> so the "child" variable in the block, the only known type at compile time is Boleite::GUI::Widget+
<Groogy> the get_drawer methods there add a type to the argument, crystal will add the code to lookup which is the correct one to call
<Groogy> even if at compile time the type isn't known
<FromGitter> <Sevensidedmarble> huh thats interesting
<Groogy> I'll give you comparison how my C++ code used to look
<Groogy> for the exact same kind of lookup
<Groogy> it's quite similar minus the I had to write the dynamic lookup manuallay
<Groogy> and it has to be function pointers
<Groogy> which has its own problems for the compiler
<FromGitter> <Sevensidedmarble> yeah crystal has the greatest typing of any language I've ever seen
<FromGitter> <Sevensidedmarble> aside from the occasional compiler misunderstanding
<FromGitter> <Sevensidedmarble> but I think some of it will be unavoidable with how expressive the language is
<FromGitter> <Sevensidedmarble> atleast you know at compile time if somethings wrong
<FromGitter> <Sevensidedmarble> why do the docs here say you can have class vars at the module level? https://crystal-lang.org/docs/syntax_and_semantics/class_variables.html
<FromGitter> <Sevensidedmarble> as far as I can tell you cant
<FromGitter> <Sevensidedmarble> also why does this not work? https://play.crystal-lang.org/#/r/32r5/edit
<FromGitter> <Sevensidedmarble> I'm just trying to expose a variable to many different files through a module
<FromGitter> <Sevensidedmarble> never mind I'm stupid
<FromGitter> <straight-shoota> @RX14 I've tried your new omnibus build, but running the compiler throws a segmentation fault. I don't think I'd need to do anything else beside unpacking, do I?
<RX14> no
<RX14> darn
<RX14> what distro?
<FromGitter> <straight-shoota> Ubuntu 14.04.5 LTS
<FromGitter> <straight-shoota> on WSL
<RX14> i tried on debian 6 and 8, old fedora, and old centos
<RX14> oh on WSL
<RX14> well
<RX14> meh
<RX14> @straight-shoota
<RX14> a gdb backtrace might be interesting though
<RX14> for that segfault
<FromGitter> <straight-shoota> I'll try to find the core dump file...
<RX14> why not just run gdb /path/to/script
<RX14> actually
<RX14> gdb crystal-0.24.0/lib/crystal/bin/crystal
<FromGitter> <straight-shoota> okay
<RX14> then run and bt
<FromGitter> <straight-shoota> on native ubunutu 16.04.3 LTS it works BTW 👍
<RX14> cool
<FromGitter> <straight-shoota> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a085d83505b630c05d2e56e]
<RX14> so its just musl
<RX14> just not working on wsl
<FromGitter> <straight-shoota> :(
<FromGitter> <straight-shoota> but having a solution for native linux is really great =)
<RX14> it's so hard to get something that works everywhere
<FromGitter> <Sevensidedmarble> I'm getting this error when trying to build with --release: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=5a08612b505b630c05d2f700]
<FromGitter> <Sevensidedmarble> anyone experience that?
<RX14> yes
<RX14> add --no-debug
<RX14> it's a bug in LLVM which you need to work around with that compiler flag
<RX14> it'll probably be fixed by next release
snsei has joined #crystal-lang
Groogy has quit [Quit: WeeChat 1.9.1]
snsei has quit [Ping timeout: 252 seconds]
<FromGitter> <unreadable> I simply love go, it gets the job with a ease of use
<RX14> Its going to be the next Java I'm sure
<RX14> And that's absolutely not a bad thing
<RX14> Its fast its simple its portable and it beats Java in concurrency because it has csp
<FromGitter> <unreadable> I'd love to use Go at a previous job that I was told to rejoin, but damn, they're so damn into c#
<FromGitter> <unreadable> but for node.js, I think it's a better move
<FromGitter> <monouser7dig> is there already some work done to optimise crystal code before entering llvm? like reverse.each could get remapped to reverse_each, or x = x.map could be x.map!, language specific things like these?
<FromGitter> <monouser7dig> https://brew.sh/analytics/install-on-request/ here is crystal (and others) install data from home-brew
<Papierkorb> that #map is not equivalent at all.
<FromGitter> <monouser7dig> if you assign to the same variable?
<Papierkorb> what if someone else has a reference to it?
<FromGitter> <monouser7dig> what do you mean? after map is executed x will be altered in both scenarios for anyone referencing it
<Papierkorb> no it won't.
<FromGitter> <monouser7dig> btw I'd be willing to try binden on mac cause I'd need some UI things so unless I'd need advanced knowledge already I'd like to try, report back and help out making it work on mac
<FromGitter> <monouser7dig> I do not understand?
vivus has joined #crystal-lang
<Papierkorb> gcds got bindgen to run last week. haven't heard back from that though
<Papierkorb> +on mac ^
<FromGitter> <monouser7dig> ok I add to my shards.yml run crystal deps, have qt installed (not sure if I even have to?) but get Failed crystal deps build && ext/try_build.sh and nothing in lib folder
<FromGitter> <monouser7dig> still how is x = x.map different from x.map! ?
<Papierkorb> that try_build didn't exist for quite a while now.
<Papierkorb> `def foo(a); a = a.map(..); end`
<Papierkorb> Please read up on passing by reference if it's still not clear
snsei has joined #crystal-lang
<Papierkorb> and w.r.t getting it to run on mac, you're on your own basically. you'll have to fullfill all dependencies, which are documented for known-to-work platforms
<FromGitter> <monouser7dig> see what you mean, have not thought about that, so is there no work in this direction being done or is it planned/ not planned?
<Papierkorb> And yes, that of course includes Qt bindings. Those generated for linux obviously won't work on mac.
<Papierkorb> *Qt itself
<FromGitter> <monouser7dig> Ive got home-brew yt 5.9.2 easy enough but qt-devel or light-devel what you might refer to as other headers/ lib is not available
qard has joined #crystal-lang
qard has quit [Ping timeout: 260 seconds]
balduin has joined #crystal-lang
hightower3 has joined #crystal-lang
snsei has quit [Remote host closed the connection]
hightower4 has quit [Ping timeout: 248 seconds]
qard has joined #crystal-lang
illyohs has joined #crystal-lang
<crystal-gh> [crystal] wmoxam opened pull request #5282: Fixes issue with linking lib_unwind on OpenBSD (master...fix-openbsd-linking-issue) https://git.io/vFrmy
<crystal-gh> [crystal] wmoxam opened pull request #5283: Fixes setting IO blocking on OpenBSD (master...fixes-stdio-redirections-on-openbsd) https://git.io/vFrYR
<crystal-gh> [crystal] jhass pushed 1 new commit to master: https://git.io/vFrYp
<crystal-gh> crystal/master c9fac56 Akiicat: fix HTTP::Params.parse query string "&&" (#5273)
<crystal-gh> [crystal] funny-falcon reopened pull request #5256: Change Hash implementation (master...openaddressing) https://git.io/vFRck
<travis-ci> crystal-lang/crystal#c9fac56 (master - fix HTTP::Params.parse query string "&&" (#5273)): The build passed. https://travis-ci.org/crystal-lang/crystal/builds/301048088
<DeBot_> https://github.com/crystal-lang/crystal/issues/5273 (HTTP::Params.parse query string "&&" bug)
alex`` has quit [Ping timeout: 258 seconds]
snsei has joined #crystal-lang
alex`` has joined #crystal-lang
martinium has joined #crystal-lang
baweaver_away is now known as baweaver
snsei has quit [Remote host closed the connection]
snsei has joined #crystal-lang
snsei_ has joined #crystal-lang
snsei_ has quit [Remote host closed the connection]
snsei has quit [Ping timeout: 246 seconds]
martinium has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alex`` has quit [Ping timeout: 264 seconds]
martinium has joined #crystal-lang
<FromGitter> <fridgerator> quiet day in crystal land
DTZUZU has quit [Ping timeout: 248 seconds]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]