Rust has a “community of developers empowered by their tools and each other” (via Katharina Fey in “An async story“). The Rust community helps each other through effective narrative documentation and attention to error messages, and the robust tooling around Rust drives momentum, overcoming some of the natural hurdles when diving into a new language.
Here’s my list of essential rust tools (so far):
The default tool when you install rust.
Rust has very good offline documentation (perfect for learning on long plane trips!). See
rustup doc help for full list. Here are some highlights:
rustup doc --book # Rust Programming Language book
rustup doc --rust-by-example # collection of runnable examples
rustup doc --std # Standard library API documentation
Cargo packages Rust code into crates. You can find published libraries at crates.io. After getting familiar with
cargo.toml file which streamlines development and enables reproducible builds, I found command line management easier with cargo-edit:
cargo install cargo-edit
cargo add <crate> # also provides rm, upgrade
Rust and Web Assembly
The Rust Wasm tooling has improved dramatically over the past year — wasm-pack is the “one-stop shop for building, testing, and publishing Rust-generated WebAssembly.” The rustwasm book is very good.
cargo install wasm-pack
Parcel tool chain is idiomatic for NodeJS folk.
npm run start will run a local server and watch your files.
npm init rust-parcel hello-rust-parcel
When you build your web app, it automatically prints out the kinds of things you should want to know. For many uses of Rust, compiled code size doesn’t matter, but for Web apps, it is important to keep an eye on download size:
npm run build
> firstname.lastname@example.org build /Users/sallen/src/rust/hello-rust-parcel
> parcel build index.html
✨ Built in 3.20s.
dist/rust_parcel_bg.d1b79d09.wasm 67.63 KB 13ms
dist/js.caa35af8.js.map 14.65 KB 11ms
dist/js.caa35af8.js 7.49 KB 2.58s
dist/Cargo.8d29e058.toml 1.17 KB 1.16s
dist/index.html 228 B 999ms
wasm on the edge?
Interesting to note that Web Assembly isn’t just for client-side browser code. WebAssembly on Cloudflare Workers creates potential for new edge capabilities.
I’m just scratching the surface as I learn Rust. My practical applications range from native client and server code, command-line tools along with my early Web app experiments. I don’t expect Rust to be my goto language for everything, but it’s fun to dive in and explore as I climb the steep learning curve of getting my code to reliably compile!
For people ahead of me on your Rust adventures, what essential tools am I missing?