Mojo (programming language)
Mojo is a programming language for Linux and macOS. It is a system programming language with semantics inspired by Rust such as static typing and a borrow checker, but with syntax based on Python (like Nim, Julia). It was originally intended to be a superset of Python, but this goal has been either abandoned or postponed indefinitely as of March 2026. In May 2026, Modular launched a website for the language and in August 2026 Modular released Mojo 1.0, declaring it free and open-source software. Mojo builds on the Multi-Level Intermediate Representation (MLIR) compiler software framework, instead of directly on the lower level LLVM compiler framework used by languages like Julia, Swift, C++, and Rust. 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 minor intervention by a developer, as occurs in many other languages.…
Mojo is a programming language for Linux and macOS. It is a system programming language with semantics inspired by Rust such as static typing and a borrow checker, but with syntax based on Python (like Nim, Julia). It was originally intended to be a superset of Python, but this goal has been either abandoned or postponed indefinitely as of March 2026. In May 2026, Modular launched a website for the language and in August 2026 Modular released Mojo 1.0, declaring it free and open-source software. Mojo builds on the Multi-Level Intermediate Representation (MLIR) compiler software framework, instead of directly on the lower level LLVM compiler framework used by languages like Julia, Swift, C++, and Rust. 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 minor intervention by a developer, as occurs in many other languages. 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). def add(x: Int, y: Int) -> Int: """A typed addition.""" return x + y Variables may be declared explicitly with , which gives block-level scope, or implicitly by assignment, which gives function-level scope matching Python's behavior: def main(): var total = add(1, 2) # explicitly declared doubled = total * 2 # implicitly declared print(doubled) Mojo originally included a keyword for immutable bindings; it was removed from the language in 2024. Structs are Mojo's compile-time-laid-out alternative to Python classes. The decorator synthesizes a constructor from the declared fields, and traits such as declare supported behaviors: @fieldwise_init struct Point(Copyable, Movable): var x: Int var y: Int def magnitude_squared(self) -> Int: return self.x * self.x + self.y * self.y def main(): p = Point(3, 4) print(p.magnitude_squared()) # 25 Mojo programs can import and use Python modules through the CPython runtime: from std.python import Python def main() raises: math = Python.import_module("math") print(math.sqrt(2.0))
References
No reference rows published for this article.
Cite this article
MLA
"Mojo (programming language)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/mojo-programming-language. Accessed 24 November 2026.
Chicago
"Mojo (programming language)." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/mojo-programming-language.
APA
encyclopegia.org. (2026). Mojo (programming language). Retrieved November 24, 2026, from https://encyclopegia.org/wiki/mojo-programming-language
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON