Rust Onboarding

(Not meant for public consumption)

Goals:

To make neophytes comfortable reading source code To give a jumping off point for those that want to learn to write Rust

Non-goals:

To teach you how to write Rust To discuss the minutiae of the language in depth

Rust high level:

Systems language, meant to replace C/C++ Adds memory safety and ‘modern’ features Can be hard to learn because it’s a compiled language with additional compile-time memory constraints Hard but fair, exploding in popularity / ecosystem growth

Features:

  • Generics
  • Traits
  • Enums / ADTs
  • Structs
  • Async
  • Macro system
  • Access controls
  • Batteries included (std lib, 3rd party)

Non-features:

  • Inheritance
  • Mutability*
  • Overloading
  • Dynamic typing*
  • Reflection*

Tips:

  • If Rust is bad at X, it probably wants you to do X another way
  • Favor cargo check (partial compilation without codegen or linking)
  • Use cargo fmt and cargo clippy often
  • Use unimplemented!() and todo!() to stub code

Resources:

Three levels of language ref:

Cargo:

Install:

Cheat sheets:

Memory:

Comprehensive: