-
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.
-
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.