4 ms·
> The languages that provide memory safety also incur GC pauses This is incorrect, you can have memory safety without a gc. An example is Ada, and more recentl
by icebraining 8y ago
> The languages that provide memory safety also incur GC pauses
This is incorrect, you can have memory safety without a gc. An example is Ada, and more recently Rust.
- com2kid 8y agoIIRC memory safe Ada doesn't allow for deallocation. Kinda sorta cheating. ;)
- pjmlp 8y agoIt does via memory pools, RAII (aka controlled types) and dynamic stack allocation.
- com2kid 8y agoIt isn't truly safe like Rust, as Ada can still have dangling pointers laying around, the free function is called "Unchecked_Deallocation", not sure if newer Ada has any mechanisms for better ownership semantics.
- comex 8y agoAnd Swift, which uses automatic reference counting instead of GC. This is not a “zero-overhead” design like what Rust aims for; sometimes it has quite a lot of overhead. But it is free from the phenomenon of GC pauses.
- icebraining 8y agoWell, in that regard, so is Python; the GC is only used to resolve cycles, and can be disabled.
- pjmlp 8y ago> But it is free from the phenomenon of GC pauses. Not really. RC algorithms can lead to stop the world in cascade deletion of highly nested data structures, and even cause stack overflow due to destructors being called.