Compilers
Compiler Explorer is great tool.
Introduction to Compilers and Language Design, Crafting Interpreters, Writing A Compiler In Go, Compiler Writing Journey, Stanford compiler course & Advanced Compilers course are great reads.
Engineering a Compiler & SSA-based Compiler Design seem nice for more in depth study.
Austral has interesting compiler I want to study. Also syn whilst not being a compiler is great study on how to parse a language in Rust.
sccache is interesting compiler cache.
Flattening ASTs (and Other Compiler Data Structures) is great read to understand the relationship between bytecode and AST interpreters.
Notes
- Lessons learned on compiler development: 1. Group functions by AST node, not by pass. 2. Have a formal theory for checking types worked out in advance. 3. Don't dump the metadata for each pass directly into AST nodes.
- When you compile a program into an object binary, it contains references to external symbols. a linker takes all your objects (& any libraries you want to statically link) and creates a combined executable, resolving those references (by rewriting some machine code!) References to dynamic libraries are only resolved when an executable is loaded in memory to be executed, so the operating system's loader also has to modify some machine code.
- Book about compilers written as a playground/notebook/whatever would be really cool, so you can play with live visualizations of the data structures and algorithms involved in type checking and optimization.
- SIMD explained: Imagine you have a loop of 100 iterations. You can also represent it as 4 iterations of outer loop and 25 iterations of inner loop. Vectorization means replacing inner loop with a single statement (instruction). Compilers can automatically do this for you.
Links
- Haskell to WebAssembly
- Awesome compilers
- Compiler Optimization examples
- Compiler Explorer - Run compilers interactively from your web browser and interact with the assembly. (HN) (Code) (HN)
- ShivyC - C compiler created in Python.
- swc - Super-fast TS / JS compiler written in rust. (Docs) (Docs Code)
- swc playground (Code)
- Introduction to Compilers - Swift Playground giving an overview over the inner workings of modern compilers.
- Ccache - Fast compiler cache. (Web) (HN)
- Starlark in Go - The Starlark configuration language, implemented in Go.
- Modern CMake Examples
- sccache - Shared Compilation Cache.
- Compilers: Principles, Techniques, and Tools book (1986)
- Short overview of "C--"
- The C-- Language Specification
- How to become an expert in compilers the long way? (2019)
- So You Want to Be a (Compiler) Wizard (2016) (HN)
- tal - Implementation of Typed Assembly Language (Morrisett, Walker, Crary, Glew).
- microml - Minimal ML, type-inferred, compiled, and/or interpreted in less than 800 lines.
- libffi - Portable foreign-function interface library.
- go2ll - Toy go compiler to LLVM.
- Where does YOUR compiler come from? - Vincent Ambo (2018)
- libFirm - Graph based intermediate representation and backend for optimising compilers.
- BOLT - Binary Optimization and Layout Tool - A linux command-line utility used for optimizing performance of binaries. (HN) (Reddit)
- Propeller - Profile Guided Optimizing Large Scale LLVM-based Relinker.
- Intel(r) SPMD Program Compiler - Compiler for a variant of the C programming language, with extensions for single program, multiple data programming.
- hobbes - Language and an embedded JIT compiler.
- Crafting Interpreters Book (Code) (In Rust) (In OCaml) (In Rust) (In Haskell) (In Rust) (Contents) (HN) (HN) (Review) (HN) (In TS) (HN)
- Compiling a Functional Language Using C++, Part 0 - Intro (2019)
- Compiling at Compile Time (2019)
- MLIR: Multi-Level Intermediate Representation for Compiler Infrastructure - Tatiana Shpeisman, Chris Lattner (2019)
- How an Optimizing Compiler Works (2019)
- A Survey of Compiler Testing (2019)
- Functional Language Research Compiler (FLRC) - Designed to be a general compiler framework for functional languages.
- Compiling pattern matching (2013)
- dino - Compiler / PL Experimentation in Rust.
- Advanced Compilers course (2019)
- GRIN - Compiler back-end for lazy and strict functional languages with whole program optimization support. (Website)
- Compiler Writing Journey (HN)
- Listing of compiler, language and runtime teams for people looking for jobs in this area
- Computer Language Engineering course (2019)
- Dive into Deep Learning Compiler (Code)
- Compiler Auto-Vectorization with Imitation Learning (HN)
- Clang Build Analyzer - Can be useful to figure out what takes time during compilation of one source file.
- CS 6120: Advanced Compilers course (Code)
- A Survey on Compiler Autotuning using Machine Learning (2018)
- Compilers for humans
- Compiler notes
- Adventures of a Haskell compiler - Main goal is to continually level-up a self-hosting Haskell compiler. (Code)
- Compiler Design course by Frank Pfenning (2014)
- HOT Compilation course (2015)
- Compiler Design course (2020)
- CMSC430: Introduction to Compilers (2017)
- Essentials of Compilation: Book about compiling Racket to x86-64 assembly
- Principles of Compiler Design
- Essentials of Interpretation (2019) - Course on implementing an interpreter for a programming language similar to Python or JavaScript, from scratch.
- htcc - Tiny C language compiler (x86-64).
- Termite - Generic distributed compilation system.
- A Simple Graph-Based Intermediate Representation (1995) (HN)
- CS164: Introduction to the design of programming languages course (2019)
- Let's Build a Compiler, by Jack Crenshaw (HN)
- Automatic peephole optimizer for Cranelift JIT compiler
- Let's Build A Simple Interpreter
- Introduction to Static Analysis - An Abstract Interpretation Perspective (2020) (Simple Abstract Interpreter Code)
- Zig cc: A drop-in replacement for GCC/Clang (2020) (HN) (Lobsters) (HN)
- Basics of Compiler Design (2000) (HN) (PDF)
- Modern Compiler Implementation in ML book (1998) (In Rust) (In Haskell)
- Efficient Deconstruction with Typed Pointer Reversal (2019)
- Scripts for building compilers that run anywhere, which build things that run anywhere
- ugdb - Alternative TUI for gdb.
- Writing a Compiler in Rust (2019)
- Trybuild - Test harness for ui tests of compiler diagnostics.
- Secure Delivery of Program Properties through Optimizing Compilation (2020)
- Carpentry Compiler
- Icecream - Distributed compiler with a central scheduler to share build load.
- MIR Project - Light-weight JIT compiler based on MIR (Medium Internal Representation).
- Incremental/query driven compiler architectures
- Speeding up the Sixty compiler (2020)
- A hands-on introduction to static code analysis (2020) (HN)
- Teaching Compilers (2020)
- CReduce - it’s a kind of magic! (2020)
- Compact lexer table representation (2020)
- Reflections on Trusting Trust by Ken Thompson - Creating a version of C compiler that, when presented with the source code for the "login" program, would automatically compile in a backdoor to allow him entry to the system.
- Synthesizing JIT Compilers for In-Kernel DSLs
- Diagrams for Composing Compilers (2020)
- One-pass Compiler Primer (2020) (HN)
- SPARTA - Library of software components specially designed for building high-performance static analyzers based on the theory of Abstract Interpretation.
- Nand2Tetris Hack assembler implemented in Rust (HN)
- Let's make a Teeny Tiny compiler (2020) (HN)
- PPCI - Compiler for ARM, X86, MSP430, xtensa and more implemented in pure Python.
- Awesome JIT
- ELVM - Similar to LLVM but dedicated to Esoteric Languages.
- An Intro to Compilers (2017) - How to Speak to Computers. (HN)
- Query-based compiler architectures (2020) (HN) (Video)
- What every scientific programmer should know about compiler optimizations (2020) (HN)
- Circuit IR Compilers and Tools
- A crash course in just-in-time (JIT) compilers (2017)
- A Deep Introduction to JIT Compilers: JITs are not very Just-in-time (2020) (HN)
- How JIT Compilers are Implemented and Fast: Julia, Pypy, LuaJIT, Graal and More (2020)
- Compilers Resources by Yosh
- The Super Tiny Compiler - Ultra-simplified example of all the major pieces of a modern compiler written in easy to read JavaScript. (In Rust)
- Awesome machine learning for compilers and program optimisation
- Compiler Fuzzing: How Much Does It Matter? (2019)
- SOIL: Single Open Intermediate Language (Lobsters)
- A Quick Introduction to Register Allocation (2020) (Lobsters)
- Effective Function Merging in the SSA Form (2020) (Tweet)
- Compiler Construction - Niklaus Wirth
- Beyond Code: New Signals for Static Analysis (2020)
- HPVM - Heterogeneous Parallel Virtual Machine
- GraalVM - Run Programs Faster Anywhere. (Web) (HN)
- Write your Own Virtual Machine (Code)
- Deep learning for compilers (2020)
- MLIR Tutorial
- Does register selection matter to performance on x86 CPUs? (2020)
- Self hosting compiler (2020)
- Bootstrapping compilers - Building up compilers and interpreters and tools from nothing.
- Linkers go brrrrr (2020)
- Hex Rays - State-of-the-art binary code analysis solutions.
- HexRaysDeob - Hex-Rays microcode API plugin for breaking an obfuscating compiler.
- Compiler notes (focusing on Haskell)
- Minicompiler: Lexing (2020)
- Awesome Symbolic Execution
- Grammar-Based Testing for Little Languages: An Experience Report with Student Compilers (2020)
- Automatic Syntax Error Recovery (2020)
- What to read to learn compilers (RU)
- HN: Best Resources for Compiler Construction (2020)
- Advanced Compilers: The Self-Guided Online Course (2020) (HN) (Web) (HN)
- Advice on how to best approach learning compilers (2020)
- Post-Modern Compiler Design (2019)
- Inline caching (2021)
- Bril: A Compiler Intermediate Representation for Learning (Code)
- Compilers are hard (HN)
- Compiler Video Series
- SymQEMU - Compilation-based symbolic execution for binaries. (Web)
- Compiler Class (2021) (HN)
- Toolchains.net - Collection of toolchain resources.
- Calculating Correct Compilers II: Return of the Register Machines (Code)
- Teaching Compilers Backward (2021) (HN)
- Compiler versus Transpiler: what is a compiler, anyway?
- Inlining and Compiler Optimizations (2021)
- How to write a JIT compiler (HN)
- JitFromScratch - Example project from my talks in the LLVM Social Berlin and C++ User Group.
- Interpreter, Compiler, JIT (2015) (Code)
- A simple program reducer for any language (2021)
- QBE - Compiler Backend
- Resources for Amateur Compiler Writers
- The Golden Age of Compiler Design in an Era of HW/SW Co-Design – Chris Lattner (2021) (HN) (Slides)
- Phism: Polyhedral High-Level Synthesis in MLIR (2021)
- Gibbon - Compiler for functional programs on serialized data. (Web)
- Amsterdam Compiler Kit (Web)
- Awesome Decompilation
- Tiny compiler for a simple synthetic language featuring LL(2) grammar, written in pure C
- The compiler will optimize that away (2021) (HN)
- Machine Learning in Compiler Optimization (2021)
- Noise-Aware Dynamical System Compilation for Analog Devices with Legno (2020)
- yair - High-level compiler IR entirely written in Rust.
- Tiramisu - Compiler for expressing fast and portable data parallel computations. (Web)
- A Brief History of Just-in-Time (2003)
- Essentials of Compilation: An Incremental Approach (2018)
- How JIT Compilers are Implemented and Fast: Pypy, LuaJIT, Graal and More (2020)
- Software and Hardware Techniques for Efficient Polymorphic Calls (1999)
- The Octagon Abstract Domain (2007)
- Compilers as Teachers (2021)
- Do Developers Read Compiler Error Messages? (2017) (HN)
- Let's write a compiler, part 1: Introduction, selecting a language, and doing some planning (2021) (Code)
- Let's get hands-on with QBE (2021)
- Canonicalization (2018)
- cachepot - Shared Compilation Cache.
sccache
with extra sec, which in turn isccache
with cloud storage. - A friendly introduction to machine learning compilers and optimizers (2021)
- SymCC - Efficient compiler-based symbolic execution. (Web)
- ONNX MLIR - Open-source project for compiling ONNX models into native code on x86, P and Z machines (and more). (Web)
- nncase - Neural network compiler for AI accelerators.
- KGT: Kate's Grammar Tool - BNF wrangling and railroad diagrams.
- Knossos-KSC - Compile a lisp-like IR with automatic differentiation and user-defined rewrites.
- pyMLIR - Python Interface for the Multi-Level Intermediate Representation.
- An Incremental Approach to Compiler Construction (2006) (HN)
- Learning C to x86 Translation: An Experiment in Neural Compilation (2021) (Code)
- Essentials of Compilation [book and video lectures] (2020) (HN) (Code)
- Staged Abstract Interpreters (2019)
- target-lexicon - Library for managing targets for compilers and related tools.
- cce - Compiler Explorer from CLI.
- On relational compilation (Lobsters)
- Effect-Driven QuickChecking of Compilers (Code)
- SiliconCompiler - Open source compiler framework that automates translation from source code to silicon.
- Understanding Fast-Math (2021) (HN)
- Talking with a legend – interview with Anders Hejlsberg (2021)
- Everything You Never Wanted To Know About Linker Script (2021)
- abstraps - Extensible compiler middle layer with abstract interpreters.
- BNF Converter - Compiler construction tool generating a compiler front-end from a Labelled BNF grammar.
- Do We Need A Link Step? (2021) (Reddit) (HN)
- KAIST CS420: Compiler Design (2022 Spring)
- VTIL - Virtual-machine Translation Intermediate Language.
- Hello, JIT World: The Joy of Simple JITs (2012)
- Low-Level Software Security for Compiler Developers (Web) (HN)
- Pareas - GPU-accelerated compiler for a simple programming language, which outputs RISC-V machine code.
- monoasm - In-memory x86-64 assembler for JIT compiler.
- Crafting A Lox Interpreter In Rust (2022)
- Writing a minimal x86-64 JIT compiler in C++
- OpenRAM - Open-source static random access memory (SRAM) compiler. (Web)
- mdec - Decompilation as a Service. Explore multiple decompilers and compare their output with minimal effort. Upload binary, get decompilation.
- BacCaml - Meta-hybrid JIT compiler mixing trace- and method-based compilation strategies.
- QBE - Compiler Backend. (Code)
- Hand-optimizing the TCC code generator (2022)
- Why Compilers Don’t Autocorrect “Obvious” Parse Errors (2022) (HN)
- Squint - Peephole optimizer for stack VM compilers.
- raddsl - Tools for rapid prototyping of DSL compilers.
- Compiler Adventures, part 1: No-op Instructions (2022) (Tweet)
- A compiler's users (2021)
- optir - Compiler optimizer for arbitrary control flow based on equality saturation.
- Mijit - Experimental JIT compiler generator.
- Introduction to Compilers and Language Design (Reddit) (HN)
- Ask HN: Recommendation for general purpose JIT compiler (2022)
- Monadic Compiler Calculation (2022)
- Podcast: PhD research on meta programming and static analyzers (2022)
- Research or articles on different, more efficient compiler designs (2022)
- dewolf - Research decompiler implemented as a Binary Ninja plugin and uses the MedimumLevel IL as a starting point.
- How to Architect a Query Compiler, Revisited
- Cwerg - Lightweight compiler backend aimed at new programming language implementations that want to avoid heavy dependencies like LLVM.
- Deep Dive into JIT Compiler Optimizations (2020)
- Cranelift, Part 4: A New Register Allocator (2022)
- My other database is a compiler (2022)
- Fast page maps for JIT (2022)
- Toolchains adventures - Q2 2022
- QBE Notes (Lobsters)
- Lessons from Writing a Compiler (HN)
- Why Is No One Writing Language Runtimes? (2016)
- Decompiler Explorer (HN) (Code)
- Complete compiler and VM in 150 lines of code (HN)
- Implementing a Toy Optimizer (2022)
- Search-based compiler code generation (2017)
- On Transpilers (Zig/Rust/Go) (Lobsters)
- Compilation by Program Transformation (1989)
- Rust libraries to build a compiler for my language? (2022)
- Ask HN: How to get a job as a compiler engineer? (2022)
- MLIR Playground - Play with MLIR directly in your browser. (Code)
- A Catalogue of Optimizing Transformations (1971)
- Sarus - JIT compiled language designed for real time contexts.
- History of symbolic execution (as well as SAT/SMT solving, fuzzing, and taint data tracking)
- Report on Secure Compilation Research (2021)
- langcc - Next-Generation Compiler Compiler.
- Optimizing compilers deduplicate strings and arrays (2022) (HN)
- Compiler Optimizations Are Hard Because They Forget (2022) (Lobsters)
- Static Program Analysis (2022)
- The Solid-State Register Allocator (2022) (Code)
- A look across the pond: a comparison between GHC and Racket compilation models (2022)
- Allocation Removal in the Toy Optimizer (2022)
- Compilers and IRs: LLVM IR, SPIR-V, and MLIR (2021) (HN)
- Writing a symbolizer for the Cinder JIT (2022)
- Lady Deirdre - Compiler front-end foundation technology.
- cexpl - Command-line tool to interact with Compiler Explorer.
- crossbuild - Multiarch cross compiling environments.
- Lightning Creations Compiler Collection - Compiler framework written in pure rust, that is intended to eventually be fully usable in place of existing toolchains.
- The downsides of compile time evaluation (2022) (Lobsters)
- Course Webpage for Compilers (2020)
- Just In Time (JIT) Compilers - Computerphile (2022)
- How to JIT - an introduction (2013)
- How to Think About Compiling (2022)
- SSA-based Compiler Design (2022)
- Compiler Tricks to Avoid ABI-Induced Crashes (2022)
- Control-flow integrity (2022) (Lobsters)
- Utah Compilers Course (2023)
- Rust BF interpreters
- Favorite compiler and interpreter resources (2023)
- xDSL - Compiler toolkit natively developed in Python.
- Devito - Code generation framework for automated finite difference computation.
- Ezno in '23
- Symbol Interposing & Hooking Shenanigans
- Ask HN: What is it about compiling that is so time-consuming? (2023)
- Engineering a Compiler (2022)
- CS143: Compilers
- Languages, Compilers and Interpreters Course (2022) (Code)
- All about LeakSanitizer (2023)
- Cranelift's Instruction Selector DSL, ISLE: Term-Rewriting Made Practical (2023)
- JIT compiler in Go
- Three approaches to heap sizing (2023)
- LVC - Linear Verified Compiler in Coq.
- CoreJIT - Formally Verified Speculation and Deoptimization in a JIT Compiler.
- Essentials of Compilation: An Incremental Approach in Racket
- Essentials of Compilation: An Incremental Approach in Python (PDF)
- Emscripten - Complete compiler toolchain to WebAssembly, using LLVM, with a special focus on speed, size, and the Web platform. (Code)
- Codon: A Compiler for High-Performance Pythonic Applications and DSLs (2023) (HN)
- Writing JIT Compiler on the Plane (2022)
- Stanford CS143 Intro to Compilers course notes (2023)
- Why take a compiler course? (2010) (HN)
- cwhy - Explains and suggest fixes for C/C++/Rust compiler error messages.
- Can You Trust a Compiler to Optimize Your Code? (2023) (Reddit) (HN)
- Kalyn: a self-hosting compiler for x86-64 (2023)
- Translation Validation of Tensor Compilers (2023)
- Flattening ASTs (and Other Compiler Data Structures) (2023) (Lobsters) (HN)
- Driving Compilers (2023) (Lobsters)
- fixpls - Fix your compiler errors automatically with GPT.
- JIT Compilers 102 (2023)
- Ask HN: Why are there no traditional language compilers that target the JVM? (2023)
- Ask not what the compiler can do for you (HN)
- Concrete — Zama's Fully Homomorphic Encryption Compiler (2023)
- Bril Playground - Web playground for Bril with vizualization for CFG (Control Flow Graph) and SSA (Static Single Assignment) transformations. (Code)
- What’s New in M68k LLVM (2023)
- My first superoptimizer (2023)
- Why Learn Compilers (2021) (HN)
- Teddy - Simple, educational compiler implemented in Swift.
- Tell HN: The dragon compiler book (2nd edition) is a great book (2023)
- Implementing Co, a Small Language With Coroutines #4: Adding Channels (2023)
- Tutorial: Teaching and Learning Compilers Incrementally (HN)
- JitStreamer - Service to activate JIT across the far reaches of the internet.
- Learning modern compilers (2023)
- Compilers for the Future (HN)
- Blowing up my compile times for dubious benefits (2023)
- Mojo and Dynamism
- Linear-time parser combinators (2023)
- Practical comparison of ARM compilers (2023)
- The future of Clang-based tooling (2023)
- On Modularity of Lexical Analysis (2023)
- Compiler Development: Rust or OCaml? (2023) (Lobsters) (HN)
- AST vs Bytecode: Interpreters in the Age of Meta-Compilation (2023) (HN)
- MLIR For Beginners - Series of articles on the MLIR framework. (HN)
- Awesome PGO - Various materials about Profile Guided Optimization and other similar stuff like AutoFDO, Bolt, etc.
- How to ensure that an optimising compiler will terminate? (Lobsters)
- Modernizing Compiler Design for Carbon Toolchain - Chandler Carruth (2023)
- An Introduction to Interpreters and JIT Compilation (2023) (Tweet)