Skip to main content
MojoMojo

Write like Python, run like C++.

Write fast code for diverse hardware—from CPUs to GPUs—without vendor lock-in, and in a language that's both user friendly and memory safe.

Install Now

TODO: Inject time since last nightly, stable version date

Built different

Modern

Mojo draws inspiration from the best parts of modern languages - like Python's intuitive syntax, Rust's memory safety, and Zig's powerful and intuitive compile-time metaprogramming.

AI native

Mojo is built from the ground up to deliver the best performance on the diverse hardware that powers modern AI systems. As a compiled, statically-typed language, it's also ideal for agentic programming.

Simply performant

No more choosing between productivity and performance - Mojo gives you both. You can start with simple and familiar programming patterns, and add complexity as you need it.

GPU programming

Mojo makes GPU programming accessible to everybody, without vendor-specific libraries and without separately-compiled code. You can finally write high-performance GPU kernels in the same language you use for CPUs.

def vector_add(
a: TileTensor[float_dtype, type_of(layout), MutAnyOrigin],
b: TileTensor[float_dtype, type_of(layout), MutAnyOrigin],
result: TileTensor[float_dtype, type_of(layout), MutAnyOrigin],
size: Int,
):
var i = global_idx.x
if i < size:
result[i] = a[i] + b[i]

Python interop

Mojo natively interoperates with Python so you can eliminate performance bottlenecks in existing code without rewriting everything. You can start with one function, and scale up as needed to move performance-critical code into Mojo. Your Mojo code imports naturally into Python and packages together for distribution. Likewise, you can import libraries from the Python ecosystem into your Mojo code.

# SIMD-vectorized kernel squaring array elements in place.

def mojo_square_array(array_obj: PythonObject) raises:
comptime simd_width = simd_width_of[DType.int64]()
ptr = array_obj.ctypes.data.unsafe_get_as_pointer[DType.int64]()

def pow[width: Int](i: Int) unified {mut ptr}:
elem = ptr.load[width=width](i)
ptr.store[width=width](i, elem * elem)

vectorize[simd_width](len(array_obj), pow)

Compile-time metaprogramming

Mojo metaprogramming uses the same language as the run-time code, providing an intuitive system to maximize performance. You can build hardware-specific optimizations with conditional compilation, ensure memory safety with compile-time evaluation, eliminate costly runtime branches, and more—all with clearly defined intentions and zero-cost abstractions.

# Hardware-dispatched vector addition for CPU or GPU.

struct VectorAddition:
@staticmethod
def execute[
target: StaticString,
](
output: OutputTensor[rank=1, ...],
lhs: InputTensor[dtype=output.dtype, rank=output.rank, ...],
rhs: InputTensor[dtype=output.dtype, rank=output.rank, ...],
ctx: DeviceContextPtr,
) raises:
comptime if is_cpu(target):
vector_addition_cpu(output, lhs, rhs, ctx)
elif is_gpu(target):
vector_addition_gpu(output, lhs, rhs, ctx)
else:
raise Error("No known target:", target)

Roadmap

Mojo was born in late 2022 and has come a long way, but there’s still a lot to do.

Initial bring-up

Implementing the core parser, defining memory types, functions, structs, initializers, argument conventions, and other language foundations.

High performance CPU + GPU coding

Adding performant and expressive language and library features that accelerate production workloads and enable seamless integration with existing developer workflows.

Systems application programming

Expanding Mojo to support more application-level programming, with a guaranteed memory-safety model and more abstraction features that developers expect for systems programming.

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-sourced 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!

Get started

TODO: Inject time since last nightly, stable version date

Learn Mojo

Join the community