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
<deimos_> for a random datapoint, i re-wrote some parsing/etl/m-r scripts from c to ruby to crystal. the c code kept segfaulting due to encountering random data. used ruby to prototype the code, was parsing around 2.8m lines/second/core. convert the ruby code to crystal, it's at 31m lines/sec/core.
<deimos_> turns out i could have just used crystal to prototype instead of the intermediate step
<deimos_> about 95% of the ruby code was literal copy/paste into crystal
<FromGitter> <Blacksmoke16> πŸ‘ nice
<deimos_> so now crystal is approved as experimental at work
<deimos_> it's so new the worry is it doesn't have a long lifetime
<deimos_> for comparison, the c code was doing around 20m lines/sec/core
<deimos_> i have around 5000 cores to mess with
<FromGitter> <Blacksmoke16> you using fibers/MT mode?
<deimos_> however, showing how easy it is to go between crystal and ruby alleviates some concerns
<deimos_> well, i cheat
<deimos_> i use ruby and parallel gem to spin up all the crystal-based binaries
<deimos_> and for another metric, it took me 45 hours to convert from c -> ruby -> crystal, where about 20h was spent trying to understand the c code
<deimos_> the original c code was written around 2002 and took a contractor 3 months
<deimos_> so, if you know ruby, crystal is really easy
<deimos_> i code both ruby and crystal in a functional style, fwiw
<FromGitter> <Blacksmoke16> ok
<deimos_> i've done some with fibers, but not wrapped my head around how to handle huge numbers of them, or how crystal will handle it
<FromGitter> <jrei:matrix.org> so maybe Ruby/Crystal is not the best language for you
<FromGitter> <jrei:matrix.org> have you tried Nim?
<FromGitter> <jrei:matrix.org> or Elixir
<deimos_> none of those
<deimos_> we have erlang here, because of course we do
<FromGitter> <jrei:matrix.org> Why not using a more functional language rather than an object oriented?
<deimos_> i look at more of a hybrid than strictly one or the other
<deimos_> mostly because i know ruby the best, and now learning crystal much better
<deimos_> wasn't trying to get into oo vs fp, just that crystal is really fast, easy to prototype like ruby, and so far, stable
<deimos_> and the apache 2 license means i can probably get it approved for more critical and sensitive work
<FromGitter> <Sija> @deimos_ since u already use Erlang, Elixir looks way moar your alley
<deimos_> forget i ever mentioned functional
<FromGitter> <jrei:matrix.org> you said you program in a functional way
<deimos_> yes, i do, but i think that's a distraction. mostly, impressed with crystal and got it into a prod environment parsing trillions of log lines
<deimos_> with this success, trying to get employer to help fund crystal development
<FromGitter> <jrei:matrix.org> nice :D
<FromGitter> <jrei:matrix.org> what I regret is the lack of transparency
<FromGitter> <jrei:matrix.org> we don't know exactly where the money go
<FromGitter> <jrei:matrix.org> no very related: no survey since a long time
<FromGitter> <watzon> Yeah a survey is much needed
f1reflyylmao has joined #crystal-lang
f1refly has quit [Ping timeout: 272 seconds]
avane has quit [Quit: ZNC - https://znc.in]
avane has joined #crystal-lang
<FromGitter> <Blacksmoke16> so im brainstorming how to do lazy service instantiation
<FromGitter> <Blacksmoke16> currently trying to figure out how to make a wrapping type be compatible with the wrapped service type
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/aal5
<FromGitter> <Blacksmoke16> obs solution i think is to just not do that and actually be more/less specific with the type
<FromGitter> <Blacksmoke16> nvm this isnt a problem
avane has quit [Ping timeout: 246 seconds]
avane has joined #crystal-lang
postmodern_ has quit [Quit: Leaving]
dostoyevsky has quit [Ping timeout: 256 seconds]
dostoyevsky has joined #crystal-lang
_whitelogger has joined #crystal-lang
<FromGitter> <watzon> @mattrberry ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=600bcf053855dd07fd71d706]
<FromGitter> <watzon> I guess I might need libgl?
<FromGitter> <oprypin:matrix.org> @watzon i think this is something else - you have libgl but the binding to it is not Mac aware
<FromGitter> <watzon> Hmm lib_gl.cr seems to be linking OpenGL correctly
<FromGitter> <oprypin:matrix.org> can u throw a link to libgl
<FromGitter> <oprypin:matrix.org> .cr
<FromGitter> <watzon> I'll have to find it. I just looked in the lib directory.
<FromGitter> <mattrberry> This is the one I'm using https://github.com/nulldotpro/LibGL
<FromGitter> <watzon> Ahh you beat me
<FromGitter> <watzon> This seems to be the right thing https://github.com/nulldotpro/LibGL/blob/master/src/lib_gl.cr#L4
<FromGitter> <watzon> So it should be linking
<FromGitter> <oprypin:matrix.org> mac has different symbol naming for globals
<FromGitter> <oprypin:matrix.org> adds an extra underscore
<FromGitter> <oprypin:matrix.org> but crystal is doing that correctly. maybe mac just doesn't support this
<FromGitter> <watzon> Interestingly it seems to be just that line. Apparently the mac version of OpenGL doesn't have debugMessageCallback
<FromGitter> <watzon> I commented out the line in display.cr that's referencing it and it builds
<FromGitter> <oprypin:matrix.org> requiring opengl 4.3 is bold :>
<FromGitter> <mattrberry> I don't think there's any reason I need it :p I'm a complete opengl noob, and I just went with something that worked haha
<FromGitter> <watzon> I need to download a ROM and make sure things work, but at least it compiles haha
<FromGitter> <watzon> What args are needed in order to run it?
<FromGitter> <mattrberry> If you want to run something, you'll also need a bios. iirc this one should work https://github.com/Cult-of-GBA/BIOS/blob/master/bios.bin
<FromGitter> <watzon> I keep getting index out of bounds errors because it's checking for ARGV[0] and ARGV[1]
<FromGitter> <mattrberry> `bin/crab ~/path/to/bios ~/path/to/rom`
<FromGitter> <watzon> Ahhh ok
<FromGitter> <mattrberry> Most games *don't* run, unfortunately
<FromGitter> <mattrberry> But the Pokemon series boots, as does Kirby Nightmare in Dreamland :p
<FromGitter> <watzon> Damn, yeah apparently the Classic NES - Super Mario Bros doesn't
<FromGitter> <mattrberry> Oh classic nes is a nightmare
<FromGitter> <mattrberry> That's like end-stage for gba emulators haha
<FromGitter> <watzon> With that and Fire Red I get this error ⏎ ⏎ ```code paste, see link``` [https://gitter.im/crystal-lang/crystal?at=600bd22597132e2480fb11e4]
<FromGitter> <watzon> What pokemon games have you tested?
<FromGitter> <mattrberry> Looks like it's failing to compile the shaders..
<FromGitter> <mattrberry> Hmm
<FromGitter> <oprypin:matrix.org> @mattrberry if you wanted to try to *run* this binary in CI, can it exercise any code at all without bios/rom?
<FromGitter> <mattrberry> Not as of right now
<FromGitter> <oprypin:matrix.org> any rom and bios that's publicly downloadable? πŸ€ͺ
<FromGitter> <watzon> I’ve just tested Fire Red so far
<FromGitter> <mattrberry> I'm a complete noob when it comes to opengl. It took me way longer than I care to admit to even get to the point I am now, and all I'm doing with it is applying a little shift to the colors lol. Maybe I can remove it for now and just go back to pure sdl. I can do the color change on the cpu..
<FromGitter> <mattrberry> @watzon Try replacing display.cr with this https://carc.in/#/r/aamc
<FromGitter> <mattrberry> That's my old pure sdl renderer
<FromGitter> <mattrberry> Only downside for now is lack of color correction :/
<FromGitter> <mattrberry> @oprypin:matrix.org The bios I linked above is public and legal. You can also google Normatt's bios and find it in the ReGBA github repo iirc. As for roms, there are a handful of homebrew games that are totally fine to download. There are also plenty of test roms that people in the emudev community have made
<FromGitter> <mattrberry> It's be nice to build an automated test suite someday like I did for my gbc emulator, but that's still a ways off
<FromGitter> <watzon> @mattrberry that works
<FromGitter> <mattrberry> Nice!
<FromGitter> <mattrberry> Thanks for looking into it :)
<FromGitter> <watzon> No problem. Is it expected to be very slow with really weird audio artifacts?
<FromGitter> <mattrberry> Guess I'll just hide the opengl renderer behind a check
<FromGitter> <mattrberry> It runs fire red at 100% speed on both my laptop and desktop, but there's still a lot of optimization I need to do (and a ton of work in general). Audio artifacts are expected if the emulator is running at less than full speed. What fps are you seeing / what cpu do you have?
<FromGitter> <watzon> No idea about the fps, but it's gotta be less than half speed
<FromGitter> <mattrberry> It should say in the window title
<FromGitter> <watzon> I have an i9-9900
<FromGitter> <watzon> Ahh I missed that
<FromGitter> <watzon> Between 1 and 8 fps
<FromGitter> <mattrberry> Sad, I wonder why it's so slow..
<FromGitter> <mattrberry> There's a lot that I can and will optimize, but there's a lot that'll be harder. For example, the according to perf, the right shift operator takes 4.4% of my cpu time lol...
<FromGitter> <mattrberry> I'm running an i7-8700K on my desktop, and I get ~120fps in most games that I've tried
<FromGitter> <watzon> I do keep getting a bunch of Unmapped MMIO write and Unmapped MMIO read
<FromGitter> <mattrberry> I get about 62-65 in those same games on my laptop, which I forget the cpu in. It's a 2017 laptop cpu though
<FromGitter> <mattrberry> Do you get that after the first couple seconds of FireRed?
<FromGitter> <mattrberry> That's because FireRed reads and writes to the serial port right when it boots, and I haven't stubbed serial yet
<FromGitter> <mattrberry> But it should stop almost immediately
<FromGitter> <watzon> Yeah that could be it
<FromGitter> <mattrberry> Here's what FireRed is looking like for me right now (and I speed it up to ~120 fps in the intro sequence) https://drive.google.com/file/d/1Tk1q6v1rvgZVb-7c2EVZVyptOAM9tou8/view?usp=sharing
<FromGitter> <mattrberry> Still plenty that's broken, but it's getting there :)
<FromGitter> <mattrberry> Do you have any kind of profiler on mac to see which methods are taking the longest? I'd be curious to see what's so slow...
<FromGitter> <mattrberry> Listening to the FireRed intro again reminds me how much louder my PSGs are than they're supposed to be relative to the DMA audio. @HertzDevil would be ashamed of me ;)
<FromGitter> <mattrberry> I'm off for the night! Thanks for the help debugging :) I'll take a look to see if I can fix the opengl issues for mac, even if that means just falling back to an sdl renderer for now
deimos_ has quit [Quit: leaving]
deimos_ has joined #crystal-lang
<FromGitter> <watzon> I'm sure there is, but I haven't dug that far yet
<FromGitter> <watzon> There's no way to un-include a module is there? It can be a pain if a class you're extending is including JSON::Serializable, but you don't want any of the methods in your subclass to be serialized. Lots of `@[JSON::Field(ignore: true)]`
<oprypin> oh hm
fifr[m] has quit [Ping timeout: 243 seconds]
<FromGitter> <Daniel-Worrall> Maybe it could support annotating the subclass to do things like ignore further
_ht has joined #crystal-lang
fifr[m] has joined #crystal-lang
fifr[m] has quit [Ping timeout: 244 seconds]
<straight-shoota> @watzon, that sounds weird. Why do you want to serialize properties in the base type but not in its ancestor?
<straight-shoota> *not in a child
fifr[m] has joined #crystal-lang
ua has quit [Ping timeout: 260 seconds]
<FromGitter> <watzon> The child doesn’t need to be serialized. It’s an odd case I’ll admit
<straight-shoota> then why care? =)
ua has joined #crystal-lang
deavmi has quit [Ping timeout: 265 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]
deavmi has joined #crystal-lang
<FromGitter> <asterite> Instruments inside xcode
<FromGitter> <Blacksmoke16> > Why do you want to serialize properties in the base type but not in its ancestor? ⏎ ⏎ An actual use case of this could be for like MTI, i.e. you have a base `Integration` type that should have its data serialized, like name, status, etc
<FromGitter> <Blacksmoke16> but then you have like `GoogleUser` child that has like oauth token data that you dont really wantto expose
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]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
<FromGitter> <sija:matrix.org> yo, just found out a post about Crystal from Auth0: https://auth0.com/blog/an-introduction-to-crystal-lang/
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 272 seconds]
<FromGitter> <Daniel-Worrall> What's the easiest way to explicitly define a variable as nilable even though you're giving it a value
<FromGitter> <Daniel-Worrall> like `foo : Int32? = 1`
<FromGitter> <Blacksmoke16> just like that?
<FromGitter> <Daniel-Worrall> nope, doesn't compile as nilable
<FromGitter> <Daniel-Worrall> It's just an Int32
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/aaos
<FromGitter> <Blacksmoke16> seems fine?
<FromGitter> <Daniel-Worrall> Well, yeah, but you're assigning nil. I want the var to be Typed as Int32?, not Int32
<FromGitter> <Daniel-Worrall> I guess I could just assign it a nil above
<FromGitter> <Blacksmoke16> no what im getting at is the type of `var` *HAS* to be `Int32` or i wouldn't have been able to assign `nil` in the first place no?
<FromGitter> <Blacksmoke16> `Int32?`*
<FromGitter> <Daniel-Worrall> Well, I'm not assigning var as nil later
<straight-shoota> >> var : Int32? = 1; typeof(var)
<DeBot> straight-shoota: # => Int32 - https://carc.in/#/r/aaov
<FromGitter> <Daniel-Worrall> ^
<straight-shoota> >> var : Int32?; var = 1; typeof(var)
<DeBot> straight-shoota: # => Int32 - https://carc.in/#/r/aaow
<straight-shoota> >> var : Int32?; var = 1; var = nil; typeof(var)
<DeBot> straight-shoota: # => Nil - https://carc.in/#/r/aaox
<FromGitter> <Daniel-Worrall> If you assign it nil before the =1, it'll be `Int32?`
<FromGitter> <Daniel-Worrall> which is fine I gues
<FromGitter> <Blacksmoke16> `var : Int32? = 1 || nil`
<straight-shoota> >> var : Int32?; var = nil; var = 1; typeof(var)
<DeBot> straight-shoota: # => Int32 - https://carc.in/#/r/aaoz
<FromGitter> <Daniel-Worrall> wut
<straight-shoota> na it's always the last value
<straight-shoota> it's an unclosured local var so the compiler can prove that the type can't be a union
<straight-shoota> >> var : Int32?; var = nil; var = "foo"; typeof(var)
<DeBot> straight-shoota: Error: type must be (Int32 | Nil), not (String | Nil) - https://carc.in/#/r/aap0
<FromGitter> <Daniel-Worrall> Ah, it's because I'm doing proc bs
<straight-shoota> It still values the typ restiction
<FromGitter> <Daniel-Worrall> Right, that makes sense of what I was seeing
deavmi has joined #crystal-lang
<FromGitter> <Daniel-Worrall> So, I'm not familiar with closures and the intricacies of them, but would type restricting them be possible within the compiler? Something like this? https://carc.in/#/r/aap1
deavmi has quit [Ping timeout: 272 seconds]
<FromGitter> <Daniel-Worrall> Nice label spree :D
<FromGitter> <Daniel-Worrall> You mind labelling #9957? It seems to be a good big step for win32 but I didn't even know it existed browsing on the win label
<DeBot> https://github.com/crystal-lang/crystal/pull/9957 (Implement basic event loop for win32)
_whitelogger has joined #crystal-lang
<FromGitter> <Blacksmoke16> ```code paste, see link``` ⏎ ⏎ is what im doing now but prob missing some methods [https://gitter.im/crystal-lang/crystal?at=600c3860410c2214401a236c]
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 260 seconds]
deavmi has joined #crystal-lang
kevinsjoberg has quit []
<_ht> How can I test macro's that are defined on the class level? I seem unable to create a new class inside a test case. Then I get a "can't declare class dynamically" message.
<FromGitter> <Blacksmoke16> Got an example?
<straight-shoota> macros expand in the context that calls them, not where they are defined
<_ht> Yes. I have a "Command" class with a "command" macro that takes a String parameter. It should raise an error when that parameter is empty.
<_ht> So, I want to test when I create a new subclass of "Command", say "T", like: class T < Command NEWLINE command "" NEWLINE end, that this indeed raises an error
<FromGitter> <Blacksmoke16> if you could make a playground link with the error that would be super helpful
<_ht> I will try. There is a publically available playground I should use?
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/cr
<_ht> Thanks!
<_ht> I have a minimal example, all in one file: https://play.crystal-lang.org/#/r/aapy
<FromGitter> <Blacksmoke16> ah, yea you cant create a class within a block like that
<_ht> Does that mean I cannot test this behavior of a class-level macro?
<FromGitter> <Blacksmoke16> and you could make that exception a compile time error fwiw
<_ht> I can!
<_ht> That would be a lot better!
<FromGitter> <Blacksmoke16> is your actual command macro doing more?
<FromGitter> <Blacksmoke16> versus this example?
<_ht> Nope.
<_ht> It is part of a DSL to wrap CLI commands
<_ht> I have also macros for options
<FromGitter> <Blacksmoke16> https://play.crystal-lang.org/#/r/aaq0
<FromGitter> <Blacksmoke16> i guess what i was getting at is do you really need it tobe a macro versus just doing `@@command = "abc123"`?
<_ht> Sort of. I looks nicer as part of the DSL than with all the @@ about. The idea is that you can wrap a CLI program without writing much Crystal code by using these macros.
<FromGitter> <Blacksmoke16> mmk
<_ht> Using this compile error does make things more robust
<FromGitter> <Blacksmoke16> mhm
<_ht> But I would still like to test that it is doing this properly, though
<_ht> Can I test for a compile error?
<_ht> Aha, a workaround! Thanks Blacksmoke16!
<_ht> And once my "CommandWrapper" project is finished, I can use that for this workaround :-)
<FromGitter> <Blacksmoke16> i assume you're aware of like https://github.com/jwaldrip/admiral.cr ?
<_ht> Yes, but it is too "codey" for my taste
<_ht> Plus, I want to support any type for an option that takes a value
<FromGitter> <Blacksmoke16> πŸ‘
<_ht> Also, my "CommandWrapper" is doing the reverse: It wraps an existing CLI program as a Crystall class
<FromGitter> <Blacksmoke16> ohh ok
<FromGitter> <Blacksmoke16> thats pretty slick
<_ht> I hope so!
<_ht> But I am still learning a lot about Crystal, so it might end up being one big mess :-)
<FromGitter> <Blacksmoke16> thats what refactors are for
deavmi has quit [Ping timeout: 272 seconds]
deavmi has joined #crystal-lang
<FromGitter> <Blacksmoke16> ☝️ January 23, 2021 9:53 AM (https://gitter.im/crystal-lang/crystal?at=600c3860410c2214401a236c) ⏎ ⏎ Just realized i could prob use `delegate` for those
deavmi has quit [Ping timeout: 265 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 265 seconds]
deavmi has joined #crystal-lang
DTZUZU_ has joined #crystal-lang
DTZUZU has quit [Read error: Connection reset by peer]
DTZUZU__ has joined #crystal-lang
DTZUZU_ has quit [Ping timeout: 264 seconds]
<FromGitter> <jrei:matrix.org> _ht what do you mean by "wapping an existing CLI program as a Crystal class"?
<FromGitter> <jrei:matrix.org> You may like https://github.com/j8r/clicr
<FromGitter> <Blacksmoke16> prob something like you "wrap" `git`, then in code you can do like `Git.commit` or `Git.push`
<FromGitter> <jrei:matrix.org> Ha ok, got it
<FromGitter> <jrei:matrix.org> It will end up being a huge library, --help are non standard
<FromGitter> <jrei:matrix.org> I thought about something similar to generate sh completions for any command with a --help
<FromGitter> <jrei:matrix.org> Or maybe the library won't do any validation?
f1reflyylmao is now known as f1refly
ua has quit [Ping timeout: 258 seconds]
ua has joined #crystal-lang
<_ht> jrei: My wrapper is sort-of the inverse of the "option parser" you linked to.
<_ht> An alternative way of using external code, as it were. Instead of binding a C library, you just bind to a program like imagemagick's convert, pandoc, pdflated, etc.
<_ht> I've written specific wrappers before in Ruby, and now that I am switching to Crystal I am taking the opportunity to generalize my approach to any command-line program.
deavmi has quit [Ping timeout: 265 seconds]
<FromGitter> <jrei:matrix.org> Nothing stops me from doing `Pandoc.wrong_command`?
<FromGitter> <jrei:matrix.org> And what about docs?
<_ht> The idea is that you specify the options you support in your wrapper. These options can have a type for their values, so Crystal will check that the values you give to the options are okay.
<_ht> You do end up with a wrapper that is very close to the command-line application's API, which is both an advantage and a disadvantage.
<_ht> So, to answer your question, you cannot do Pandoc.wrong_command.
<_ht> Well, unless you specified a "wrong_command" option in the wrapper.
deavmi has joined #crystal-lang
<FromGitter> <jrei:matrix.org> So your library can be used to make, say, a Git shard which will wrap the `git` command
<_ht> Yes
deavmi has quit [Ping timeout: 265 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 265 seconds]
ua has quit [Ping timeout: 256 seconds]
deavmi has joined #crystal-lang
deavmi has quit [Ping timeout: 265 seconds]
richbridger has joined #crystal-lang
deavmi has joined #crystal-lang
ua has joined #crystal-lang
sorcus has joined #crystal-lang
<FromGitter> <mattrberry> Breaking out of nested loops to a specific point isn't something that's supported by the language, right? Obviously there are ways to circumvent that, but it'd sure make this piece of code look nicer :p
<FromGitter> <Blacksmoke16> neg
<FromGitter> <mattrberry> πŸ‘
<FromGitter> <astrojuanlu:matrix.org> hi all! I see that Crystal has support for ARMv7 (#3424) but the Docker Hub images are only `linux/amd64`, are there plans to upload `linux/arm/v7` as well? ⏎ ⏎ (context: trying to build invidious on my Raspberry Pi)
<DeBot> https://github.com/crystal-lang/crystal/pull/3424 (Add ARMv6 / ARMv7 support)
_ht has quit [Remote host closed the connection]
<straight-shoota> Arm docker images are not fully supported yet, but semi-official ones are available at jhass/crystal
<straight-shoota> they're used for CI on arm in the Crystal repo, so it should be expected to work
<FromGitter> <astrojuanlu:matrix.org> thanks @straight-shoota! unfortunately the alpine-based images do not support `arm/v7`, so I'll still have to work a bit more. but it's a good place to start
<FromGitter> <mattrberry> @watzon Hey just want to check since you said you were getting 9 fps. My friend with some 2014 macbook pro is getting 67fps when uncapped and is holding a steady 60 when capped. Did you build for release?
postmodern has joined #crystal-lang
<postmodern> crazy idea, hear me out, but has anyone thought of hooking crystal's GC up to another languages GC? It occurred to me we might be able to embed crystal in other GCed languages, provided it's GC somehow interfaces with Crystal's GC
<FromGitter> <asterite> Oh, that's actually a nice idea. You mean, whenever Crystal needs memory, it asks that other language to allocate memory? The only problem I forsee is that other GCs are sometimes turned for that language. For example the GC might be precise, or move memory around
<FromGitter> <oprypin:matrix.org> postmodern: well for crystal-imgui i hook up C++ memory allocation to Crystal's memory allocation so that's something
<postmodern> or somehow it exposes it's GC object map to the other languages GC, or allocate crystal objects via the languages object heap?
<FromGitter> <oprypin:matrix.org> postmodern (https://matrix.to/#/@postmodern:matrix.org):
<FromGitter> <oprypin:matrix.org> if we're talking about libgc it just seems to be very simple
<FromGitter> <oprypin:matrix.org> it just tracks whatever roots were given to it and things just work
<FromGitter> <oprypin:matrix.org> other than that, it's case-specific. maybe with some implementations it's easy, with others impossible
<FromGitter> <jrei:matrix.org> astrojuanlu (https://matrix.to/#/@astrojuanlu:matrix.org): https://github.com/crystal-lang/crystal/pull/7859
<FromGitter> <astrojuanlu:matrix.org> thanks j8r (https://matrix.to/#/@jrei:matrix.org) , I'll wait then
<FromGitter> <jrei:matrix.org> you'll probably have to wait for long...
<FromGitter> <jrei:matrix.org> I'm not going to continue this PR - it was a best effort with my little knowledge on the topic