Around all of it

Compiler Infrastructure

LLVM as reusable middle-end and code generator rather than "a compiler", GCC as the other one, and WebAssembly as a portable sandboxed target.

What LLVM Actually Is

LLVM is compiler infrastructure: a collection of reusable libraries built around well-specified intermediate representations, with analyses, optimizations and code generators you link into your own program. Clang is one of its clients, not the thing itself.

Q · People keep saying "LLVM" as though it were one program — what is it actually?
The Three-Phase Architecture

Language frontend, shared middle-end, target backend — with one intermediate representation at each seam. That factoring turns M languages times N targets into M frontends plus N backends, and it is the reason a new language gets twelve architectures on its first release.

Q · Why is a shared intermediate representation such a big deal architecturally?
Reading LLVM IR
▶ lab

LLVM IR is a typed, SSA-form instruction set that is readable by humans and has three isomorphic forms — text, bitcode and in-memory. Learning to read it turns "the optimizer did something" into a diff you can point at.

Q · What does LLVM IR actually look like, and what do I need to know to read it?
Clang

Clang is a C, C++ and Objective-C frontend that lowers to LLVM IR — and, unusually, a library whose AST is a supported product in its own right. That second decision is why clang-format, clang-tidy and clangd exist and why they agree with the compiler.

Q · What does Clang do that LLVM does not, and why is so much C++ tooling built on it?
GCC

The other mature toolchain, and a genuinely different architecture: GENERIC, then GIMPLE, then RTL, then a target. Three successive intermediate representations where LLVM has one, an extension model based on plugins rather than libraries, and a different licence history.

Q · How does GCC differ from LLVM architecturally, without either of us picking a side?
What a Toolchain Actually Contains

Compiler, assembler, linker, loader, debugger and build system are six related but distinct programs with different inputs, different outputs and different failure messages. Knowing which one spoke is most of diagnosing a build.

Q · When my build breaks, which program actually produced this error?
WebAssembly as a Compilation Target

WebAssembly is a target a compiler aims at instead of a machine: source language, compiler, a `.wasm` module, and a runtime that validates it and then executes it — by interpreting, by compiling it on load, or by compiling it ahead of time.

Q · What actually happens between my C or Rust source and code running as WebAssembly?
The WebAssembly Execution Model

A stack machine with structured control flow, one linear memory, no ambient authority and a validation pass that succeeds or fails in one sweep. Every one of those choices exists so a host can prove things about code it did not write.

Q · What does the WebAssembly machine actually look like, and why is it shaped like that?
WebAssembly Versus Native

One artifact everywhere, a sandbox by construction and microsecond startup, against a measurable performance gap with structural causes: bounds-checked linear memory, no direct system calls, and a feature surface that depends on which proposals the host implements.

Q · Should I ship this as WebAssembly or as a native binary, and what am I actually giving up?