-
Sep 2, 2024
•
Nazmul Idris
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.
-
Aug 20, 2024
•
Nazmul Idris
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.
-
Jul 16, 2024
•
Nazmul Idris
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.
-
Jul 10, 2024
•
Nazmul Idris
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.
-
Jun 28, 2024
•
Nazmul Idris
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.
-
Jun 10, 2024
•
Nazmul Idris
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.
-
May 28, 2024
•
Nazmul Idris
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.
-
May 25, 2024
•
Nazmul Idris
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.
-
May 19, 2024
•
Nazmul Idris
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.
-
May 15, 2024
•
Nazmul Idris
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.
-
Apr 28, 2024
•
Nazmul Idris
Learn how to implement effective Rust polymorphism, using `dyn`, `impl`, existing traits, and trait objects for
testing and extensibility, in real world projects.
-
Apr 21, 2024
•
Nazmul Idris
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.
-
Jan 13, 2024
•
Nazmul Idris
A guide on how to a simple Rust netcat client and server
-
Jan 13, 2024
•
Nazmul Idris
A guide on how to create write a simple TCP chat server in Rust
using Tokio
-
Sep 22, 2023
•
Nazmul Idris
A visual guide on how to understand git merge conflict messages
and resolve them with confidence.
-
Sep 17, 2023
•
Nazmul Idris
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.
-
Aug 28, 2023
•
Nazmul Idris
A guide on how to create just files (which are like make files)
to manage project specific commands. In a cross platform way.
-
Feb 20, 2023
•
Nazmul Idris
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.
-
Aug 4, 2022
•
Nazmul Idris
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.
-
Mar 12, 2022
•
Nazmul Idris
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.
-
Mar 12, 2022
•
Nazmul Idris
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.
-
Mar 2, 2022
•
Nazmul Idris
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.
-
Feb 24, 2022
•
Nazmul Idris
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.
-
Nov 25, 2021
•
Nazmul Idris
This article is reference handbook for using Ink v3.2.0 (with TypeScript and React) components
to create CLI apps.
IDEA Ultimate / Webstorm project files are provided.
-
Nov 5, 2021
•
Nazmul Idris
This article is an advanced guide to using Ink v3.2.0 (with TypeScript and React) to create CLI apps.
IDEA Ultimate / Webstorm project files are provided.
-
Nov 4, 2021
•
Nazmul Idris
This article is an introduction to using Ink v3.2.0 (with TypeScript and React) to create CLI apps.
IDEA Ultimate / Webstorm project files are provided.