561,408 Lines of Mojo Compiler Just Went Public. PR Body: ':)'
TL;DR
Modular open-sourced the Mojo compiler and toolchain on August 18 under Apache 2.0 with LLVM Exceptions, announcing it exactly one week after Mojo 1.0 shipped with the compiler still proprietary. The source landed in the modular/modular repo as a single pull request: 10,000 commits, 561,408 added lines across 2,853 files, zero deletions, and a PR description consisting entirely of a smiley. A promise Modular has carried since 2023 is now a directory you can clone. The catches: external compiler contributions do not open until the end of 2026, and the MAX inference stack stays under Modular's Community License.
One PR, three years in the making
The mechanics of the drop are almost comically abrupt. PR #6904, titled "Open source Mojo," merged into modular/modular at 13:29 UTC on August 18. GitHub tallies it at 10,000 commits from an internal mojo-oss branch, 561,408 additions, 2,853 changed files, and not a single deleted line. The description, in its entirety: ":)". Three years of roadmap arguments, closed with an emoticon.
A 561,408-line diff with zero deletions is normally where code review goes to die. This one got a parade, including a Hacker News thread where the recurring sentiment was some variant of "the closed compiler was the main reason I had not tried it yet."
Meet KGEN, the compiler you could not read until Tuesday
The compiler lives in the repo's KGEN directory, a C++ codebase built on MLIR, the LLVM-family compiler infrastructure that Modular co-founder Chris Lattner helped create before founding the company. The README settles the naming up front: "The name KGEN stands for 'kernel generator'. When you see KGEN, think Mojo."
What is actually in there: the parser, the optimization passes, the MLIR dialects, the debugger integration, and the command-line tools (mojo, kgen, kgen-opt, kgen-translate), plus the test suite and a docs tree that until this week was internal, including design overviews and a folder the README bills as "detailed arcana." You can build the whole toolchain yourself with Bazel. For anyone who wants to understand how a modern language lowers Pythonic syntax onto GPUs and AI accelerators, this is one of the more interesting codebases to go public in years.
Why the closed compiler was the sticking point
Mojo hit 1.0 on August 11 promising C++-style source stability, and the loudest reaction was not about the language at all. It was that the commitment to open the implementation still read, in full, "we will open source the Mojo compiler and toolchain in 2026." The standard library has been open since 2024; the thing that turns your code into machine code was not.
That matters for a reason more practical than ideology. A language with a closed compiler is a car with the hood welded shut: everything is fine right up until it makes a strange noise, and then your only option is the dealership. Betting infrastructure on a language means betting you can debug it, fork it, or outlive its vendor, and none of those were possible while KGEN was private. As of August 18, all three are.
What is open, and what is still gated
The license is Apache 2.0 with LLVM Exceptions, the same terms LLVM itself uses, with the exception ensuring binaries you compile carry no attribution obligations from the toolchain. That is a real open-source license with no source-available asterisk, a distinction the Hacker News thread litigated and settled in Modular's favor.
Two gates remain, and they are worth stating plainly. First, open source does not yet mean open contribution: Modular says it will start accepting external compiler and toolchain PRs "by the end of this year," with process details to follow, while stdlib contributions continue as they have since 2024. Second, MAX, the inference server and kernel library that is Modular's actual product, remains under the Modular Community License in the same repo. The company open-sourced the language and kept the business, which is a coherent trade, just not the same headline.
What this buys you as a builder
The immediate wins are concrete. Compiler bugs can now come with a pointer into the pass that caused them instead of a black-box repro. Teams with unusual targets can investigate ports instead of filing wishes. And the MLIR dialect stack behind Mojo's GPU story is now study-able source, which matters to anyone watching for a credible portable alternative to CUDA lock-in, the pitch Modular has been making since day one.
One more shift worth noting, flagged by Simon Willison: the original "superset of Python" pitch is officially soft now. Modular's roadmap states "Mojo may or may not evolve into a full superset of Python, and it's okay if it doesn't," repositioning Mojo as a GPU-first systems language with Python-inspired syntax rather than a drop-in Python replacement. The open compiler makes that honest positioning easier to evaluate: you no longer have to take anyone's word for what the language does, including Modular's.
Key Takeaways
- Modular open-sourced the Mojo compiler and toolchain on August 18 under Apache 2.0 with LLVM Exceptions, one week after Mojo 1.0.
- It landed as a single PR: 10,000 commits, 561,408 added lines, 2,853 files, zero deletions, and a description that reads ":)".
- The compiler is the KGEN directory in modular/modular: C++ on MLIR, with parser, passes, dialects, debugger, tools, and formerly internal design docs.
- Open source is not yet open contribution: external compiler PRs start "by the end of this year."
- MAX, Modular's inference server and kernel library, stays under the Modular Community License.
- The Python-superset goal is officially optional now; Mojo is positioning as a GPU-first language you can finally audit.
Sources: Modular announcement, GitHub PR #6904, KGEN source tree, Simon Willison, Hacker News