Sign In
Access to Author tools and Claude Code Assistant requires authentication.
by Adam 8 min read

Mojo: The Python Killer That Might Actually Have a Shot

A deep dive into Mojo, the MLIR-based language promising 35,000x speedups over Python. What it does well, where it falls short, and who should actually care.

programming python mojo performance ai ml systems-programming

The Pitch That Got My Attention

35,000 times faster than Python. That’s the headline number Modular has been throwing around for their new language, Mojo. Coming from anyone else, I’d roll my eyes and move on. But when Chris Lattner – the guy who created LLVM, Clang, Swift, and MLIR – says he’s building a Python superset that can match C++ performance, you pay attention.

I’ve spent months watching this language evolve, reading the discussions, benchmarking where I can. Here’s my assessment of where Mojo stands in late 2025, whether it has a realistic shot at displacing Python in ML/AI workloads, and whether you should start learning it now.

What Mojo Actually Is

Mojo isn’t just another “fast Python” attempt. The architecture is fundamentally different from projects like PyPy or Cython.

At its core, Mojo builds on MLIR (Multi-Level Intermediate Representation), the compiler framework Lattner developed at Google. While languages like Julia, Swift, and Rust compile to LLVM IR, Mojo targets MLIR – a higher-level representation that enables optimizations LLVM can’t do alone.

This matters for three reasons:

  1. Multi-target compilation: Mojo can produce optimized code for CPUs, GPUs, TPUs, and custom accelerators from the same source code
  2. Higher-level optimizations: MLIR passes can optimize at the algorithmic level, not just the instruction level
  3. Hardware portability: The same Mojo code can target NVIDIA Hopper, AMD MI300, and future accelerators without rewrites

The language design splits the difference between Python’s accessibility and systems programming’s control:

# This is valid Mojo -- it's also valid Python
def hello():
    print("Hello, World!")

# But you can also drop into systems-level control
fn compute_fast(data: DTypePointer[DType.float32], size: Int) -> Float32:
    var result: Float32 = 0.0

    @parameter
    fn vectorized[width: Int](i: Int):
        result += data.load[width=width](i).reduce_add()

    vectorize[vectorized, simd_width](size)
    return result

The def keyword gives you Python semantics. The fn keyword gives you compiled, statically-typed functions with no dynamic overhead. You choose your tradeoff per function.

The Performance Claims: Real or Marketing?

Let’s address the 35,000x number directly.

Modular’s benchmark used Mandelbrot set generation – a task that’s embarrassingly parallel and heavily computational. They compared pure Python (not NumPy, not vectorized) against fully optimized Mojo with SIMD vectorization and parallelization.

Is 35,000x real? Yes, for that specific benchmark with those specific constraints.

Is 35,000x representative? No. Here’s what more realistic numbers look like:

ScenarioSpeedup vs Python
Drop-in replacement (same code)12-46x
Basic optimizations (type hints, fn)100-500x
Full optimization (SIMD, parallelization)1,000-35,000x
Compared to NumPy (already optimized)2-10x

The honest pitch: Mojo is 12x faster than Python without even trying, and can be orders of magnitude faster when you use its systems features. The 35,000x number requires work – but that work is far easier than writing equivalent C++ or CUDA.

Recent research from SC ‘25 tested Mojo on real scientific workloads (stencil computations, BabelStream, molecular docking) and found it matches or exceeds vendor-optimized CUDA baselines on both NVIDIA H100 and AMD MI300A GPUs. That’s the more compelling story: not just faster than Python, but competitive with hand-tuned GPU kernels.

The AI/ML Focus

Mojo wasn’t built to be a general-purpose language. It was built to solve a specific problem: AI infrastructure is a mess.

The current AI stack looks like this:

Research code (Python)
    |
    v
Model definition (Python + PyTorch/TensorFlow)
    |
    v
Training loop (Python orchestration)
    |
    v
Inference (C++ runtime + CUDA kernels)
    |
    v
Deployment (containers, serving frameworks)

Every transition is a pain point. Research code doesn’t translate cleanly to production. PyTorch models need conversion for efficient inference. Custom operations require dropping into CUDA. The “two-language problem” isn’t just about speed – it’s about the friction of moving between abstraction levels.

Mojo’s value proposition: write the whole stack in one language.

# Define model (Python-like)
struct SimpleNN:
    var weights: Tensor[DType.float32]
    var bias: Tensor[DType.float32]

    fn forward(self, x: Tensor[DType.float32]) -> Tensor[DType.float32]:
        # This compiles to optimized GPU code
        return (x @ self.weights + self.bias).relu()

# Train (still readable)
fn train(model: SimpleNN, data: DataLoader):
    for batch in data:
        let output = model.forward(batch.x)
        let loss = mse_loss(output, batch.y)
        loss.backward()
        optimizer.step()

# Deploy to GPU (same code, just different target)
fn main():
    let model = SimpleNN.load("model.weights")
    # This runs on GPU with no conversion step
    let result = model.forward(input_tensor)

The pitch to ML engineers: stop maintaining Python research code AND C++ production code. Write once, optimize once, deploy everywhere.

Current State: December 2025

Let me be direct about where Mojo actually stands right now.

Version: 0.25.6 (September 2025). Not 1.0. Still breaking changes between releases.

Compiler: Closed source. The standard library is Apache 2.0, but the compiler itself remains proprietary. Modular has committed to open-sourcing it “as it matures.”

