LLVM is a compiler infrastructure project that revolutionized how compilers are built. Started by Chris Lattner, it provides reusable components for creating language compilers, enabling new programming languages to leverage sophisticated optimizations.
Origins
Lattner started LLVM as a research project at the University of Illinois. The name originally stood for “Low Level Virtual Machine,” though the project grew beyond that scope.
Key Innovation
LLVM introduced modular compiler architecture:
- Intermediate Representation (IR): Common format between languages and targets
- Reusable passes: Optimization and analysis modules
- Target-independent: Same optimizations work across architectures
- Library-based: Use only what you need
Impact on Languages
LLVM enabled a proliferation of new languages:
- Rust: Uses LLVM for code generation
- Swift: Built on LLVM from the start
- Julia: Scientific computing language
- Kotlin/Native: Native compilation via LLVM
Clang
Clang, LLVM’s C/C++ frontend, became a major compiler:
- Faster compilation than GCC
- Better error messages
- Used by Apple, Google, and others
- Foundation for code analysis tools