IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).
The systems language for the AI era.
Write fast code for diverse hardware (spanning CPUs, GPUs and more) without vendor lock-in, in a language that's both user friendly and memory safe.
Install NowBuilt different
Unified
From data centers to the edge. From CPUs to NPUs. Mojo is the one language for programming every layer of modern and future computing systems.
Productive
Mojo gives you systems-level control in a language that feels productive from the start—with readable syntax, memory safety, and powerful compile-time metaprogramming.
Simply performant
No more choosing between productivity and performance. You can start with simple and familiar programming patterns, and add complexity as you need it.
GPU programming
Write GPU kernels in the same language you use for CPUs—no CUDA, no separate DSL. The MAX accelerator library provides Mojo APIs for device management, GPU abstractions, tensor operations, and more. And if necessary for unique hardware, drop down to low level assembly like PTX.
def vector_add(
a: TileTensor[float_dtype, type_of(layout), element_size=1, ...],
b: TileTensor[float_dtype, type_of(layout), element_size=1, ...],
result: TileTensor[
mut=True, float_dtype, type_of(layout), element_size=1, ...
],
):
var i = global_idx.x
if i < layout.size():
result[i] = a[i] + b[i]
Python interop
Mojo meets developers where they are. Import Python libraries, accelerate performance-critical paths, and move gradually from prototypes to production systems without rewriting everything at once.
# Using matplotlib to plot Mojo data.
def make_plot() raises:
var values = List[Float64](length=40, fill=0.0)
rand(values, max=200)
var np_values = copy_to_numpy_array(values)
var pyplot = Python.import_module("matplotlib.pyplot")
pyplot.plot(np_values)
pyplot.xlabel("Sample")
pyplot.ylabel("Value")
pyplot.savefig("plot.png")
Compile-time metaprogramming
Mojo’s compile-time programming uses the same language as your runtime code, so specialization and optimization feel like regular programming—not a separate macro system.
# Generic struct equality using compile-time reflection.
def __eq__(self, other: Self) -> Bool:
comptime r = reflect[Self]()
comptime for i in range(r.field_names().size):
comptime assert conforms_to(r.field_types()[i], Equatable)
if r.field_ref[i](self) != r.field_ref[i](other):
return False
return True
Roadmap
Mojo continues to evolve towards its vision: the general-purpose language for high-performance heterogenous systems.
Phase 1
High-performance systems and accelerator programming
Building Mojo into a powerful and expressive language for systems programming on heterogeneous hardware—from CPUs to GPUs and beyond—while empowering developers to extend Python seamlessly.
Phase 2
Systems application programming
Expanding Mojo's reach with better support for application-level programming. Improving tooling and packaging to support a broader ecosystem.
Phase 3
Dynamic object-oriented programming
Supporting more of Python's dynamic features like classes, inheritance, and untyped variables to maximize compatibility with Python code.
For more details, see the Mojo roadmap
Open source
The Mojo standard library is fully open-source on GitHub and we welcome contributions! We also plan to open-source the Mojo compiler in 2026.
We're committed to open-sourcing all of Mojo, but the language is still very young and we believe a tight-knit group of engineers with a common vision moves faster than a community-driven effort.
If you'd like to get involved, join our developer community!