ChanServ changed the topic of #crystal-lang to: The Crystal programming language | | Fund Crystal's development: | GH: | Docs: | Gitter:
<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? []
<FromGitter> <naqvis> are you using any shard?
<FromGitter> <naqvis> also follow the directions in output use `--error-trace` to get full trace
<FromGitter> <> 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> it doesn't build with anything newer i don't think
<FromGitter> <> 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``` []
<FromGitter> <void-witch> 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
<FromGitter> <naqvis> @void-witch line 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> <> json1 is an extension of sqlite
<FromGitter> <> But it is used to manage content *inside* the db
<FromGitter> <> I'd just put the JSON as a string blob in the db
<FromGitter> <> 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":
<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:
<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... ⏎
<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