I don't often give talks about Rust, but I was in Tokyo recently during the Rust 1.0 release and figured I'd drop in on the Mozilla Tokyo office release party. I figured they'd try to make me talk about something, so I prepared a lightning talk. As is typical of my Rust-project communication style, I presented in point form. This is the contents of the talk:
Five lists of six things about Rust:
- Six ways Rust is fundamentally different from how it started
- Borrow checker subsumed most other safety mechanisms, lots discarded
- Much more static: monomorphization of sizes, glue code, and static trait dispatch
- LLVM: strengths (amazing optimization) and weaknesses (narrow semantics)
- Between these two points, maybe 100x faster at runtime, 100x slower to compile
- Grammar, resolution, dispatch, type system much more complex, expressive
- Adopted standard C platform stack, threads, ABI, linkage, mangling, unwinding
- Six ways Rust is fundamentally the same as how it started
- Safety through memory ownership and isolation, no global GC, no aliased mutable state
- Default immutable, algebraic data types ("ML in C++ clothing")
- Focus on dense memory layout, interior allocation, minimizing pointer chasing, vectors over lists
- No global namespace, everything module scoped and crate relative
- Support for standard tools: gdb, perf, dtrace, objdump
- RAII, dtors, idempotent uncatchable unwinding ("crash only")
- Six things we lost along the way
- Typestate system
- Effect system
- Function complexities: parameter modes, argument binding, stack iterators, tail calls
- Language-integrated runtime for tasks, channels, logging
- GC pointers, task local GC (yes, rustboot had a real mark/sweep)
- Dynamic, structural object types
- Six things we gained along the way
- Lambdas, with environment capture
- First class borrowed pointers -- not just parameter modes -- with explicit lifetimes
- Traits, with associated items
- Hygienic macros beyond just raw syntax extensions
- Multiple parallelism modes beyond just actors (ARC, fork/join, SIMD)
- Cargo, crates.io, a huge vibrant community!
- Six things I'm irrationally, disproportionately pleased by
- Rich patterns: slice patterns, range patterns, or patterns
- Novel consequences of move semantics: static freeze/thaw, iterators that consume their containers
- Rich syntax extensions: compile time regular expressions, SQL statements, docopt
- Novel embeddings: postgres and python extensions, crypto libraries, kernels in rust
- C++ ballpark on benchmarks
- A 1.0 stable release after nearly a decade of work
(Ok, maybe my pleasure at some of these is rational and proportionate..)
This entry was originally posted at http://graydon2.dreamwidth.org/214016.html. Please comment there using OpenID.