/rust-playground

Learning experiments with Rust 🦀

Primary LanguageRust

rust-playground

Trying out this Rust thing... let's see how it goes 🦀

book/

Notes on the book "The Rust Programming Language", together with code examples.

.
│
├── ch02-guessing-game/...
├── ch03-fibonacci/...
├── ch08-mean-median-mode/...
├── ch08-pig-latin/...
├── ch12-grep/...
├── ch14-add/...
├── ch14-art/...
├── ch15-cons-list/...
├── ch15-mock-object/...
├── ch15-weak-ref-tree/...
├── ch16-concurrency/...
├── ch17-blog/...
├── ch17-gui/...
├── ch19-hello-macro/...
├── ch19-pancakes/...
├── ch20-hello/...
│
└── notes.md            # complete book notes

clair/

Really simple command line app example, from the Rust CLI working group's book "Command Line Applications in Rust" (CLAiR).

.
└── grrs/               # super small grep clone ("grass")
    ├── src/
    │   ├── lib.rs      # find patterns in string content
    │   └── main.rs     # command line interface
    ├── tests/
    │   └── cli.rs      # integration tests
    └── Cargo.toml

crust/

Coding along Jon Gjengset's "Crust of Rust" video series.

.
├── strsplit/
│   └── src/lib.rs      # "Crust of Rust: Lifetime Annotations"
│
├── vecmac/
│   └── src/lib.rs      # "Crust of Rust: Declarative Macros"
│
├── iterators/
│   └── src/lib.rs      # "Crust of Rust: Iterators"
│
├── pointers/
│   └── src/            # "Crust of Rust: Smart Pointers and Interior Mutability"
│       ├── lib.rs
│       ├── cell.rs     # a mutable memory location
│       ├── refcell.rs  # a mutable memory location with dynamically checked borrow rules
│       └── rc.rs       # a single-threaded reference-counting pointer
│
├── panama/
│   └── src/lib.rs      # "Crust of Rust: Channels"
│
├── orst/
│   └── src/            # "Crust of Rust: Sorting Algorithms"
│       ├── lib.rs
│       ├── bubblesort.rs
│       ├── insertionsort.rs
│       ├── selectionsort.rs
│       ├── quicksort.rs
│       └── bin/
│           └── bench.rs
│
├── strtok/
|   └── src/lib.rs      # "Crust of Rust: Subtyping and Variance"
│
├── boks/
│   └── src/main.rs     # "Crust of Rust: The Drop Check"
│
└── atomics/
    └── src/main.rs     # "Crust of Rust: Atomics and Memory Ordering"

learn-wgpu/

Following the "Learn Wgpu" guide on using gfx-rs's wgpu library.

.
├── src/
│   ├── main.rs         # main code, interacts with the core objects of WebGPU
│   ├── texture.rs      # creation of textures from images and of depth textures
│   └── shader.wgsl     # shader code, written in WGSL (WebGPU Shading Language)
└── Cargo.toml

lrtdw/

Following Cliff L. Biffle's unsafe-first approach to "Learn Rust the Dangerous Way" (LRtDW) series of articles.

.
├── nbody-c/
│   └── main.c          # reference C code, unchanged
│
├── nbody-rs/
│   ├── src/
│   │   └── main.rs     # Rust code, following LRtDW
│   └── Cargo.toml
│
â”” make.py               # build script

lrwetmll/

Following "Learn Rust With Entirely Too Many Linked Lists" chapters.

.
└── lists/
    ├── src/
    │   ├── first.rs    # ch. 2, a bad singly-linked stack
    │   ├── second.rs   # ch. 3, an ok singly-linked stack
    │   ├── third.rs    # ch. 4, a persistent singly-linked stack
    │   ├── fourth.rs   # ch. 5, a bad but safe doubly-linked deque
    │   ├── fifth.rs    # ch. 6, an unsafe singly-linked queue
    │   └── lib.rs
    └── Cargo.toml

rusty-journal/

Implementation of Microsoft Learn's "Build a command-line to-do list program" module.

.
├── src/
│   ├── cli.rs          # command-line interface using structopt
│   └── main.rs
│   └── tasks.rs        # add, complete and list tasks using serde
└── Cargo.toml

wasm/

Implementation of Conway's Game of Life, following the Rust and WebAssembly working group's "Rust Wasm Book".

.
└── game-of-life/
    ├── src/            # Rust code with Wasm bindings
    │   ├── lib.rs
    │   └── utils.rs
    ├── www/            # JavaScript code using the generated WebAssembly
    │   ├── index.js
    │   ├── index.html
    │   ├── bootstrap.js
    │   ├── package.json
    │   └── webpack.config.js
    └── Cargo.toml