An introduction into Rust. Part 2: Building and Running, Creating a Package, Numerical Operations

applied.math.coding
3 min readJan 7, 2022

Welcome back to the follow-up of the introduction into Rust! This post is all about to get your first Rust program built and executed.

You can follow the code examples on your local machine by ensuring Rust has been successfully installed as described in the previous post.

Running the first program:

Running the first code in Rust can be as easy as just going to this website: https://play.rust-lang.org/. This is Rust’s playground that lets you quickly check out short code snippets.

In order to compile and run Rust code locally, you already have installed everything necessary if you followed the section ‘Installation’.

  1. create some folder: mkdir my-first-rust
  2. cd my-first-rust
  3. add a file named main.rs
  4. add the following content to main.rs:
fn main() {
println!("Hello, world!");
}

--

--

applied.math.coding

I am a Software Developer - Java, Rust, SQL, TypeScript - with strong interest doing research in pure and applied Mathematics.