Rust has some amazing tools!

Rustup

The Rust toolchain installer

WTF are channels?

stable Won't change, should be bug-free (default)
beta Won't change, but might have bugs
nightly Contains experimental features that might be removed or changed

Installation Instructions:

https://rustup.rs

Github Repository:

https://github.com/rust-lang-nursery/rustup.rs

Cargo

Rust's dependency manager and build helper

Two main responsibilities:

  • Fetch and build project dependencies
  • Act as a wrapper to rustc and pass the correct parameters for your project

Dependencies are managed in your Cargo.toml file.

The Cargo.lock file allows for reproducible builds. It's created automatically, so don't edit it by hand.

Cargo can also manage:

  • The running of tests
  • Building and running examples
  • Managing build scripts
  • Publishing to Crates.io

The Cargo Book:

https://doc.rust-lang.org/cargo

Crates.io

Rust's crate registry

In Rust, packages are called crates.

  • Great, if you have an idea of what you're looking for.
  • Contains links to documentation for most crates.
  • Lists popular crates, new crates.
  • Allows browsing by category.

Crates.rs

An opinionated alternative to Crates.io that's great for browsing:

https://crates.rs/

rustfmt

The official formatter for Rust code

Available as part of cargo
since Rust 1.24

It might get confused in a couple of situations:

  • Macros
  • Incorrect / non-compiling code
  • Any Rust code in a doc comment
  • Non-ASCII unicode

Clippy

A collection of lints to catch common mistakes and help you write more idiomatic Rust
Clippy is now part of cargo!

Find a list of ALL current lints here:

https://rust-lang-nursery.github.io/rust-clippy/

RLS

The Rust Language Server

Rust lang support for your IDE

Includes:

  • Syntax Highlighting
  • Snippets
  • Build Tasks
  • Error Checking
  • Go To Definition
  • Find Implementations
  • And more...

Mostly depends on the Rust compiler

Falls back to Racer for situations where the compiler is too slow

More info:

https://github.com/rust-lang-nursery/rls https://github.com/racer-rust/racer

IDE recommendations

  • Visual Studio Code with the rust extension
  • IntelliJ Rust
  • Corrosion, an Eclipse based IDE for Rust
https://github.com/rust-lang-nursery/rls-vscode
https://intellij-rust.github.io/
https://github.com/eclipse/corrosion

Rust playground

An open source web-based REPL for Rust
  • Includes rustfmt and clippy
  • Allows you to compile in --release or --debug mode
  • Supports stable, beta, and nightly channels
  • Allows for easy sharing and demonstration of Rust code snippets
  • Allows you to view generated assembly, LLVM IR, MIR, and WASM code

Play with it here:

https://play.rust-lang.org/

Compiler Explorer

A featureful way to explore the assembly code generated by compiling a Rust program

Great for when you really want to make a program as performant as possible

Includes two example programs, pre- and post-optimization

See it here:

https://godbolt.org/

Don't forget to switch it to Rust mode

The Rust
Programming Language

a.k.a "TRPL"

a.k.a "The Book"

The best way to learn Rust!

It contains almost anything you could want to know about the language!

Read the whole thing right now:

https://doc.rust-lang.org/book/2018-edition
The Rustonomicon

However...

there exists a dark counterpart to
The Book

known as

The Rustonomicon

All about unsafe Rust

You should be pretty familiar with safe Rust first

It deals with some of the more unstable aspects of Rust

It teaches you how to implement std::vec::Vec

Unlock the dark secrets of Rust:

https://doc.rust-lang.org/nomicon/
Zelda will now answer your questions