Runtimes

What happens underneath my program?
Follow the machinery.

Follow source into execution, meet the machine and operating system, inspect memory and evaluation, and understand the machinery that schedules your code.

Work in progress. 3 of 49 lessons are drafted and open to read; they're still being reviewed.

Useful foundations: values, function calls, scope, types, and errors. Revisit those lessons whenever a runtime detail needs context.

49 topics

Still being written 3 of 49 lessons are drafted and open to read while they're reviewed. Planned topics show where the catalog is going.

The machine underneath

Start here

Meet the hardware your program eventually runs on, without needing to build it.

Concept planned

Booleans and logic gates

Build AND, OR, NOT, and XOR truth tables, then connect boolean expressions to the idea of a logic gate.

TypeScriptGoRustCHaskellJava
Concept planned

Instructions, registers, and the CPU

What does a processor actually do? Follow fetch, decode, and execute, and the small set of operations everything reduces to.

TypeScriptGoRustCHaskellJava
Concept planned

Registers, caches, and main memory

Why is some memory faster than other memory? Compare the levels between a register and main memory, and what a cache miss costs.

TypeScriptGoRustCHaskellJava
Concept planned

Reading a little assembly

What did the compiler turn this function into? Read a short listing and match it back to the source, without memorizing an instruction set.

CGoRust

Building and loading a program

Build understanding

Follow dependencies, build inputs, and initialization before examining the generated program.

Concept planned

Build commands and dependency resolution

What inputs does the toolchain need? Follow tsc, go, Cargo, a C compiler and linker, Cabal, and javac.

TypeScriptGoRustCHaskellJava
Concept planned

Imports, dependencies, and initialization

What happens when a dependency is loaded? Compare dependency graphs, cycles, and initialization rules.

TypeScriptGoRustCHaskellJava
Concept planned

Versions, lockfiles, and reproducible builds

Why does the same project build differently on another machine? Follow version ranges, lockfiles, and pinned toolchains.

TypeScriptGoRustCHaskellJava

Your program and the operating system

Build understanding

Follow what a running program asks the operating system for: memory, files, input, output, and an exit.

Concept planned

Processes and address spaces

What is a running program to the operating system? Follow a process, its own view of memory, and what separates it from others.

TypeScriptGoRustCHaskellJava
Concept planned

Arguments, environment, and process startup

What exists before main runs? Follow how arguments and environment variables reach a program, and what each runtime sets up first.

TypeScriptGoRustCHaskellJava
Concept planned

System calls and the kernel boundary

How does a program ask the operating system to do something? Trace a library call down to a system call.

TypeScriptGoRustCHaskellJava
Concept planned

File descriptors and handles

What does an open file look like from inside a program? Follow descriptors, standard streams, and closing what you open.

TypeScriptGoRustCHaskellJava
Concept planned

Virtual memory and the allocator

Where does heap memory come from? Follow pages from the operating system through the allocator to the value you created.

TypeScriptGoRustCHaskellJava
Concept planned

Signals, exit status, and termination

How does a program end, and who finds out? Follow exit codes, signals such as SIGINT and SIGTERM, and cleanup that may not run.

TypeScriptGoRustCHaskellJava

Memory, references, and layout

Go underneath

Connect language behavior to storage while keeping conceptual diagrams distinct from measured layouts.

Concept planned

Addresses and storage

What is a memory address, and when does a language let you work with one? Compare physical storage with a diagram of bindings.

TypeScriptGoRustCHaskellJava
Concept planned

Size, alignment, and padding

Why can a record occupy more bytes than its fields add up to? Inspect a concrete layout and name its assumptions.

CGoRustJava
Concept planned

Endianness and byte order

How is a multi-byte number arranged? Compare memory inspection with a portable serialized representation.

TypeScriptGoRustCHaskellJava
Concept planned

Escape analysis and allocation

Does returning a value or creating an object imply a heap allocation? Explore what an implementation can prove and optimize.

GoJavaTypeScript
Concept planned

Locality, indirection, and caches

Why can two ways of storing the same data have different costs? Follow contiguous access and pointer chasing.

TypeScriptGoRustCHaskellJava
Haskell planned

Haskell thunks, sharing, and retained values

What can a delayed computation keep alive? Inspect a named implementation instead of assuming a mutable variable slot.

Haskell

Evaluation, retention, and reclamation

Go underneath

Distinguish when work happens, why data stays reachable, and how storage becomes eligible for reclamation.

Concept planned

Leaks in garbage-collected programs

How can memory grow when a collector is running? Find caches, listeners, and closures that keep values reachable.

TypeScriptGoHaskellJava
Haskell planned

