GHC-compatible
Not Haskell 2010 plus a few extras. AIHC accepts GHC's extensions and ships the GHC.* modules that Hackage packages expect. It builds aeson, text, containers and vector.
Self-hosting since 2026
AIHC is a modern, self-hosting Haskell compiler. It targets native machine code, LLVM IR and WebAssembly.
Features
Three goals, in priority order: compatible with GHC, faster where GHC is slow by design, and reusable piece by piece.
Not Haskell 2010 plus a few extras. AIHC accepts GHC's extensions and ships the GHC.* modules that Hackage packages expect. It builds aeson, text, containers and vector.
Parsing, name resolution, type checking and code generation are scheduled over every core. The 54 modules of text build in 3.2 seconds, against 28.0 for GHC at -O0.
GHC optimizes one module at a time. AIHC sees the whole program before it generates code, which is how its -Os binaries come out a tenth of the size.
Native machine code for AMD64 and ARM64, LLVM IR, and wasm32. One middle end, one runtime and one garbage collector serve all three.
AIHC compiles AIHC. The compiler it produces compiles itself again, and the two executables are identical, byte for byte.
Its own preprocessor, parser, type checker, optimizer, object emitter and runtime. No stage shells out to a tool it cannot change, so no bottleneck is out of reach.
A generational, incremental garbage collector with bounded pauses. Green threads that run in parallel. Software transactional memory.
The compiler is a set of packages: aihc-cpp, aihc-parser, aihc-resolve, aihc-tc and more. Each is meant to be useful without the rest.
From source to machine code, without leaving the building
Performance
Each number is AIHC divided by GHC 9.14.1 for the same programs. Lower is better, and 1.00× is parity.
Compile time -O0
0.12×
About eight times faster to compile.
Artifact size -Os
0.10×
Executables a tenth of the size.
Runtime -O2
0.94×
Slightly ahead of GHC's optimized code.
Native backend, geometric mean over 13 benchmarks on an Apple M4 Pro, 13 November 2026. GHC has no -Os, so sizes compare against GHC at -O1. The LLVM and Wasm backends, every machine and the full history are on perf.aihc.app.
How it's made
A person holds the architecture and reviews every change. AI agents write the code: ChatGPT, Claude Opus and Qwen-Coder all contribute. They also write the tests, the benchmarks, the design documents and the blog.
The first commit landed in March 2026. Seven months later the compiler built itself.
Resources
aihc, and a developer manual for how it works inside.
lazy.aihc.app
The Lazy Reader
An illustrated guide for people who will not read the manual. The compiler runs in your browser.
blog.aihc.app
The journal
Weekly highlights and occasional deep-dives, researched and written by AI.
perf.aihc.app
Benchmarks
Compile time, artifact size and runtime against GHC, tracked across the commit history.
hackage.aihc.app
Hackage, without a server
A prototype package repository whose Haskell parts are compiled to WebAssembly by AIHC.
github.com
Source code
The compiler, its issues and its live progress counts. Released under the Unlicense.
discord.gg
Discord
Chat with the people, and the occasional robot, behind AIHC.
Clone the repository, build the compiler and run the hello-world example. The user guide has the full instructions.
% git clone https://github.com/ai-haskell-compiler/aihc
% cd aihc
% cabal run exe:aihc -- build examples/hello-world/Main.hs