https://www.youtube.com/watch?v=uLlv_aZjHXc (Argument Clinic)
And I'm pretty sure using a GC in some cases it's the only option to not go crazy.
I mean, look something like C++ or the name "std::vector" specifically. There are probably 4 Trillion LoC containing this code out there - in production. I'm used to it, doesn't make it good.
Let me do some quick research:
https://gist.github.com/bobrik/82e5722261920c9f23d9402b88a0b... https://nvd.nist.gov/vuln/detail/cve-2024-26923
We all happily march into a future where only arena allocation is allowed, and when the arena is overfull it can only be fully reset without saving data. Copying still-used data out if it before reset is not allowed, as that's a copying half-space garbage collector. Reference counting is of course not allowed either as that's also garbage collection. Everyone is blessed...?
See https://en.wikipedia.org/wiki/Resource_acquisition_is_initia...
This example is specific to C++
> (..) if your programme crashes there's no guarantee that you'll ever give the resources back.
What guarantees can you have from a "crashing program", and by what definition of crashing?
> RAII is a leaky abstraction
Any abstraction is leaky if you look close enough.
You might like https://www.usenix.org/conference/hotos-ix/crash-only-softwa...
Jason Orendorff has an implementation of a GC in rust called "cell-gc" that seemed like only one I've seen so far that seemed to "get" how to marry rust to the requirements of a GC implementation: https://github.com/jorendorff/cell-gc
Still has a lot of unsafe code and macro helpers, but it's laid out well and documented pretty well. Not sure if you've run across it yet.
eru•3w ago