M

Building Monk Lang

The Learning Journey

8 units | 35 lessons

Build a programming language from scratch.

You'll go from zero to a working compiler that produces native binaries. Along the way, you'll learn compiler design, C, and how programming languages actually work.

Source
.monk
Lexer
tokens
Parser
AST
Checker
typed AST
Codegen
.c file
Binary
native
Coming Up Built as each phase is completed
8

C FFI

Calling C from Monk. Linking external libraries.

9

Linter & Formatter

monk fmt, monk lint. Code style and static analysis tooling.

10

LSP & Editor Support

Language server protocol. VS Code extension. Syntax highlighting.

11

Distribution

Homebrew, installers, cross-compilation. Shipping the compiler.

What you need before starting

Any programming language

TypeScript, Python, Go, Java. You know variables, functions, loops.

Terminal basics

You can run commands, navigate directories, use git.

C knowledge

Not needed upfront. Taught in Phase 3 (runtime) and Phase 4 (codegen).

The stack you'll build

Compiler
Written in Go
Lexer + Parser + Type Checker
Generates C source code
Runtime
Small C library (~2-5 KB)
Built-in functions
Value types, error handling
Output
Native binary
Zero runtime dependencies
Compiled via system cc