Rust - The Modern System Programming Language

A Taste of Rust

Why Rust is Awesome?


Awesomeness #1: Zero-cost abstraction

What you don’t use, you don’t pay for. And further: What you do use, you couldn’t hand code any better.

[Stroustrup, 1994]

Awesomeness #2: Trait-based generics


Awesomeness #3: Memory safety

A#3.1: Ownership and Borrowing

Classical problem: Memory leak


A#3.2: References and Mutability

Classical problem: Concurrent data races


A#3.3: Lifetimes

Classical problems: Use after free


Awesomeness #4: ADT and Pattern Matching


Awesomeness #5: Type System

Awesomeness #5: Type System


Rust's advantages over C++

  1. cargo ecosystem
  2. Safety
  3. Simplicity of design
  4. Modern language constructs

But Rust is not perfect

  1. Value-returning flavor error handling
  2. Lack of OOP
  3. Too many macros
  4. Steep learning curve (even for C/C++ hackers)
  5. Still in fast evolving
  6. Too many types of pointers, closures, strings ....

Rust in the wild


Servo - The Modern Parallel Browser Engine


Why Mozilla want to invent a new language to write something to replace Gecko (in C++)?

How does the effort pay off?

Performance and Benchmark

Performance and Benchmark (Cont.)

Servo v.s. Gecko

Browser Internals 101

Browser Internals 101 (Cont.)

Browser Reference Architecture

Browser Internals 101 (Cont.)

FireFox Architecture

Servo's Architecture

Task supervision diagram

Servo's Architecture (Cont.)

Each constellation manages a pipeline of tasks:

Servo's Strategies for parallelism and concurrency

Personal Experience of Hacking on Servo


Servo needs you


Most Loved PL in 2016 is Rust

Rust just turns one year old

Rust 1.0 was released at May 15, 2015. Here is a post on the past year.