typestar

Languages

Mojo

A compiled language with Python's syntax and static types, aimed at machine-learning and systems workloads.

Practice Mojo

70 steps across 3 tours, from the basics to complete programs.

The tours

First released
2023
Created by
Chris Lattner and Modular
Typing
Static under Python's skin -- every argument and return is annotated, and the compiler holds you to it
Snippets target
1.0 beta
File extensions
.mojo

What it is for

Mojo is what happens when the author of LLVM and Swift decides Python's syntax deserves a compiler. Functions are declared with def and blocks with indentation, but every value has a static type, structs live on the stack, and ownership is tracked the way Rust tracks it — with a transfer sigil (^) instead of a borrow checker's vocabulary. The pitch is one language across the whole stack: the ergonomics of Python where speed is irrelevant, and hand-tuned SIMD in the same file where it is everything.

The language's center of gravity is AI infrastructure. Mojo is developed by Modular alongside MAX, its inference platform, and the showcase demos are the kernels that make models fast: matrix multiplication, mandelbrot renders, vectorized reductions. Compile-time parameters — values in square brackets resolved before the program runs — generate specialized code the way C++ templates do, but with Python's readability instead of angle-bracket noise.

Mojo reached 1.0 beta in 2026 with sharp edges deliberately filed off along the way: the fn/def split collapsed into def alone, alias became comptime, and the standard library reorganized under std. These seeds track 1.0, so what you type here is the settled syntax — and every one of them is compiled by the real toolchain before it ships.

Where it came from

Chris Lattner — creator of LLVM, Clang, and Swift — co-founded Modular in 2022 after running compiler and AI-infrastructure teams at Apple, Tesla, and Google. Mojo went public in May 2023 with a demo that put it 35,000x faster than CPython on a mandelbrot benchmark, a number designed to be argued about and shared, and it was.

The early releases moved fast and broke their own syntax on schedule: let disappeared, argument conventions were renamed twice (borrowed to read, inout to mut), and the fire emoji stayed a legal file extension through all of it. The standard library was open-sourced in 2024, and the toolchain dropped its custom installer for a plain pip install in 2025.

The 1.0 beta arrived in 2026 as a declaration that the churn was over: fn was removed in favor of def alone, alias gave way to comptime, and the module tree settled under std. Modular's bet is that the language which trains and serves models can also be the one that scripts them — one syntax from notebook to kernel.

What it is like to type

Mojo types like Python with the safety rails visible: def and colons and four-space indents, but every signature carries annotations (x: Float64, -> Int) and struct fields each get their own var line. The special characters cluster in brackets — SIMD[DType.float64, 4] is one type — and the ownership sigil ^ lands at the end of a moved value. Expect Python's rhythm with more punctuation per line, and comptime where you would reach for a constant.

Practice Mojo

70 steps across 3 tours, from the basics to complete programs.

Official documentation

Other languages