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
raz has quit [Ping timeout: 252 seconds]
<FromGitter> <rishavs> how would I accept a file as a command line parameter for my crystal executable? ⏎ I looked at options parser but it seems to be more about flags and such
raz has joined #crystal-lang
raz has quit [Changing host]
raz has joined #crystal-lang
<FromGitter> <naqvis> if all you need is the arguments passed, then `ARGV` is your friend. ⏎ ⏎ ```crystal test.cr FOO BAR ⏎ FOO ⏎ BAR``` [https://gitter.im/crystal-lang/crystal?at=61e1708c7842bd3ca946e187]
<FromGitter> <rishavs> Thanks!
<FromGitter> <kalinon> Has anyone ever had the compiler get stuck? ⏎ on both linux and osx my compiler gets stuck at the `main` step: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=61e18724bfe2f54b2e1a7167]
<FromGitter> <kalinon> tried a bunch of different ways to do the same thing... but no dice. keeps getting stuck on main
notzmv has quit [Ping timeout: 250 seconds]
<FromGitter> <Blacksmoke16> theres a built in discriminator feature btw, would that fix the problem?
<FromGitter> <kalinon> unfortunatly it based on 1 field. Kubernetes API models are based on 2. `apiVersion` and `kind`
<FromGitter> <kalinon> ive based my code off that.
<FromGitter> <Blacksmoke16> ah hmm
<FromGitter> <kalinon> yeah, trying to debug what issue is. It seems to freeze on compile only when i add the initialization (`.new`). If i just return the class and print it, it compiles fine.
<FromGitter> <kalinon> granted its about 200 classes >.< in that `REGISTRY`
<FromGitter> <Blacksmoke16> oof
<FromGitter> <kalinon> yeah. lots of classes in kubernetes
<FromGitter> <naqvis> might worth trying with limited class size and incrementally increasing the count to see if that's causing the freeze
<FromGitter> <kalinon> @naqvis good call. let me do that
<FromGitter> <naqvis> 👍
<FromGitter> <naqvis> iirc, there is known bug where having bigger static array will cause longer compilation time, due to llvm multiple `alloca` instructions
<FromGitter> <kalinon> hmmmm ok, good to know.
<FromGitter> <kalinon> up to `REGISTRY[0..15]` works. but strangely enough any other range past index 15 doesn't (even if 1-15 sized).
<FromGitter> <kalinon> so like `[10..20]` does not.
<FromGitter> <kalinon> so perhaps its related to that bug
<FromGitter> <Blacksmoke16> what about an array of just `15`
<FromGitter> <kalinon> so only the first 15 works? sorry `ArrayLiteral` has limited slicing, can only do it with range i think...
<FromGitter> <kalinon> so like 15 from the middle will compile forever
<FromGitter> <Blacksmoke16> `for entry in [REGISTRY[15]]`
<FromGitter> <Blacksmoke16> or just hard code what that index is
<FromGitter> <kalinon> oh you meant specifically at 15
<FromGitter> <kalinon> gotcha
<FromGitter> <Blacksmoke16> yea
<FromGitter> <kalinon> yeah was wondering if it was the class past 14 as well
<FromGitter> <kalinon> so yeah, looks like its the class itself: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=61e196a9e1a1264f0a578b46]
<FromGitter> <kalinon> freezes
<FromGitter> <Blacksmoke16> there's a clue ;P
<FromGitter> <kalinon> yep. perfect.
<FromGitter> <kalinon> was just stuck, needed to talk it out. dake.
SamantazFox has quit [Remote host closed the connection]
SamantazFox has joined #crystal-lang
notzmv has joined #crystal-lang
debayer94 has joined #crystal-lang
notzmv has quit [Ping timeout: 250 seconds]
debayer94 has quit [Remote host closed the connection]
debayer94 has joined #crystal-lang