Mojo Programming Language Compiler Code Released

The developers of the Mojo programming language have announced the open-sourcing of the source code of the compiler and the necessary tools to build projects in Mojo. This move makes the code open source under the Apache 2.0 license, with exceptions from the LLVM project allowing mixing with code under the GPLv2 license. Previously, only the standard library code was publicly available, but now with the Mojo 1.0 release, the compiler code is also accessible. While changes from third parties are not yet accepted, the ability to transfer changes is planned to be implemented by the end of the year.

Steering the development of the Mojo language is Chris Lattner, the founder and chief architect of the LLVM project and creator of the Swift programming language. Mojo’s syntax is inspired by Python, and its type system bears resemblance to C/C++. Touted as a general-purpose language, Mojo extends Python’s capabilities with systems programming tools, serving diverse tasks and offering ease for research development and rapid prototyping, as well as suitability for high-performance final products.

Mojo achieves simplicity through Python-like syntax and aids in product development with the ability to compile into machine code, ensuring secure memory operations and leveraging hardware acceleration tools. To enhance performance, the language supports parallel calculations utilizing all hardware resources in heterogeneous systems like GPUs, accelerators for machine learning, and SIMD instructions. This parallelization leads to superior performance compared to C/C++ applications for intensive computations.

With static typing and low-level memory-safe features reminiscent of Rust, Mojo also allows for low-level operations such as direct memory access in unsafe mode using the Pointer type, invocation of individual SIMD instructions, and utilization of hardware extensions like TensorCores and AMX.

Mojo can function in interpretation mode using JIT as well as compile into executable files using AOT. The compiler integrates modern technologies for automatic optimization, caching, and distributed compilation. Source code in Mojo is translated into the low-level intermediate code MLIR (Multi-Level Intermediate Representation) established by the LLVM project, supporting various backends to generate machine code.

/Reports, release notes, official announcements.