Hello world

July 20, 2022

First post for my new blog

Rust up

$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
info: downloading installer

Welcome to Rust!

This will download and install the official compiler for the Rust
programming language, and its package manager, Cargo.


Current installation options:

   default host triple: aarch64-apple-darwin
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
> 1

Rust is installed now. Great!

To get started you may need to restart your current shell.
This would reload your PATH environment variable to include
Cargo's bin directory ($HOME/.cargo/bin).

To configure your current shell, run:
source "$HOME/.cargo/env

Hello world

$ cargo new hello
     Created binary (application) `hello` package
$ cd hello
$ cargo run
   Compiling hello v0.1.0 (/Users/sakti/dev/hello)
    Finished dev [unoptimized + debuginfo] target(s) in 0.56s
     Running `target/debug/hello`
Hello, world!
$ cat src/main.rs
fn main() {
    println!("Hello, world!");

Return to blog