4 ms·
> Rust is also the only industry language I'm aware of that gives you memory safety without garbage collection. Python uses refcounting, and has a GC only for
by captainmuon 13y ago
> Rust is also the only industry language I'm aware of that gives you memory safety without garbage collection.
Python uses refcounting, and has a GC only for cycle breaking. You can turn it off in many cases and have deterministic behavior. Among compiled languages, Vala has no GC but safe references. It uses refcounting, too, but AFAIK also deduces when an object will not leak out of the scope (and thus the refcounting can be elided). But Vala is also somewhat a niche language, constructed around the GObject/Gtk object model.
That being said, the way rust handles memory looks really interesting. I definitely have to try it out these days.
- pcwalton 13y agoReference counting is a form of garbage collection. There are many industry languages that offer safety without tracing garbage collection, but not without any garbage collection.