https://github.com/brson/the-end-of-unsafety
~ slides, notes, links ~
~ www.rust-lang.org ~
1972 → whenever
2009 → present
right now!
present → the glorious future
1972 → whenever
The state of being protected from various software bugs and security vulnerabilities when dealing with memory access, such as buffer overflows and dangling pointers.— Wikipedia
Let's be honesthonest, if you need segfault protection, you're a bad programmer.— Anonymous good
2009 → present
All 34 sec-critical bugs filed against Web Audio so far are either buffer overflows or use-after-free.— Robert O'Callahan, Mozilla
How can I maintain memory safety in a concurrent program without a global GC?
Rust is Cyclone + Singularity
In Rust, every value has a single, statically-known, owning path in the code, at any time.
Pointers to values have limited duration, known as a "lifetime", that is also statically tracked.
All pointers to all values are known statically.
fn main() {
let b = Balloon::new();
examine_balloon(b);
// accessing b here is a compilation error
println!("still have a balloon? {}", b);
}
fn examine_balloon(b: Balloon) {
println!("this balloon looks like {}", b);
// b is destroyed when the function exits
}
fn main() {
let b = Balloon::new();
examine_balloon(&b);
println!("still have my balloon! {}", b);
// b is destroyed when the function exits
}
fn examine_balloon(b: &Balloon) {
println!("this balloon looks like {}", b);
}
fn main() {
let mut b = Balloon::new();
examine_balloon(&mut b);
println!("still have my balloon! {}", b);
// b is destroyed when the function exits
}
fn examine_balloon(b: &mut Balloon) {
b.draw(Drawing::HappyFace);
}
right now!
By our metrics, Rust went from the 46th most popular language on GitHub to the 18th... no other language grew faster.
present → the glorious future
https://github.com/brson/the-end-of-unsafety