
Modular, an AI infrastructure company, has unveiled a new programming language called Mojo for AI developers, combining full Python compatibility with advanced low-level programming features and the ability to harness GPUs and other AI accelerators. The language uses MLIR, the Multi-Level Intermediate Representation compiler framework, to provide low-level systems programming and advanced compilation features.
Mojo was designed to bridge the gap between research and production, leveraging Python syntax as well as systems programming and compile-time metaprogramming. Modular claims that Mojo is faster than C++, more hackable than Nvidia’s CUDA, and as safe as Rust. The language aims to offer an innovative programming model for machine learning accelerators while supporting general-purpose programming.
Mojo is intended to be a superset of Python and is fully compatible with existing Python programs. The language supports Python core features such as async/await, error handling, and variadics, with the exception of classes, which are not yet supported. The goals of the language include:
- Full compatibility with the Python ecosystem
- Predictable low-level performance and control
- The ability to deploy code subsets to accelerators
- Avoidance of ecosystem fragmentation
The Mojo standard library, compiler, and runtime are not yet available for local development. However, Modular has provided a hosted development environment called the Mojo Playground for developers to test and experiment with the language, requiring sign-up for access.
Mojo’s roadmap includes features such as tuple support, keyword arguments in functions, improved package management support, and standard library features like canonical arrays and dictionary types. Additionally, the language aims to provide full support for dynamic features in Python classes and C/C++ interoperability.
Mojo represents an exciting development for AI developers looking for a high-performance and flexible tool to accelerate their research and production, while leveraging the strengths of Python and advanced low-level programming features.
LANGUAGES | TIME (S) * | SPEEDUP VS PYTHON |
---|---|---|
PYTHON 3.10.9 | 1027 s | 1x |
PYPY | 46.1 s | 22x |
SCALAR C++ | 0.20 s | 5000x |
MOJO 🔥 | 0.03 s | 35000x |
*Algorithm – Mandelbrot | Instance – AWS r7iz.metal-16xl – Intel Xeon