Academically speaking, Rust is a managed language. The GC has simply been lifted to compile-time (or runtime in the case of Rc). You never call `alloc` and you never call `free`.
[1]: https://devblogs.microsoft.com/oldnewthing/20100809-00/?p=13...
Academically speaking, Rust is a managed language. The GC has simply been lifted to compile-time (or runtime in the case of Rc). You never call `alloc` and you never call `free`.
[1]: https://devblogs.microsoft.com/oldnewthing/20100809-00/?p=13...
(And you can call `alloc` and `free` from Rust, https://doc.rust-lang.org/std/alloc/fn.alloc.html)
It's also weird that you call out `Rc` specifically. `Box` also allocates and free memory, as does `Vec` and other types from the `alloc` crate.
Reference counting is a form of garbage collection, as per most highly referenced CS books on the subject, like The Garbage Collection Handbook, chapter 5.
But lets put that aside, considering that std::..._ptr<>() or any other variant thereof are plain optional library types.
That still leaves Unreal C++, C++/CLI, C++/CX as garbage collection extensions to C++, just like GCC C++ or clang C++ provide their own language extensions.
https://docs.unrealengine.com/4.26/en-US/ProgrammingAndScrip...
https://docs.microsoft.com/en-us/cpp/dotnet/dotnet-programmi...
https://docs.microsoft.com/en-us/cpp/cppcx/visual-c-language...
That’s not a property of the language, only of the standard library. You could design APIs that do require you to manually call alloc and free; it’s just less ergonomic to do that