//derryspann.com | a creative sophisticated scientist

Rust lang

download rust using curl

rustc is the compiler for rust which compiles your rust code.

Creating a new project

use cargo init command to create a new project.

This will generate a src directory along with .gitignore and a cargo.toml files.

The cargo.toml file contains a basic hello world example. The example project is built using the cargo run command. The completed output will print status in the console and execute the program. The compiled project is located in the new directory named target.

   Compiling rust_sandbox v0.1.0 (/Users/hyperpro/Dev/Apps/rust_sandbox)
    Finished dev [unoptimized + debuginfo] target(s) in 0.79s
     Running `target/debug/rust_sandbox`
Hello, world!

Build Commands

  • For Development: cargo build
  • For Production: cargo build --release