4 ms·
Ada doesn't have the same memory management safety without a garbage collector that Rust does.
by monocasa 9y ago
Ada doesn't have the same memory management safety without a garbage collector that Rust does.
- dozzie 9y agoIndeed Ada has different memory management model, though equally safe.
- monocasa 9y agoI've coded in Ada. Storage pools are not as safe as Rust's affine type system. For one it's a lot easier to leak memory with Ada, since they're mainly built off of reference counting.
- moosingin3space 9y agoPedantic: memory leaks are memory-safe, despite generally being undesirable.
- monocasa 9y agoYou're totally right, but yeah, I tend to roll it in to the same category since I consider the denial of service associated with memory leaks to be as bad as stricter memory unsafety. (And to be very pedantic I said 'memory management safety', not just 'memory safety').
- deleted 9y ago[deleted]
- pcwalton 9y agoAda uses a garbage collector for the free store (or just uses unsafe code if it's disabled). Ada's memory management model is not really different from any other typical language.
- dozzie 9y agoThis is the first time I've ever heard of Ada being garbage collected. Neither ARM, Barnes' nor Ben-Ari's books, nor GNAT manual say that there is supposed to be a garbage collector (quite the contrary, the books say that GC is allowed, but usually not present). Where did you get your information from?
- Raphael_Amiard 9y agoAda has memory management safety, even though it is not the same paradigm as Rust. Affine typed pointers might be a tad more powerful than Ada's scoped pointers and limited types, but they're still not powerful enough to express everything useful - cyclic structures in general are a very big hole in Rust's type system in that regard. And then in both language, you can use unsafe when you need more power. So Rust might (and I say might, because I have no clear proof of that yet) be a tad more powerful in the safe subset, but it's not in a different class.