3 ms·
With a bit of experience you get the same in Rust. Rust does not abstract away memory management. For example, it never heap allocates anything implicitly. It
by pornel 6y ago
With a bit of experience you get the same in Rust.
Rust does not abstract away memory management. For example, it never heap allocates anything implicitly. It inserts destructors, but does so predictably at end of scopes, in a specified order.
Rust heavily uses iterators with closures, but these get aggressively inlined, and you can rely on them optimizing down to a basic loop. For code generation they're not too different from a fancy C macro.
And if in doubt, there's https://rust.godbolt.org/ https://rust.godbolt.org/ (don't forget to add -O to flags)