Originally posted by jrch2k8
View Post
Java and C# are a VM with garbage collection and runtime checks, D removes the VM (and can technically be used without garbage collection but always is), and Rust removes the garbage collector leaving just some runtime bounds checks akin to what you'd get with modern C++ anyways.
Rust also allows you to run "unsafe" sections if you want where there are no checks or if you wanted to import some ASM for a boot function or tuned loop as in C/C++. The compiler does all optimizations and memory safety verification (except run times bounds checks and such) so that doesn't have to hit runtime. It relies on LLVM so has as much experience in optimization as you'd expect a C/C++ program compiled via LLVM to have. You're also quite allowed to replace standard libraries that interact at the system or hardware level with your own (or not even use the Rust standard lib), I believe D also shares this but is slightly more limited. You can also tweak things like SIMD (built into the standard library) or custom instructions in the same way you would with C/C++. Also the entire language was designed with parallelism in mind rather than added on later. Naturally you have full control of how your process is scheduled to the extent the OS allows as well.
In short Rust is comparative to modern C++ with extra grammar for compile time checks and none of the legacy baggage. It is not run in a VM or with a garbage collector or abstracted away from the physical hardware, it just checks to make sure you aren't shooting yourself in the foot while twiddling bits.
Comment