I am glad that you are excited about the project. It's very retro, kinda like 8-bit video games meets GUI apps meets the terminal 😊.
Rust is a really good programming language (it's not perfect). I think there will be a solid future for it. Its biggest selling point is memory safety (vs C/C++) and performance (comparable to C/C++). So it's a systems level language that kind of looks like JS 😃. It was made by Mozilla so the connection to the web & browsers & JS is very much there.
- Install Rust
- Install VSCode
- Vscode + Rust analyzer
- 💡 When you simply open the
r3bl_rs_utils
repo in VSCode it will ask you to install some extensions that are recommended. Please do this as it will make your development experience much nicer!
If you'd like to take a look at Rust, here are some great starting points.
- Rust book (experimental & enhanced version of the Rust book)
- Rustlings: You can go the JetBrains IDE route or terminal based
- JT video playlists
- Videos: Rust language basics YT playlist w/ JT 4 videos
- Videos: Creating a line editor in Rust w/ JT playlist (watching the first video or two is good to get a handle on crossterm, and the rest can be skipped)
- Memory layout
- Tracing
- Traits
- Dependency injection and unit testing
- Releasing Rust projects
- Video: R3BL TUI architecture deep dive - with redux
- Video: R3BL TUI architecture deep dive - dropping redux
- Video: R3BL TUI flamegraph profiling
Here's a history of TTY and how it all got started back in the day, to what it is today in Linux.
Here are some great videos to understand process, exec, fork, and wait
- Creating new processes with fork
- Sending and handling signals for IPC
- Understanding zombie processes
- How to prevent child processes from becoming zombies
Here is the source file for this drawing: excalidraw diagram.
Here are some great YT video playlists to learn Rust & Text User Interface (TUI) concepts.
- Working w/ Text User Interfaces intro
- Simple layout management for Text User Interfaces
- Deep dive into Unix shells, ptys, etc (the raw underlying OS functions that we use to generate TUIs)
- POSIX
- PTTY
- ANSI:
- YT video playlist on Crust of Rust
- https://developerlife.com/2022/03/02/rust-grep-cli-app/
- Build a command line interface application “grep” and use this tutorial to get started.
- We can work on this application over the time of your internship and make it “real” and add lots
of features to it that the real “grep” program has today. These include:
- Command line arguments using the clap Rust crate.
- Implementing the ability to support unix “pipes”, eg: “ls | grep foo”
- https://github.com/r3bl-org/address-book-with-redux-tui
- This is a pedagogical example to help you understand Rust memory management and mutation along w/ Redux.
- You can even work on implementing a TUI interface on top of this after you get comfortable with it to get a handle on the TUI library itself.
- https://doc.rust-lang.org/stable/book/ch00-00-introduction.html
- This is the Rust book that can be a handy reference on your journey of learning Rust.
- https://github.com/nazmulidris/rust-scratch
- This repo is a collection of cargo crate projects which are just pedagogical exercises in exploring specific features, crates, or patterns in Rust (eg: syntax highlighting, tokio, or typesafe-builder-pattern)
Small crate to learn about Rust, testing, and ANSI:
Small crate to learn about text user interfaces, more Rust, and crossterm:
Large crate to work w/ TUI:
- https://github.com/r3bl-org/r3bl_rs_utils/tree/main/tui#run-the-demo-locally
- Follow the instructions here to get the repo cloned on your computer.
- Install nu shell using
cargo install nu
so that you can run the.nu
scripts in the repo.
- Go through the demos and make sure you run them.
- Go through the README and let me know if things are missing or if they need better explanations. Here are some issues to take a look at: