<FromGitter>
<Blacksmoke16> is there any actual difference between these?
<FromGitter>
<Blacksmoke16> i guess `replace` would retain the same array so would be a bit more performant?
<FromGitter>
<jrei:matrix.org> The reference
<straight-shoota>
yeah
<FromGitter>
<jrei:matrix.org> `arr.replace other` vs `arr = other`
<FromGitter>
<Blacksmoke16> makes sense, thanks
<FromGitter>
<jrei:matrix.org> in the first case `arr.object_id != other.object_id`, and the second `arr.object_id == other.object_id`
<FromGitter>
<jrei:matrix.org> same for `#dup` - keep the reference and reuse the buffer
<FromGitter>
<Blacksmoke16> @alexherbo2 I think you were asking for this. https://github.com/Blacksmoke16/oq/pull/73 if you wanted to test it out. Will get it released soon
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
_whitelogger has joined #crystal-lang
woodruffw has quit [Ping timeout: 272 seconds]
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
duane has quit [Ping timeout: 276 seconds]
andremedeiros has quit [Read error: Connection reset by peer]
andremedeiros has joined #crystal-lang
woodruffw has joined #crystal-lang
woodruffw has quit [Ping timeout: 240 seconds]
woodruffw has joined #crystal-lang
_ht has joined #crystal-lang
alexherbo2 has joined #crystal-lang
hendursa1 has joined #crystal-lang
hendursaga has quit [Ping timeout: 268 seconds]
<FromGitter>
<alexherbo2> how to parse a recursive `Array(Argument).from_json(STDIN)`?, with `Argument` being an alias to `Nil | Bool | Int32 | String | Array(Argument)`
<FromGitter>
<alexherbo2> I tried with a recursive alias, but it does not work, because the JSON parser cannot do `Argument.class`
<FromGitter>
<alexherbo2> I tried with a struct with a value property, and include `JSON::Serializable` but then my json string has to be `[{"value": 2}]` instead of `[2]` for example
<straight-shoota>
yeah `scale = @scale - other.scale` is a classic example why doing math with unsigned integers is harmful
<straight-shoota>
the worst about it: the Rust implementation that our's is based on uses a signed i64 for scale :(
robertmeta has joined #crystal-lang
<FromGitter>
<asterite> I wonder how we'll fix that uint32 bug... Maybe it was a bug all a long but llvm 11 made it always trigger
<straight-shoota>
does it only happen with uint32? No other type?
<straight-shoota>
I can't reproduce your reduced example with LLVM 9 but I suppose that's expected
<FromGitter>
<asterite> Yes, it only happens on llvm 10 or later
<FromGitter>
<asterite> I'm almost sure it has to do with union types being assigned to larger union types, but it's strange that it's not always reproducible
<FromGitter>
<asterite> Or maybe string parsing is unsafe and does something bad... But so far I couldn't find anything
<FromGitter>
<asterite> Also I had an example that fails, but also runs fine with prelude empty
<FromGitter>
<asterite> I guess with time we'll find the answer... Too bad it blocks 1.0. Though maybe we can introduce a workaround just so that the compiler can work fine for these cases, and just consider this a bug with int unions, which isn't used that often
<straight-shoota>
hm, maybe it's really an LLVM bug in the end... :/
<straight-shoota>
but to confirm that we'd still need to figure out what exactly is going wrong
<FromGitter>
<Blacksmoke16> Would it be easier to fix llvm12 support and try with that