Back Home

AI 開發工具

Mojo Opens Compiler and Toolchain Source, Enabling Source Builds with a Single Bazel Command

One week after releasing Mojo 1.0, Modular has made the KGEN compiler, tools, and standard library available under Apache 2.0 with the LLVM exception. The source code can now be inspected and built independently, though the compiler is not yet accepting external contributions, and MAX remains under a separate license.

Joe Gallo · CC BY-SA 4.0 · Image source
zh-Hant

On August 18, Modular added the previously closed-source Mojo compiler and toolchain to a public monorepo, filling the most critical gap in the AI and heterogeneous computing language. The standard library was opened in 2024; this release adds the KGEN compiler, build tools, and the code required to produce a working compiler from source. Modular’s official Bazel workflow can build from source and run a program with `./bazelw run --config=build-mojo KGEN:mojo -- run hello.mojo`. Standard library tests can also run within the same build graph.

Mojo uses Python-like syntax but is designed to give developers control over memory, compile-time specialization, and CPU, GPU, and AI accelerator kernels. Its compiler is built on MLIR/LLVM concepts, progressively lowering high-level types and compile-time computations into hardware-specific representations. For AI infrastructure teams, opening the compiler makes it possible to audit lowering, investigate incorrect code generation, pin supply-chain versions, and explore backends for new accelerators without fully trusting precompiled binaries. This complements the August 11 release of Mojo 1.0, which introduced a commitment to source compatibility for the core language rather than claiming that every standard library API is fully stable.

For now, “open source” does not mean mature community governance. Modular says it is not yet accepting external contributions to the compiler and toolchain, but aims to do so by the end of the year. Some workflows for modifying MAX models or core components still require a prebuilt Mojo compiler. MAX is also used and distributed under the Modular Community License, so teams should not assume that the entire inference platform is covered by Apache 2.0 simply because it resides in the same repository. Engineering teams should begin with pilot projects involving standalone kernels or Python hotspots, then evaluate the GPU backend, ABI, package management, and reproducible builds before adopting Mojo as part of a production toolchain.

Sources

  1. Mojo is now open source!
  2. The Modular Platform — source repository
  3. Mojo compiler is on GitHub now