16 / Rust
Ownership before speed
Graydon Hoare began Rust at Mozilla in 2006 so systems work would not trade speed for leaks. The compiler refuses unsafe sharing. This terminal still does not compile — it only matches the strings the lesson taught.
Rust · 16 min · 0/4 quiz strings accepted
A personal project that moved the kernel
For decades, systems work — kernels, engines, embedded devices — belonged to C and C++. Those languages are fast and leave memory to the author. Buffer overflows and dangling pointers became an industry cost.
Rust was initiated by Graydon Hoare at Mozilla Research in 2006. It refuses the old bargain. There is no garbage collector like Java or Python, and no silent trust like C. The ownership model and the borrow checker enforce how data may be accessed. If the rules fail, the program does not compile.
Rust now appears in the Linux kernel, in WebAssembly modules, and in infrastructure that cannot afford a collector pause. Surveys have named it the most admired language for consecutive years, near 83%. Cargo, the build and package tool, sits near 71% admiration. Adoption remains smaller: 13.9% to 23.1%.
Immutable until you say mut
A binding is still until you mark it. let mut is a decision, not decoration. The beginner curriculum in the education report uses a status string that starts as Booting... and becomes Online only because mut was written.
fn main() {
let mut system_status = "Booting...";
println!("Current state: {}", system_status);
system_status = "Online";
println!("System is now: {}", system_status);
}A move is not a copy
String::from allocates. When you bind that value to a new name, ownership moves. The first name is finished. Printing it after the move is a compile error — evidence, not a runtime surprise.
let original_string = String::from("Critical Data");
let new_owner = original_string;
println!("Data successfully moved to: {}", new_owner);From rustc to WASI 0.2
Advanced work compiles a Rust library into a WASI 0.2 component. WIT files describe how that module speaks to others. CodeLabs will not invoke rustc. Learn the contract here; run cargo on your machine.
Glossary
- ownership
- The rule that one binding is responsible for a value’s memory.
- borrow checker
- The compiler pass that refuses conflicting access.
- mut
- The keyword that allows a binding to change.
Quiz
Type the string. Keep the understanding.
The terminal cannot execute this language. It only prints ACCEPTED or REJECTED when your string matches the lesson.