The Next Big Step in Mojo🔥 Open Source

March 28, 2024

Modular Team

At Modular, open source is ingrained in our DNA. We firmly believe for Mojo to reach its full potential, it must be open source. We have been progressively open-sourcing more of Mojo and parts of the MAX platform, and today we’re thrilled to announce the release of the core modules from the Mojo standard library under the Apache 2 license!

We have always believed that building Mojo in the open will lead to a better result, because it allows its design to be shaped by the feedback from the broader community. We released Mojo very early and have been driving steady improvements since May of 2023 (see the changelog). Building a language and its infrastructure is hard work and takes time, and we’re excited to move from sharing our work to collaborating with Mojo developers worldwide.

Contribute to Mojo🔥 open source

There are many ways to open source code - some projects make source code available but do not accept contributions. Some provide opaque contribution processes without visibility into goals and roadmaps. Some open source and then don’t actively maintain it. 

At Modular, our team has either built, contributed to, or driven incredible open source projects like LLVM, Swift, TensorFlow and PyTorch, and we want to make sure we do things right. This means not just “making source code available”, but truly fostering and cultivating a vibrant and engaged open development community around Mojo🔥.

Beyond just providing source code, we are also opening up revision history for the standard library, releasing nightly builds of the Mojo compiler, providing public CI, and allowing external contributions through GitHub pull requests. This is expensive and non-trivial to set up, but in our experience, it's critically important to allow the community to scale.

License: Apache 2 with LLVM exceptions

We chose to use Apache Licence, version 2.0. It contains a patent grant provision which provides legal protection to users and contributors of the software. The Apache 2 license is a widely used and proven license, and is familiar to many individuals and companies across the industry.

The Apache 2 license is a great start, but our experience with licensing in the LLVM project taught us that there are two small issues with it. Some people are concerned that the Apache 2 license may not mix well with GPL2 code (e.g. the Linux Kernel) and the Apache 2 license requires that you acknowledge use of the code in derived projects. We want you to be able to use Mojo without requiring you to acknowledge Modular or Mojo (though of course, you are welcome to do so!) and make it clear that it is fine to mix with GPL2 code. As such, we’re including the LLVM exceptions which were specifically designed to address these concerns.

We believe this represents the state of the art in open source licensing for language and tool projects, and recommend other Mojo open source projects to follow the same approach. We have been using this approach for our existing open source code, and will continue to release more code with the same approach.

Early stages of our open source journey

The Mojo standard library is under heavy development and changing rapidly, so we've started by open sourcing its core modules. As such, we consider this to be an important starting point, not an end to our open source journey. We’ll similarly evolve and iterate our development and contribution processes as we learn together with the community. We'll be opening up a lot more code over time, including more of Mojo and parts of the broader MAX platform.

Contribution guides

So how can you become a contributor to Mojo? There are a lot of areas in the standard library that can be improved, so make sure to check out the in the Mojo GitHub repository on the nightly branch if you're planning to raise pull requests. It contains links to important docs, all of which are worth reading:

We'll also be giving away swag and other benefits to Mojicians with significant contributions to the standard library!

Nightly builds for fast iteration

Nightly builds of the Mojo compiler are also now available! This allows you to test your contributions to the standard library against the latest version of the Mojo compiler that corresponds to the library source. This is a massive step towards opening development of the Mojo compiler, and allows Mojicians to live on the bleeding edge of development if they choose and test against the current tree. Over time, we will expand this nightly build to include the entire MAX platform.

Make sure to check out the standard library development guide for details on how to get a nightly build, either to be on the bleeding edge of our development, or to test your contributions.

Version control history

We're releasing not only the code, but also our commit history for the standard library. We are committed to transparency, and enabling you to see how features have evolved over time, which provides additional context on how to develop standard library features.

Let’s build the future together!

We are very excited about the future of Mojo and all of the applications that people are already using it for. We think this is a big step forward in openness and transparency, though we still have a long way to go. If you’re interested in making contributions, please check out the README in mojo/stdlib for everything you need to get started, and feedback is always welcome on Discord and GitHub.

Modular Team