Folds, strictness, and space leaks

When can a retained expression grow instead of being evaluated? Compare folds, strict accumulation, and retained data.

Haskell
Java planned

JVM heap generations and collectors

Why do most objects die young, and what does a collector do about it? Compare generations, pauses, and collector choices.

Java

Time, concurrency, and shared state

Go underneath

Reason about more than one activity after calls, mutation, lifetime, and failure are familiar.

Concept planned

Concurrency and parallelism

Can tasks overlap without running simultaneously? Separate task structure, scheduling, and multiple execution resources.

TypeScriptGoRustCHaskellJava
Concept planned

Threads, tasks, and goroutines

Who schedules each unit of work? Compare runtime tasks with operating-system threads.

TypeScriptGoHaskellRustJava
Concept planned

Promises, futures, and async/await

How do asynchronous results represent completion and suspension? Compare promises, futures, and languages with async/await; Java has futures without built-in await syntax.

TypeScriptRustJava
TypeScript planned

The event loop and queued work

When does a callback or promise continuation run? Trace queued work and compare runtime-specific scheduling rules.

TypeScript
Concept planned

Data races and synchronization

Which interleaving changes the result? Compare locks, atomics, and the visibility guarantees of a memory model.

TypeScriptGoRustCHaskellJava
Concept planned

Channels and message passing

Who owns data as it travels between tasks? Compare queues, channels, shared memory, and bounded capacity.

GoHaskellRustJava
Concept planned

Cancellation, deadlocks, and task lifetime

What happens when work must stop or two tasks wait on each other? Follow cancellation, cleanup, and waiting dependencies.

TypeScriptGoRustCHaskellJava
TypeScript planned

Workers and parallelism in JavaScript

How does single-threaded JavaScript use several cores? Follow workers, message copying, and shared memory.

TypeScript
Go planned

Go select, sync, and context

How do goroutines wait, coordinate, and stop? Follow select, WaitGroup, Mutex, and cancellation through context.

Go
Rust planned

Rust Send, Sync, and thread boundaries

Which values can cross threads, and which references can be shared? Connect type guarantees to synchronization.

Rust
C planned

C threads, mutexes, and atomics

What does C give you for concurrency, and what is left to you? Follow pthreads or C11 threads, mutexes, and atomic operations.

C
Haskell planned

Haskell threads, MVar, and STM

How do threads coordinate through a shared runtime? Compare synchronized cells with composable memory transactions.

Haskell
Java planned

Java threads, executors, and virtual threads

How does Java run work concurrently? Compare platform threads, executor pools, and virtual threads.

Java

Compilers, virtual machines, and runtimes

Go underneath

Bring the pieces together: how language rules become executable work, and what the runtime supplies.

Concept planned

Parsing, syntax trees, and intermediate forms

How does source text become something a tool can analyze? Follow tokens, an AST, and an intermediate representation.

TypeScriptGoRustCHaskellJava
Concept planned

How a type checker works

What does the compiler do with your types? Follow checking and inference over a small syntax tree.

TypeScriptGoRustCHaskellJava
Concept planned

Compilation and interpretation

What is translated, and what is executed? Compare strategies without treating compiled and interpreted as exclusive language categories.

TypeScriptGoRustCHaskellJava
Concept planned

Linking, loading, and modules

How are separately built pieces connected? Compare symbols, libraries, imports, and loading a program.

TypeScriptGoRustCHaskellJava
Concept planned

Optimization, AOT, and JIT

Why might the machine do less work than the source suggests? Explore ahead-of-time compilation, hot paths, and preserving observable behavior.

TypeScriptGoRustCHaskellJava
TypeScript planned

TypeScript checking and JavaScript execution

Which parts of TypeScript survive into JavaScript? Follow erased types, emitted code, and the separate JavaScript runtime.

TypeScript
Go planned

Go runtime services and scheduling

What remains at runtime in a compiled program? Follow goroutine scheduling, stack growth, and garbage collection.

Go
Rust planned

Rust monomorphization and trait dispatch

How does a generic operation become executable code? Compare concrete instantiations with dynamic trait dispatch.

Rust
C planned

C preprocessing, translation units, and ABI

How does a declaration become a linked call? Separate preprocessing, compilation, symbol resolution, and platform calling conventions.

C
Haskell planned

GHC, thunks, and the runtime system

How does GHC turn Haskell into executable code? Explore delayed computations, garbage collection, and runtime services without confusing them with language guarantees.

Haskell
Java planned

Bytecode and the JVM

What sits between Java source and machine execution? Explore class files, loading, verification, and runtime services.

Java