This post explains why a radically different design is needed for future generation Compilers, how current compilers work and outline a vision for how future compilers might work.
Simply put, modern Compilers were invented to transliterate between human-readable coding languages and machine-readable assembly code. Over time, they've also implemented optimizations to create faster software, guardrails to enforce good coding practices, and features targeting alternative platforms.
With the advent of the Large Language Model (LLM) and coding Agents built on top of them, the key responsibility of the compiler shifts from a feedback system for a human writing a program to a feedback system for the operator of a coding agent. That operator could be either a human being or an orchestration agent.
Compilers should therefore work a bit differently:
- Diagnostic output should be as verbose as possible, outputting the entire diagnostic trace including machine-readable information that LLMs can make sense of, rather than prioritizing concise, human-readable output.
- Usage and access patterns should be declarative and literal where the compiler frontend and compiled output give clear, complete and deterministic information about operations of resulting programs at runtime.
- Assembler code is no longer the default output mode of choice. Programs should output model weights, structured tool calls, or text instruction for LLM-based agents preferentially to machine-runnable MIPS code.
Implementing the above changes would improve the safety and predictability of generated code and enable more context-rich and flexible patterns of interoperation.
As engineers, we should start this discussion with a feasibility analysis. What is objectively within our power to change?
While Simon Willison posits LLMs could encourage new coding languages and efforts like LMQL have attempted to formalize grammars codified for LLMs, let's be realistic.
New coding languages will face a "cold-start problem" or at least a massive headwind in bootstrapping enough high-quality training data that agents can learn to write the langauge well. Datasets existing models are trained on, such as this very website you're reading this on, have been heavily reviewed, organized, and iteratively improved over decades. Replicating training data of this quality and variety would be non-trivial.
Therefore, I disagree that a new compiler frontend will catch on or be economically useful in the near term. I believe we can create massive productivity and economic value by creating new intermediate representations (IR) and/or compiler backends.
In the next doc, I'll summarize how a modern compiler works to the extend necessary to explain the direction I see this going in the future. In the third and final page, I'll describe my vision for the future.