Paradigms |
|
---|---|
Family | Python |
Designed by | Chris Lattner[1] |
Developer | Modular Inc. |
First appeared | 2023 |
Preview release | 24.4[2]
/ May 24, 2024 |
Typing discipline | |
OS | Cross-platform: Linux, macOS |
License | Proprietary |
Filename extensions | .🔥 (the fire emoji/U+1F525 Unicode character), alternatively .mojo |
Website | www |
Influenced by | |
Python, Cython,[citation needed] C, C++, Rust, Swift, Zig |
Mojo is a programming language in the Python family that is currently under development.[3][4][5] It is available both in browsers via Jupyter notebooks,[5][6] and locally on Linux and macOS.[7][8] Mojo aims to combine the usability of a high-level programming language, specifically Python, with the performance of a system programming language such as C++, Rust, and Zig.[9] As of 2024[update], the Mojo compiler is proprietary software (closed source) with an open source standard library. Modular, the company behind Mojo, has stated an intent to eventually open source the Mojo language, as it matures.[10]
Mojo builds on the Multi-Level Intermediate Representation (MLIR) compiler software framework instead of directly on the lower level LLVM compiler framework, as do many languages such as Julia, Swift, Clang, and Rust.[11][12] MLIR is a newer compiler framework that allows Mojo to exploit higher level compiler passes unavailable in LLVM alone, and allows Mojo to compile down and target more than only central processing units (CPUs), including producing code that can run on graphics processing units (GPUs), Tensor Processing Units (TPUs), application-specific integrated circuits (ASICs) and other accelerators. It can also often more effectively use certain types of CPU optimizations directly, like single instruction, multiple data (SIMD) with no direct intervention by a developer, as occurs in many other languages.[13][14] According to Jeremy Howard of fast.ai, Mojo can be seen as "syntax sugar for MLIR" and for that reason Mojo is well optimized for applications like artificial intelligence (AI).[15]
Mojo is a programming language that is as easy to use as Python but with the performance of C++ and Rust. Furthermore, Mojo provides the ability to leverage the entire Python library ecosystem.
While many other projects now use MLIR, Mojo is the first major language designed expressly for MLIR, which makes Mojo uniquely powerful when writing systems-level code for AI workloads.