Rust content

    • Build with Naz : Rust lifetimes

      Rust lifetimes are key part of the type system which allows the Rust compiler to make its memory safety guarantees. We will explore subtyping, variance, references, memory aliasing, splitting borrows, and clone on write in this article, its video, and repo.
    • Build with Naz : Explore Linux TTY, process, signals w/ Rust

      This article, along with related videos and the repository, explores Linux TTY, shells, processes, sessions, jobs, PTYs, signals, and more using Rust. It explains /dev/tty and describes how terminal libraries like crossterm and termion build on top of stdio and /dev/tty. The article provides examples of using Rust to send and receive POSIX signals, communicate with processes via IPC, and spawn processes. Additionally, it includes examples of using PTY in Linux and controlling external commands (such as binaries like bash) using asynchronous Rust.
    • Build with Naz : Box and Pin exploration in Rust

      This tutorial, video, and repo are a deep dive into Rust `Pin` and `Box` types, along with concepts of ownership and borrowing. We will also cover a lot of background information on the concepts of operating system process, memory allocation and access, stack, and heap. The examples we create are designed to demonstrate the different semantics around the use of boxes and pinned boxes in Rust.
    • Build with Naz : Rust async in practice tokio::select!, actor pattern & cancel safety

      This tutorial, video, and repo are a deep dive into the concept of cancellation safety in async code using Tokio and Rust. It affects the `tokio::select!` macro, and what happens to the racing `Future`s that don't win. The examples provided here, along with the video, will go over both code that is is cancellation safe and code that is not. These examples reflect real-world patterns, and are a generalized form of them.
    • Build with Naz : Ubuntu 24.04 setup and config for dev productivity

      I've provided scripts for setting up a new Ubuntu 24.04 desktop machine. They have been tested on a fresh install of Ubuntu 24.04 LTS. They contain all the software that is needed for Rust development, OBS Studio use, and general developer productivity. They are highly opinionated for my use case, but you can modify them to suit your needs.
    • Build with Naz : Markdown parser in Rust and nom from r3bl_tui

      This tutorial and video are a deep dive in a real Markdown parser written using nom in Rust. This MD Parser is part of the r3bl_tui crate, which is part of the r3bl-open-core repo. It goes over the architecture of thinking about building complex parsers and the nitty gritty details the runtime nature and behavior when combining nom parsers.
    • Build with Naz : Rust error handling with miette

      miette is an excellent crate that can make error handling in Rust powerful, flexible, and easy to use. It provides a way to create custom error types, add context to errors, and display errors in a user-friendly way. In this article, video, and repo, we'll explore how to use miette to improve error handling in your Rust applications.
    • Build with Naz : Rust typestate pattern

      The Typestate Pattern in Rust is a way to manage objects that go through different states in their lifecycle. It leverages Rust's powerful type system to enforce these states and transitions between them, making your code safer and more predictable. Learn all about it in this article, its video, and repo.
    • Build with Naz : Linux io_uring and tokio-uring exploration with Rust

      Explore the Linux io_uring syscall with the tokio-uring crate in Rust. This article, video, and repo will show you how to use the tokio-uring do async file IO at the OS level, and how to use it to build a simple echo TCP server, for use with netcat.
    • Build with Naz : Rust async, non-blocking, concurrent, parallel, event loops, graceful shutdown

      In this article, video, and repo learn effective async Rust using real world patterns that show up consistently when creating non blocking, async, event loops, using channels. Delve into implementing the Future trait and async executor manually. Also explore graceful shutdown, when not to use async, and how to think about testing async code.
    • Build with Naz : tokio tracing & OTel and how to use it in Rust

      In this article, video, and repo learn how to use tokio tracing and OpenTelemetry (with Jaeger) in async Rust to instrument your code and collect telemetry data for observability.
    • Build with Naz : Rust Polymorphism, dyn, impl, using existing traits, trait objects for testing and extensibility

      Learn how to implement effective Rust polymorphism, using `dyn`, `impl`, existing traits, and trait objects for testing and extensibility, in real world projects.
    • Build with Naz : Build interactive and non blocking CLI apps with ease in Rust using r3bl_terminal_async

      The r3bl_terminal_async library lets your CLI program be asynchronous and interactive without blocking the main thread. Your spawned tasks can use it to concurrently write to the display output, pause and resume it. You can also display of colorful animated spinners ⌛🌈 for long running tasks. With it, you can create beautiful, powerful, and interactive REPLs (read execute print loops) with ease.
    • Write a simple netcat client and server in Rust

      A guide on how to a simple Rust netcat client and server
    • Write a simple TCP chat server in Rust

      A guide on how to create write a simple TCP chat server in Rust using Tokio
    • tuify your clap CLI apps and make them more interactive

      A guide on how to add minimal interactivity to your clap CLI apps using tuify. It doesn't have to be an all or nothing approach w/ going full TUI or CLI.
    • Use just to manage project specific commands

      A guide on how to create just files (which are like make files) to manage project specific commands. In a cross platform way.
    • Build with Naz : Comprehensive guide to nom parsing

      This tutorial and video are a comprehensive guide to parsing with nom. We cover the basics of parsing and how to use nom to parse a string into a data structure. And more complex topics like human readable error reporting, and building up complex parsers. We will create a variety of different examples ranging from parsing simple CSS like syntax to a full blown Markdown parser.
    • Create a simple DSL for CSS like syntax for TUIs

      Procedural macros are a way for you to extend the Rust compiler and provide plugins that you can use to extend the language. They allow to create your own DSL (domain specific language). This article goes into the details of creating a simple DSL to mimic CSS syntax but in Rust, for a TUI app framework.
    • Guide to Rust procedural macros

      Procedural macros are a way for you to extend the Rust compiler and provide plugins that you can use to extend the language. They allow you to reduce the need to write manual boilerplate code, and even allow you to create your own DSL (domain specific language). This article goes into the details of creating the 3 kinds of procedural macros in Rust.
    • Write a Redux library in Rust

      This article illustrates how we can build a Redux library in Rust. This library is thread safe and asynchronous (using Tokio). The middleware and subscribers will be run in parallel. But the reducer functions will be run in sequence.
    • Write code using async/await in Rust

      This article illustrates how to write concurrent and parallel code in Rust using Tokio. The pedagogical example we will use is building an asynchronous implementation of a middleware runner that you might find in a Redux store.
    • Build a grep CLI app in Rust

      This article illustrates how we can build a CLI app in Rust that is a very basic implementation of grep. This app will have 2 modes of operation: piping lines in from `stdin` and searching them, and reading a file and searching thru it. The output of the program will be lines that match the search term w/ the term being highlighted. Topics like `stdin` manipulation in a terminal, detecting when the terminal is in `tty` mode vs `piped` mode, doing simple file I/O, creating non consuming builders, and managing `Result`s, along w/ building a simple CLI interface are covered in this article.
    • Build a non-binary tree that is thread safe using Rust

      This article illustrates how we can build a non-binary tree in Rust using various approaches until we end up with a version that is thread safe and supports parallel tree walking as well. Topics like interior mutability, sharing ownership, weak and strong references, custom traits for polymorphic behavior, are covered in this article.

    Subscribe to RSS feed