A Look at Rust from 2012
16 days ago
- #Rust
- #Programming
- #History
- The article explores Rust's early versions (0.5-0.6) and compares them to modern Rust.
- Installation was complex, requiring building from source or manual setup on Windows, unlike today's rustup.
- Early syntax included 'io::println' for printing, with no 'println!' macro, and used 'fmt!' for formatted strings.
- Syntax differences included 'uint'/'int' instead of 'usize'/'isize', and 'continue' was called 'loop'.
- Enums had unscoped variants, similar to C, and could simulate tuple-like structs.
- Memory model featured '@T' (GC heap), '~T' (owned heap), and '&T' (references), unlike today's simpler model.
- Early Rust had green threads, task-based concurrency, and panics called 'exceptions'.
- Borrow checking was less sophisticated, with lexical lifetimes and no NLL (Non-Lexical Lifetimes).
- Structs had mutable fields marked with 'mut', and references included '&const', '&mut', and '&'.
- The article concludes by appreciating Rust's evolution into a more user-friendly language.