WeCodeAcademy

Rust Introduction

Rust is a systems language that is as fast as C and C++ but prevents whole classes of bugs, like using memory after it is freed, at compile time. It is used for browsers, operating systems, game engines and command line tools.

ExampleRust
fn main() {
    println!("Hello, World!");
}
Output
Hello, World!

fn main is where the program starts. println! is a macro (note the !) that prints a line. To try an example, save it as main.rs and run rustc main.rs && ./main, or use cargo run in a project. The output under each example is the real output.

Quick check

What does the ! in println! tell you?

Finish the quick check (and any code exercise) to complete this lesson, or mark it done yourself.

Tip: use the left and right arrow keys to move between lessons.