Skip to main content

Articles

Technical articles archive

Explore structured guides on computer architecture, operating systems, systems programming, Python data science, Rust and quantitative finance.

Articles
49
Series
7
Topics
16

All articles

Illustrated compiler pipeline showing source code passing through analysis and code-generation stages before becoming machine code.

Chapter 7 · Programming

How to Build a Compiler Backend in C++: x86-64 Generation

Build a compiler backend in C++ that translates checked IR into x86-64 NASM assembly with stack frames, arithmetic operations and native Linux executables.

36 min Intermediate

Illustrated compiler pipeline showing source code passing through analysis and code-generation stages before becoming machine code.

Chapter 6 · Programming

How to Build a Compiler IR in C++: Three-Address Code

Build an intermediate representation in C++. Lower a checked AST into three-address-style instructions with temporaries, variables, basic blocks, branches, loops and function calls.

38 min Intermediate

Illustrated compiler pipeline showing source code passing through analysis and code-generation stages before becoming machine code.

Chapter 2 · Programming

How to Design a Programming Language from Scratch

Design a small statically typed C-style programming language from scratch, including its syntax, types and grammar, then build its compiler in C++ with CMake and Docker.

7 min Intermediate

Illustrated compiler pipeline showing source code passing through analysis and code-generation stages before becoming machine code.

Chapter 1 · Programming

How a Compiler Works: From Source Code to Machine Code

Learn how a compiler transforms source code into machine code through lexing, parsing, semantic analysis, IR, optimisation and x86-64 code generation.

18 min Intermediate

Diagram of a shell REPL loop reading from the UART, parsing, executing built-in commands and printing back to the terminal

Chapter 13 · Operating Systems

Writing a Shell in C: A REPL Over the UART

Give PurgatoryOS a prompt. Add uart_getc and a line-discipline buffer, parse commands on top of Post 12's ramdisk, dispatch built-ins (ls, cat, echo, cd, pwd, help, clear), and load /bin/hello as a flat binary at a fixed address. This is the payoff post, where readers finally type into their own kernel.

49 min Intermediate

Diagram of a ramdisk filesystem tree with bin, docs and README nodes backed by a file table stored in the kernel heap

Chapter 12 · Operating Systems

Build a Simple Filesystem: Turning the Heap Into a Ramdisk

Build an in-memory tree filesystem for PurgatoryOS in no_std Rust using Box<Node>, BTreeMap<String, NodeId>, and Vec<u8> on top of Post 11's allocator. Add three new syscalls (open, read, close), a per-task file descriptor table, and a working VFS layer that the shell in Post 13 can type against.

35 min Intermediate