1.0 Timeline: Modular expects sometime in 2026.

What’s Working:

  • Basic language constructs (functions, structs, control flow)
  • Python interop (import NumPy, Matplotlib, etc.)
  • SIMD vectorization
  • GPU programming (NVIDIA Hopper/Ampere, AMD MI300)
  • Package management via pip install mojo

What’s Missing:

  • Full Python class support (structs only)
  • List/dict comprehensions
  • Lambda syntax
  • The global keyword
  • Async/await (planned for post-1.0)
  • Pattern matching (planned)

What’s Rough:

  • Error messages often show raw MLIR errors
  • IDE support is alpha-quality
  • Documentation is sparse compared to Python
  • Breaking changes between releases

The Ecosystem Reality Check

Python’s superpower isn’t the language – it’s the ecosystem. 400,000+ packages on PyPI. A library for everything. Decades of accumulated tooling.

Mojo’s answer is interoperability:

from python import Python

fn main() raises:
    let np = Python.import_module("numpy")
    let plt = Python.import_module("matplotlib.pyplot")

    let data = np.random.randn(1000)
    _ = plt.hist(data, bins=30)
    _ = plt.show()

This actually works. You can import Python modules, call them from Mojo, and get results back. For the immediate term, this bridges the ecosystem gap.

But there’s a catch: any Python interop runs at Python speed. You’re not getting 35,000x on code that calls NumPy – NumPy is already optimized C under the hood.

The real ecosystem question: who will write native Mojo libraries?

Today, if you want a Flask-like web framework in Mojo, you write it yourself. Pandas equivalent? Doesn’t exist in Mojo-native form. The standard library is growing, but it’s nowhere near Python’s breadth.

This is the classic bootstrapping problem. Libraries follow developers, developers follow libraries. Mojo needs to reach critical mass before the ecosystem becomes self-sustaining.

Honest Assessment: Replacement or Complement?

Will Mojo replace Python?

No. Not in the foreseeable future.

Python’s dominance isn’t about performance – it never was. Python won because of:

  • Gentle learning curve
  • Massive ecosystem
  • Community and documentation
  • “Good enough” performance for most use cases
  • Interoperability with C extensions where it matters

None of these advantages disappear because Mojo exists.

Will Mojo complement Python?

Almost certainly yes. The pattern emerging in 2025 is hybrid usage:

  1. Keep business logic, data processing, and orchestration in Python
  2. Port hot paths (matrix operations, custom kernels, inference loops) to Mojo
  3. Call Mojo from Python as you would call C extensions today

This is already how teams are using it. Inworld AI wrote custom GPU kernels in Mojo. Various AI startups are porting specific bottlenecks rather than rewriting entire codebases.

The migration path isn’t “rewrite everything in Mojo.” It’s “identify the 5% of code that takes 95% of runtime, and port that.”

Who Should Care Right Now

You should learn Mojo if:

  • You’re writing custom ML kernels and currently maintaining C++/CUDA alongside Python
  • You’re hitting Python performance walls in production ML systems
  • You’re interested in GPU programming but find CUDA’s ergonomics painful
  • You want to understand where language design is heading for AI workloads
  • You’re comfortable being an early adopter with rough edges

You can safely ignore Mojo if:

  • You’re building CRUD apps, web services, or data pipelines (Python is fine)
  • You need production stability right now (wait for 1.0)
  • Your team doesn’t have bandwidth for new language adoption
  • NumPy/PyTorch already handle your performance-critical code
  • You’re not working in ML/AI infrastructure

The timing question:

Learning Mojo in 2025 is like learning Rust in 2015. The language is clearly going somewhere, but there’s real risk in betting on pre-1.0 software. If you’re curious and have time to experiment, now is interesting. If you need to ship production systems, wait 12-18 months.

The Funding Reality

Modular raised $250M in September 2025, bringing total funding to $380M at a $1.6B valuation. This isn’t a hobby project – it’s a well-funded company with serious backing.

That funding means:

  • Development will continue at pace
  • Enterprise support will exist
  • The language won’t disappear overnight

But it also means Modular needs to make money. Their business model involves the MAX inference platform, not just the language. How the commercial pressure shapes Mojo’s open-source story remains to be seen.

My Take

Mojo is the most interesting language I’ve seen in years. The MLIR foundation gives it capabilities no other language has. The Python compatibility means realistic adoption paths. Chris Lattner’s track record with Swift and LLVM suggests this team knows how to ship production-quality developer tools.

But it’s also pre-1.0, ecosystem-sparse, and competing against one of the most entrenched languages in computing history. The “35,000x faster” headline is technically true but practically misleading. The migration costs for existing Python codebases are real.

My prediction: Mojo will not replace Python. It will become the “drop down to systems level” language of choice for ML/AI work, much like Cython was supposed to be but with actually good ergonomics. In three years, serious ML teams will have some Mojo in their stack. In ten years, computer science programs might teach it alongside Python for ML courses.

The language is good. The timing is early. If you’re in ML infrastructure and can tolerate rough edges, start experimenting. Everyone else: check back in 2026.


Mojo version at time of writing: 0.25.6 (September 2025) Expected 1.0 release: sometime in 2026 Minimum hardware for serious use: modern CPU with AVX-512 or GPU with CUDA/ROCm support

Sources