Mozilla's systems programming language Rust
Pit Stop

© Lead Image © Paul Maydikov, 123RF.com
We look at a few features of Rust, Mozilla's systems programming language, and its similarity to other languages.
The statically typed programming language Rust [1] places much emphasis on speed and security. Rust, like its inspiration C, stores fixed-sized variables in a stack. However, it stores pointer values in the main memory heap. The code in Listing 1 demonstrates controlled handling of allocated memory in Rust. If you compile Listing 1 in the shell via
rustc moved.rs
the compiler will abort the process with the error message moved_type.rs:8:3: 8:6 error: use of moved value: `vec` for line 8.
[...]
Buy this article as PDF
(incl. VAT)