paulgorman.org

Rust

Rust is a new programming language from Mozilla. It's a compiled language suitable for writing operating systems and device drivers, but it's also a very safe language.

The free e-book The Rust Programming Language is very good.

Install Rust:

$ curl -sf -L https://static.rust-lang.org/rustup.sh | sh

This installs to /usr/local. It will prompt you for a sudo password if necessary. I believe the rustup.sh shell script is also the way to update Rust. To uninstall: sudo /usr/local/lib/rustlib/uninstall.sh.

Hello, world!

Edit main.rs:

fn main() {
    println!("Hello, world!");
}

Compile with: rustc main.rs

Cargo

Cargo is a Rust utility that handles a number of things, including building projects and package management. You create a sort of makefile named Cargo.toml in the root of your project, and do cargo build (or cargo run, which builds and runs the binary). For a new project, Cargo will also create a new skeleton of directories and files with cargo new hello_world --bin.

Links