Languages
Rust
Installing Rust and Cargo on Ubuntu in TIDE using rustup
Rust
Rust is a systems programming language that focuses on performance, type safety, and memory safety without needing a garbage collector.
Installation
Rust is installed and managed via rustup, the official Rust toolchain installer.
Step 1: Install Build Dependencies
Rust requires standard C compiler tools for building native dependencies:
sudo apt update
sudo apt install -y build-essential curl gccStep 2: Run Rustup Installer
Download and execute the official rustup setup script:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -yStep 3: Configure Environment
Configure your current shell environment:
source "$HOME/.cargo/env"To make this permanent, ensure $HOME/.cargo/env is sourced in your ~/.bashrc file.
Verification
Verify that rustc (compiler) and cargo (package manager) are available:
rustc --version
cargo --versionRunning Code
Option 1: Direct Compilation with rustc
Create a file named main.rs:
fn main() {
println!("Hello, TIDE!");
}Compile and run:
rustc main.rs
./mainOption 2: Managing Projects with cargo
Create a new Cargo project:
cargo new hello_tide
cd hello_tide
cargo run