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> <void-witch> i'm trying to compile something with a crystal 0.35.1 build i downloaded from the crystal site, and i get a fun error from the gc ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ this doesn't happen with the 0.36.1 snap i have installed, and it didn't happen with the 0.35.1 snap i used to have. what causes it? [https://gitter.im/crystal-lang/crystal?at=60458c6222a5ce4a913e3ebb]
<FromGitter> <naqvis> are you using any shard?
<FromGitter> <naqvis> also follow the directions in output use `--error-trace` to get full trace
<FromGitter> <js:nil.im> that LLVM looks a little old?
<FromGitter> <naqvis> that will reveal what part of code is causing that
fifr` has quit [Ping timeout: 258 seconds]
<FromGitter> <void-witch> @js:nil.im it doesn't build with anything newer i don't think
<FromGitter> <js:nil.im> I think my crystal is built against LLVM 11
<FromGitter> <void-witch> @naqvis same output
<FromGitter> <void-witch> lemme check if it happens with no shards
<FromGitter> <void-witch> scratch that, different output
<FromGitter> <void-witch> ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60459600a3a2f04f1fde92e6]
<FromGitter> <void-witch> @js:nil.im 0.35.1 (5999ae2) doesn't build with llvm 11
<FromGitter> <Blacksmoke16> is that llvm 11 or 11.1
<FromGitter> <void-witch> 1) 0.0
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <void-witch> i just wanna bisect this compiler bug 😩
<FromGitter> <naqvis> are you able to reproduce this error with some simple code i.e (without any dep on external shard) ?
_whitelogger has joined #crystal-lang
chachasmooth has quit [Ping timeout: 260 seconds]
chachasmooth has joined #crystal-lang
<FromGitter> <void-witch> @naqvis `puts "hello world"` triggers it
<FromGitter> <void-witch> exact same output as above
<FromGitter> <void-witch> in fact, `crystal run` with an empty file *also* triggers it
<FromGitter> <naqvis> running a compiler on empty file triggering error is a known issue https://github.com/crystal-lang/crystal/issues/10359#issuecomment-783321224
<FromGitter> <naqvis> @void-witch line https://github.com/crystal-lang/crystal/blob/0.35.1/src/gc/boehm.cr#L57 is the culprit. This has been changed in latest versions. For 0.35.1 you can change `type` to `alias` and it should fix that
<FromGitter> <naqvis> you can clone the repo, switch to 0.35.1, change that line, do `make libcrystal` and then use `bin/crystal run XXXXX` to validate that
<FromGitter> <naqvis> should be something related to LLVM version (I guess)
<FromGitter> <naqvis> and fyi, crystal 0.35.1 won't compile with LLVM 11
<FromGitter> <void-witch> @naqvis same issue
_ht has joined #crystal-lang
fifr` has joined #crystal-lang
_ht has quit [Read error: Connection reset by peer]
_ht has joined #crystal-lang
_ht has quit [Remote host closed the connection]
_ht has joined #crystal-lang
hendursa1 has joined #crystal-lang
hendursaga has quit [Ping timeout: 268 seconds]
postmodern has joined #crystal-lang
_ht has quit [Ping timeout: 256 seconds]
_ht has joined #crystal-lang
<frojnd> I have around 1k json files in one dir and am wondering how can I most elegantly save that json file into sqlite3? Read file one by one and then save as text to db?
<frojnd> Or does sqlite3 adapter for crystal supports saving jsons to db?
<frojnd> Couldn't find in the docs
riffraff169 has joined #crystal-lang
<FromGitter> <jrei:matrix.org> json1 is an extension of sqlite https://www.sqlite.org/json1.html
<FromGitter> <jrei:matrix.org> But it is used to manage content *inside* the db
<FromGitter> <jrei:matrix.org> I'd just put the JSON as a string blob in the db
<FromGitter> <jrei:matrix.org> Depends if you just want to store, or also perform queries
postmodern has quit [Quit: Leaving]
<frojnd> Eventually I will perform queries... These json files will be matched against date and then I will serve these json files as GET responses...
<frojnd> Hm.. another question. I'm inside array and inside array I'm calling a function that deletes some chars from the string. I keep getting: Error: no overload matches 'cleaned_verse' with type (String | Nil)
<frojnd> I'
<FromGitter> <Blacksmoke16> why not just serve them from the file system?
<frojnd> I'm passing the value inside array.each {|v| my_function v}
<FromGitter> <Blacksmoke16> is `array` of type `Array(String?)`?
<frojnd> @BlackSomke16 yes
<frojnd> @BlackSmoke16 yes
<FromGitter> <Blacksmoke16> then you'll need to make sure that the value isn't `nil` before passing it to your method
<Andriamanitra> that's assuming the array elements are nilable on purpose, otherwise you should find the thing that inserts / could insert nils into your array in the first place
<frojnd> No they are not
<frojnd> They should always include String
<FromGitter> <Blacksmoke16> then why does the array allow `nil` values?
<Andriamanitra> quick and dirty fix is to do Array#compact wherever you're making the array, smart thing to do would be to find why nils are happening and handle that case properly
<frojnd> It does not
<frojnd> Array(Verse).from_json(%(#{data}))
<FromGitter> <Blacksmoke16> i mean apparently it does, otherwise you wouldn't be gettering that error
<FromGitter> <Blacksmoke16> what's `Verse`?
<frojnd> It's "serializable": https://carc.in/#/r/ailo
<FromGitter> <Blacksmoke16> and you're literally doing like `Array(Verse).from_json(%(#{data})).each {|v| my_function v}`?
<FromGitter> <Blacksmoke16> because there has to be something else going on that makes the array you use allow `nil` values at some point
<frojnd> Hm yeah not that is in one module
<frojnd> I have a function in one module that looks like this: https://carc.in/#/r/ailt
<frojnd> Well it's combined now from 2 modules but those are the functions I'm doing with
<FromGitter> <Blacksmoke16> hm
<frojnd> Error is on line: c_verse = cleaned_verse v
teardown has quit [Remote host closed the connection]
<frojnd> I'm not sure what I missed
teardown has joined #crystal-lang
<FromGitter> <Blacksmoke16> fwiw, im not so sure this would work the way you want anyway
<frojnd> Why not?
<FromGitter> <Blacksmoke16> oh sorry nvm. forgot you were doing `c_verse = cleaned_verse v`
<frojnd> Will get back later to this error
<FromGitter> <Blacksmoke16> 👍
<frojnd> But anyways just wanted to say a big thank you guys... very active community here on irc :)
_ht has quit [Remote host closed the connection]
_ht has joined #crystal-lang
duane has joined #crystal-lang
duane has quit [Ping timeout: 256 seconds]
duane has joined #crystal-lang
duane has quit [Ping timeout: 260 seconds]
duane has joined #crystal-lang
f1refly has joined #crystal-lang
<FromGitter> <vectorselector> what search terms to use NOW? lol... ⏎ https://www.nytimes.com/1956/01/08/archives/son-to-mrs-crystal-lang.html
<frojnd> :)
_ht has quit [Remote host closed the connection]
richbridger has quit [Quit: Leaving]
richbridger has joined #crystal-lang
hendursa1 has quit [Quit: hendursa1]
hendursaga has joined #crystal-lang