jhass changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Crystal 0.35.1 | 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
teardown has joined #crystal-lang
teardown_ has quit [Ping timeout: 268 seconds]
teardown has quit [Remote host closed the connection]
teardown has joined #crystal-lang
teardown_ has joined #crystal-lang
teardown has quit [Ping timeout: 268 seconds]
teardown has joined #crystal-lang
teardown_ has quit [Ping timeout: 268 seconds]
teardown_ has joined #crystal-lang
teardown has quit [Ping timeout: 268 seconds]
teardown has joined #crystal-lang
teardown_ has quit [Ping timeout: 268 seconds]
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 246 seconds]
avane has quit [Quit: ZNC - https://znc.in]
avane has joined #crystal-lang
_whitelogger has joined #crystal-lang
Vexatoast has joined #crystal-lang
duane has quit [Ping timeout: 246 seconds]
Vexatos has quit [Ping timeout: 264 seconds]
duane has joined #crystal-lang
<FromGitter> <watzon> StaticArrays are mutable
<FromGitter> <watzon> @jrei:matrix.org you might be able to get away with doing this https://carc.in/#/r/ab5q
<Andriamanitra> i've never seen this "uninitialized" magic before, very cool
_ht has joined #crystal-lang
jrayhawk has quit [Remote host closed the connection]
jrayhawk has joined #crystal-lang
f1reflyylmao is now known as f1refly
<repo> Blacksmoke16: hey! I have a project I need mongodb for and I used the shard "moongoose" as ODM. Fields are simply defined as properties/instance vars. If i then include ASR::Serializer it kind of breaks some of the initializers coming from Moongoose. Would you happen to know why? I'd like to make a PR to moongoose so it'd play nice with Athena serializer.
<repo> sorry moongoon :D
<FromGitter> <mattrberry> Some recent improvements to crab: Fixed a dma issue that caused some games to play audio from one ear; fixed DMA/PSG audio mixing; added alpha blending. Demo: https://drive.google.com/file/d/1G1a5grvhVWWvggX2Lv9A-zmQzXsWn99Y/view?usp=sharing
<FromGitter> <asterite> Looks and sounds great!
fifr[m] has quit [Quit: Bridge terminating on SIGTERM]
woodruffw has quit [Ping timeout: 246 seconds]
woodruffw has joined #crystal-lang
fifr[m] has joined #crystal-lang
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU_ has joined #crystal-lang
coderobe has quit [Quit: Ping timeout (120 seconds)]
coderobe has joined #crystal-lang
HumanG33k has joined #crystal-lang
<FromGitter> <deepj> Hello, I have a "little" problem with implementing an extension of `Hash#transform_keys` with optional mapping argument (https://github.com/deepj/crystal/commit/60d8fa43f41a89d27d4cb313bc1428c21669ac35). Ruby 3.0 has it as well (see https://rubyreferences.github.io/rubychanges/3.0.html#hashtransform_keys-argument-for-key-renaming). Useful for normalization typically of JSONs . The mapping argument can be Hash,
<FromGitter> ... NamedTuple or named arguments aka NamedTuple. These three options give me sense. I wrote some tests (see my commit) in hash spec which itself is passed but the full specs fail on: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ It makes sense when `NamedTuple#fetch` can receive as a key only `String` or `Symbol`. Unfortunately, I'm ... [https://gitter.im/crystal-lang/crystal?at=60100d076b20cf7730dbc4bb]
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
<FromGitter> <asterite> `if mapping.is_a?(NamedTuple)` should work to special case that
<FromGitter> <asterite> Oh, nevermind...
<FromGitter> <asterite> I guess you can do `if key.is_a?(String) || key.is_a?(Symbol)`
<FromGitter> <Blacksmoke16> repo: whats the error?
<FromGitter> <Blacksmoke16> alternative solution is to have a DTO
<FromGitter> <Blacksmoke16> i.e. create some other object you create from the actual mongo document type that you can serialize
<FromGitter> <jrei:matrix.org> 1) 36.0 expected for today 🎉
<FromGitter> <erdnaxeli:cervoi.se> omg
<FromGitter> <Daniel-Worrall> Seems so, yeah
<FromGitter> <jrei:matrix.org> But of course it will be globally available in 1-3 days
<FromGitter> <Blacksmoke16> if you use snap it'll be ready soon as the build is done 😉
<FromGitter> <jrei:matrix.org> Yes, that's what I meant
<FromGitter> <jrei:matrix.org> All the docker, snap, apt, rpm and so on builds
<FromGitter> <jrei:matrix.org> Honestly I don't mind waiting even 1 week
<FromGitter> <Blacksmoke16> at this point whats another week :p
<FromGitter> <Daniel-Worrall> What are the big changes anyway
<FromGitter> <Daniel-Worrall> aaand merged
<FromGitter> <Daniel-Worrall> yeah, I can see the changelog, but "big changes" are kinda opiniony
<FromGitter> <Daniel-Worrall> What are you most looking forward to
deavmi has quit [Ping timeout: 272 seconds]
<FromGitter> <Blacksmoke16> just the general polish/bug fixes
deavmi has joined #crystal-lang
<straight-shoota> yeah it's a huge release with 246 commits, but instead of huge features it's mostly cleanup & bug fixes
<straight-shoota> really great, though =)
<straight-shoota> *346 commits
<yxhuvud> nice, then I'll have to update my monkey patches to reflect the current state.
deavmi has quit [Ping timeout: 260 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
xaxisx has joined #crystal-lang
deavmi has joined #crystal-lang
xaxisx has quit [Quit: Leaving...]
ua has quit [Ping timeout: 264 seconds]
<FromGitter> <bcardiff> @jrei:matrix.org what do you mean by "But of course it will be globally available in 1-3 days" ?
<FromGitter> <jrei:matrix.org> the time to get the builds done
<FromGitter> <jrei:matrix.org> and for those using brew, get the PR accepted
ua has joined #crystal-lang
<straight-shoota> the binaries are already available at bintray, docker, snapcraft
<FromGitter> <jrei:matrix.org> I don't get any apt update yet
<FromGitter> <jrei:matrix.org> Of course some channels are faster than other. By "globally", I meant available for all of them
<straight-shoota> do you use the new bintray repo? dist.crystal-lang.org is discontinued
<FromGitter> <jrei:matrix.org> ha ok, no
<FromGitter> <Blacksmoke16> arch will take some time tho iirc ^
<straight-shoota> @jrei: Just need to run `curl -fsSL https://crystal-lang.org/install.sh | sudo bash` to get it updated
<FromGitter> <jrei:matrix.org> I see, done
<FromGitter> <jrei:matrix.org> The old one should be shut down, so we got an error when updating
<straight-shoota> no that would break existing installations using 0.35.1
<straight-shoota> maybe when 1.0 is released
<FromGitter> <jrei:matrix.org> @Blacksmoke16: Yes exactly, mainly third party channels like brew, Alpine, Arch
<FromGitter> <jrei:matrix.org> straight-shoota that won't break anything in fact
<straight-shoota> sure it does
<FromGitter> <jrei:matrix.org> apt update will complain that the repo is not available
<straight-shoota> yes and then it doesn't install
<straight-shoota> if you have that in a docker file, your docker build is broken
<straight-shoota> for example
<FromGitter> <jrei:matrix.org> You said "break new installations"
<FromGitter> <jrei:matrix.org> nvm, you said existing ibes sorry
<FromGitter> <jrei:matrix.org> *oops, ones
<straight-shoota> I mean it's probably not a big deal. People should be expecting the update and when they don't get it, they'll have to see what's up
<straight-shoota> the release post will mention that
<FromGitter> <jrei:matrix.org> So the old apt mirror will got the 0.36.0 version too?
<straight-shoota> no
<straight-shoota> that's how you notice that you need to switch to the new one
<FromGitter> <jrei:matrix.org> It is too easy for all the existing installations to miss this
<straight-shoota> yes, but you'll notice that it doesn't work when you expect the new release
<straight-shoota> if you *don't* know about 0.36.0, yes then it's going to be completely unnoticed
bcardiff has joined #crystal-lang
ChanServ changed the topic of #crystal-lang to: The Crystal programming language | https://crystal-lang.org | Crystal 0.36.0 | 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
bcardiff has quit [Client Quit]
<FromGitter> <mattrberry> Oh right, I forgot about this issue with 0.36.0... I define ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ Looks like just removing the return type from the abstract def works, although I don't need to remove it from the extending classes.. Seems odd, or at the very least, it seems like the error message could be improved [https://gitter.im/crystal-lang/crystal?at=60106f95cf8b82773456dccf]
<FromGitter> <RespiteSage> Couldn't you also add the type restriction to the implementing types?
<FromGitter> <mattrberry> On the classes that extend SoundChannel? They have the type restriction
<FromGitter> <mattrberry> And the way to get the compiler to be happy is just to remove it from the abstract class, but I don't need to remove it from the classes that extend that one
<FromGitter> <RespiteSage> Oh. Weird. I didn't read that it says that `Object` is overriding it.
<FromGitter> <mattrberry> @straight-shoota I know you looked into this the last time I mentioned it, but I don't remember what the conclusion was?
<FromGitter> <RespiteSage> Did you monkey patch object?
<FromGitter> <Blacksmoke16> to be clear pretty sure the issue is that your class implicitly inherits from `Object` which doesnt have the restriction
<FromGitter> <Blacksmoke16> which defines `abstract def ===(other)`
<FromGitter> <Blacksmoke16> so technically your class isnt compatible with `Object`
<FromGitter> <Blacksmoke16> imo solution should be to add some more explicit type restrictions to `Object`'s abstract methods
<FromGitter> <Blacksmoke16> or for now, just remove the type restriction on your class
<FromGitter> <mattrberry> Right, 100% agree with everything you said
<FromGitter> <Blacksmoke16> id maybe file an issue/PR for it
<FromGitter> <mattrberry> I know Johannes was looking into it before, so I'm curious what the conclusion was on that before I open an issue
<FromGitter> <Blacksmoke16> https://github.com/crystal-lang/crystal/blob/1e6f96a/src/object.cr#L49 i lied, `Object` doesn't define it as abstract, but aliases it to `==`
<FromGitter> <RespiteSage> Oh, okay. I see now.
<FromGitter> <Blacksmoke16> error is because you override it
<FromGitter> <Blacksmoke16> 👍
<straight-shoota> #9998
<DeBot> https://github.com/crystal-lang/crystal/issues/9998 (Overriding a method as abstract)
<FromGitter> <mattrberry> Ty for the link, I remember that now
<FromGitter> <mattrberry> Oh one other thing that's gonna kill me now on my emulator haha. This is no longer valid ⏎ ⏎ ```puts -1_i8.to_u32``` ⏎ ⏎ The problem is that I have these in random places all over the codebase, and the only easy way to find them is to let the emulator run and catch it when the error occurs. But when running in release, the stack trace points to the wrong line/file completely. So the only way to
<FromGitter> ... find the right place, then, is to run it in debug mode, where the emulator only runs at 5fps.. [https://gitter.im/crystal-lang/crystal?at=6010729e24cd6b60d8fb88a8]
<FromGitter> <Blacksmoke16> doesnt work how?
<FromGitter> <Blacksmoke16> overflow versus wrap?
<straight-shoota> it raises on overflow
<FromGitter> <Blacksmoke16> underflow*
<FromGitter> <mattrberry> Yup
<FromGitter> <Blacksmoke16> iirc cant you do like `.to_u32!`?
<FromGitter> <mattrberry> Yeah I can, but I don't know all the places in which I do this..
<FromGitter> <mattrberry> And the stack trace doesn't point me to the correct place when it overflows
<FromGitter> <Blacksmoke16> cant just find replace?
<straight-shoota> s/to_u32/to_u32!/g
<FromGitter> <Blacksmoke16> yea :P
<straight-shoota> this way you get the same behaviour as before
<FromGitter> <mattrberry> Sure, but the problem there is that there are places where I still might want the overflow to raise an exception
<FromGitter> <mattrberry> Like where I don't actually expect it to happen
<FromGitter> <mattrberry> I guess I just need to go through them 1 by 1..
<FromGitter> <Blacksmoke16> time to write some unit tests
<straight-shoota> that ^
<straight-shoota> but yeah, stack traces are a problem
<FromGitter> <Daniel-Worrall> Is there any way to get the stack trace but also compile in release?
<FromGitter> <mattrberry> Yeah, that'd be nice to have at some point. Typically when making an emulator, the more useful tests are the test programs that you actually run through the emulator rather than unit tests for each instruction. With 32-bit instructions and endless possible states that those can be run on, it's tricky to think of every possible edge-case to test in unit tests..
<FromGitter> <mattrberry> That's why people make fuzzers to test the emulator implementation
<FromGitter> <Blacksmoke16> dont need to go from 0% to 100% coverage, just main flow then always can add in more if/when bugs are discovered fixed
<FromGitter> <mattrberry> And if I could trust the stack trace, then I could use those to debug :/
<straight-shoota> you could try to temporarily inject a delegate method
<FromGitter> <Blacksmoke16> :bigbrain:
<straight-shoota> s/to_u32/to_u32_temp/g
<FromGitter> <Blacksmoke16> theres also the `caller` macro
<FromGitter> <mattrberry> Honestly, I think that's the approach I'll take now. Thanks for the idea
<FromGitter> <mattrberry> Is `caller` accurate if the Exception stack trace isn't?
<FromGitter> <Blacksmoke16> prob not given its just doing like `Exception::CallStack.new.printable_backtrace` so prob would be the same?
<FromGitter> <Daniel-Worrall> Oh, has there been any discussion on using github packages btw instead of or as well as docker hosting?
<FromGitter> <Daniel-Worrall> via ghcr.io
<straight-shoota> Daniel-Worrall isn't that just a docker registry?
<FromGitter> <Daniel-Worrall> essentially, yeah
<straight-shoota> Blacksmoke16 `caller` is not a macro but yeah, it retrieves the call stack exactly like an exception
<FromGitter> <Blacksmoke16> oops, 50/50 chance :p
r0bby has quit [Ping timeout: 272 seconds]
<FromGitter> <waghanza> Hi, ⏎ I'm trying the new release compatibility for a few frameworks in https://github.com/the-benchmarker/web-frameworks/pull/3858, if interested
r0bby has joined #crystal-lang
<FromGitter> <mattrberry> Fun logs :p ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60107b214f7d1b68e50fe10d]
<FromGitter> <mattrberry> At least this way I can go through 1 by 1 and find cases where this occurs
<FromGitter> <Blacksmoke16> i dont suppose building with `--debug` would help?
<FromGitter> <mattrberry> Nope
<FromGitter> <mattrberry> iirc `--debug` just adds debug flags, which `--release` still compiles with anyway unless you do `--no-debug`?
<FromGitter> <mattrberry> And I need the `--release` or else this will take ages to even get to an instruction that causes it to break :p
<FromGitter> <asterite> I thought overflow checks were already there before 0.36.0
<FromGitter> <mattrberry> I didn't have issues on 0.35.1 before
<straight-shoota> #10000
<DeBot> https://github.com/crystal-lang/crystal/pull/10000 (Check for overflow when extending signed integers to unsigned integers)
<FromGitter> <mattrberry> Cool, got everything updated to work with 0.36.0 now, not *too* bad :)
<FromGitter> <mattrberry> My gb/gbc emulator also isn't working for some reason, but I can figure that one out later
_ht has quit [Remote host closed the connection]
f1refly has quit [Quit: bye fags]
oddp has joined #crystal-lang
<oddp> Big thanks to everyone involved for pushing out yet another crystal release! woohoo!
<FromGitter> <RespiteSage> Anybody know why this would be the case on 0.36.0? ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=60108910428d9727dd36941a]
<FromGitter> <RespiteSage> On 0.35.1, or with `class`, that last line outputs `true`.
<straight-shoota> hm, that might be a regressions
<FromGitter> <RespiteSage> Where is `#is_a?` defined? I see that it's a pseudo-method, but I haven't found the actual implementation yet.
<FromGitter> <asterite> In the compiler
<FromGitter> <asterite> Thousands of lines of code for just that (and other things)
<FromGitter> <RespiteSage> Gotcha. I've found the file. If I have time, I'm gonna see if I can figure out what's causing this.
<FromGitter> <asterite> You can also submit an issue. If someone caused a regression there's a chance they'll fix it
<FromGitter> <RespiteSage> That's fair. I'll do both.
<FromGitter> <RespiteSage> Odds are it'll take someone with more experience to tackle this.
<FromGitter> <RespiteSage> I narrowed down the behavior some. It only seems to happen when the included module's generic type contains the abstract struct type.
<oz> Yay, new release. Thanks ! 🙂
<FromGitter> <Blacksmoke16> possibly related https://github.com/crystal-lang/crystal/issues/9660 @RespiteSage
<FromGitter> <RespiteSage> Yeah, potentially. It seems like the behavior I made an issue for was introduced in 0.36.0, though.
<FromGitter> <Blacksmoke16> for sure
oddp has quit [Quit: quit]
early has quit [Quit: Leaving]
early has joined #crystal-lang
oddp has joined #crystal-lang
<oddp> Slick, that new Array#shift/unshift optimization boosts .rotate! like crazy. Thanks, Ary!
oddp has quit [Quit: quit]
<oprypin> oddp, just use Deque....