Getting Started with Modular’s Mojo Programming Language
Sep 30, 2026 6 Min Read 2241 Views
(Last Updated)
Ever written Python for AI work and felt the pain the moment things got slow? You’re not alone. Python is a joy to write, but it can crawl when the workload gets heavy. That’s the exact problem Modular built Mojo to solve.
Mojo Programming, now at a stable 1.0 release, gives you Python’s easy, familiar syntax with speed that can genuinely rival C++ and Rust. If you build models, run inference, or write code close to the hardware, that combination is a big deal.
This guide walks you through Mojo in plain language: what it is, why it exists, and how to actually start writing it, even if all you know is Python.
Table of contents
- TL;DR Summary
- What is Mojo?
- Why Did Modular Even Build Mojo Programming?
- Setting Up Mojo Programming on Your Machine
- Option 1: Use Pixi (the recommended way)
- Option 2: Use uv Instead
- Get VS Code Set Up Too
- Write Your First Mojo Programming Example
- Core Features of Mojo You Should Know
- Static Typing
- SIMD: Doing Many Things at Once
- Structs
- Functions in Mojo Programming: def vs fn
- def: The Familiar One
- fn: The Fast One
- Understanding the Mojo Programming Type System
- The Basic Types You'll Use
- You Don't Always Need to Spell It Out
- How Mojo Programming Handles Memory
- Ownership, in Plain Terms
- If You've Read Older Mojo Programming Tutorials, Read This
- Where Can You Use Mojo?
- Mistakes Beginners Keep Making With Mojo Programming
- Wrapping Up
- FAQs
- What is the Mojo programming language?
- Who created Mojo?
- Is Mojo the same as Python?
- How much faster is Mojo than Python?
- Do I need to know Python to learn Mojo?
TL;DR Summary
- What it is: a language built by Modular that looks and feels like Python but runs like a systems language
- Who owns it now: Qualcomm, after acquiring Modular in July 2026
- Current status: Mojo Programming hit a stable 1.0 release in 2026 and is fully open source under Apache 2.0
- What changed: the old let keyword, borrowed, and inout are gone, replaced by var, an invisible default, and mut
- What you’ll learn here: how to set it up, write your first program, and use its core features the right way
What is Mojo?

Mojo Programming was built by Modular, a company started by Chris Lattner, the guy who created Swift and did major work on LLVM and Clang. In July 2026, Qualcomm bought Modular. Lattner now runs AI software at Qualcomm, but Mojo lives on as a product under Modular’s name.
Here’s the simplest way to think about it: Mojo is basically Python, plus superpowers. Most Python code you already know will just work in Mojo Programming.
On top of that, you get things Python never gave you, like real type checking, direct control over memory, and access to the hardware underneath your code.
The whole point is simple. Give AI and ML developers a language that feels like home but runs like it was written in C.
Why Did Modular Even Build Mojo Programming?
Python is everywhere in AI and data science, and for good reason. But it has a real speed ceiling. Most teams work around this by writing the fast parts in C++ or CUDA, then wrapping that with Python. It works, but now you’re maintaining two languages instead of one, and that gets messy fast.
Mojo Programming was built to end that split. You write your data processing logic and your low-level, hardware-facing code in the same language. No more switching gears, no more gluing two codebases together.
A few things pushed Modular toward this:
- AI hardware, GPUs, TPUs, custom chips, keeps changing faster than the tools built for it
- Python’s Global Interpreter Lock stops it from truly running in parallel
- Writing CUDA or C++ extensions just to speed up Python is slow, fiddly work
- The industry genuinely needed a language that could grow alongside new hardware
That’s the gap Mojo steps into.
Setting Up Mojo Programming on Your Machine
Good news: getting Mojo Programming running is easier than it used to be, and the old setup method doesn’t even work anymore. Forget anything you’ve read about modular auth or modular install mojo. Today, you install Mojo the same way you’d install any Python package, using pixi or uv.
Option 1: Use Pixi (the recommended way)
Step 1: Install pixi
curl -fsSL https://pixi.sh/install.sh | sh
Step 2: Create a project
pixi init hello-world -c https://conda.modular.com/max/ -c conda-forge
cd hello-world
Step 3: Add Mojo
pixi add mojo
Step 4: Check it worked
pixi run mojo --version
See a version number? You’re good to go.
Option 2: Use uv Instead
If you’re already comfortable with Python’s uv tool, you can install Mojo through it just as easily.
curl -LsSf https://astral.sh/uv/install.sh | sh
uv init hello-world
cd hello-world
uv add mojo
Get VS Code Set Up Too
Modular makes an official Mojo extension for VS Code. Search “Mojo” in the extensions marketplace and grab the one published by Modular. You’ll get syntax highlighting, autocomplete, and inline errors right away.
Since Mojo Programming syntax leans so heavily on Python, brushing up your Python basics first genuinely pays off. HCL GUVI’s Code Kata is a solid way to get that practice in before you dive into Mojo.
Write Your First Mojo Programming Example
Once everything’s installed, make a new file ending in .mojo.
fn main():
print("Hello from Mojo!")
Run it like this:
pixi run mojo hello.mojo
You should see:
Hello from Mojo!
That’s it, your first bit of Mojo Programming. Notice how close it looks to Python. That’s intentional.
Core Features of Mojo You Should Know

Mojo Programming adds a handful of things Python simply doesn’t have. These aren’t nice-to-haves bolted on the side, they’re the whole reason Mojo Programming is fast. Here’s what to know early, written in Mojo’s current, correct syntax.
1. Static Typing
In Python, a variable can hold anything, anytime. Mojo lets you nail down the type explicitly, which lets the compiler squeeze out real performance. One thing worth knowing: Mojo used to have a separate let keyword for values that couldn’t change, but that’s gone now. Everything uses var.
var name: String = "Mojo"
var version: Int = 1
Want a counter you can update? Same keyword:
var counter: Int = 0
counter = counter + 1
Being explicit about types isn’t just tidiness, it gives the compiler real guarantees about your code, and that’s where the speed comes from.
2. SIMD: Doing Many Things at Once
SIMD stands for Single Instruction, Multiple Data. In plain terms, it lets your CPU do the same operation on several pieces of data at the same time, which matters a lot for AI and number-crunching work. Mojo gives you direct access to it:
from DType import float32
var vec = SIMD[float32, 4](1.0, 2.0, 3.0, 4.0)
Python can’t touch hardware like this without leaning on C libraries behind the scenes. Mojo just gives it to you directly.
3. Structs
Structs work a lot like Python classes, but they’re resolved at compile time instead of runtime, which makes them noticeably faster where performance matters. One syntax note: the old inout self pattern is gone too, it’s out self now.
struct Point:
var x: Float32
var y: Float32
fn __init__(out self, x: Float32, y: Float32):
self.x = x
self.y = y
Structs are copied by default, not passed by reference, which quietly saves you from a whole category of bugs in concurrent code.
Want to go deeper into Python itself before tackling Mojo? HCL GUVI’s free Python Ebook covers libraries and advanced concepts in plain language, a solid warm-up before this.
Functions in Mojo Programming: def vs fn
Mojo Programming gives you two ways to write a function, and knowing the difference matters.
1. def: The Familiar One
def works just like Python. It’s loose, dynamically typed, and instantly familiar if you’re coming from Python.
def greet(name):
print("Hello, " + name)
Reach for def when you’re prototyping, scripting quickly, or want Python compatibility.
2. fn: The Fast One
fn is stricter. It demands explicit types and enforces clear rules about ownership and mutability.
fn add(a: Int, b: Int) -> Int:
return a + b
This strictness in Mojo Programming is exactly what lets the compiler optimize aggressively. Simple rule of thumb: use def when you want flexibility, use fn when you want speed.
Understanding the Mojo Programming Type System
This is genuinely one of Mojo Programming’s best features, so it’s worth slowing down here.
Python is dynamically typed, full stop. Mojo gives you a choice: write loose, Python-style code when you want flexibility, or lock in static types when performance matters more.
The Basic Types You’ll Use
- Int: whole numbers
- Float32 / Float64: decimal numbers
- Bool: true or false
- String: text
- SIMD: vectorized numeric data
You Don’t Always Need to Spell It Out
Mojo can often figure out the type on its own:
var score = 95 # Mojo infers this as Int
That said, for anything performance-critical, spelling the type out explicitly is usually the smarter move. It removes any guesswork and hands the compiler everything it needs.
How Mojo Programming Handles Memory
This is where Mojo Programming genuinely departs from Python, and it’s worth understanding, even just the basics.
Python cleans up memory for you automatically with a garbage collector. Convenient, sure, but it comes with unpredictable pauses and overhead you can’t fully control.
Mojo takes a different route, borrowed from Rust’s ownership model.
Ownership, in Plain Terms
Every value in Mojo has an owner. When you hand a value to a function, one of three things happens:
- The function just reads it (this is the invisible default, you rarely write it out)
- The function changes it in place
- The function takes ownership, and the original variable gives it up
Here’s the syntax. Note that the old borrowed and inout keywords are both gone: borrowed is just implicit now, and inout became mut.
fn read_value(x: Int):
print(x) # read-only by default
fn modify_value(mut x: Int):
x = x + 1 # this actually changes x
You don’t need to master every corner of Mojo Programming’s memory model on day one. Just knowing that Mojo hands you real control over memory, instead of leaving it entirely to a garbage collector, will make error messages click faster later on.
Modular has benchmarked Mojo at over 35,000x faster than Python on certain numerical computing tasks. This is not because Mojo’s syntax is smarter, it is because Mojo compiles down to native machine code via LLVM and can leverage hardware features like SIMD that Python’s interpreter cannot access directly. For AI inference workloads, this kind of performance difference is genuinely transformative.
If You’ve Read Older Mojo Programming Tutorials, Read This
Mojo Programming syntax has moved fast, fast enough that a lot of tutorials and even AI-written code online are already out of date. If code you copied online won’t compile, this table is probably why.
| Old Syntax (Removed) | Current Syntax | What Changed |
|---|---|---|
| let x = … | var x = … | The let keyword is gone entirely; var handles everything now |
| fn foo(borrowed x: Int) | fn foo(x: Int) | borrowed is now the silent default, you don’t write it |
| fn foo(inout x: Int) | fn foo(mut x: Int) | inout was renamed to mut |
| fn init(inout self) | fn init(out self) | Initializers now use out self |
| -> T as name | out name: T | Named results use out argument syntax now |
Spot anything from the left column in a Mojo Programming tutorial? Treat it as outdated. Current Mojo will warn you, or flat-out refuse to compile it.
Where Can You Use Mojo?

Mojo Programming is still young, even with a 1.0 release under its belt, but its real-world uses are already pretty clear.
Building AI models. Writing custom neural network layers or attention mechanisms that need to run fast, without depending on someone else’s pre-built CUDA kernels.
Fast inference in production. Wherever latency actually matters, Mojo can run AI model inference noticeably faster than a Python-based pipeline.
Writing code for the hardware itself. Low-level code that runs directly on GPUs, TPUs, or custom AI chips. Mojo’s SIMD support makes this reachable without dropping into raw CUDA or C++.
Scientific computing. Physics simulations, genomics, financial modeling, anywhere heavy number-crunching happens, Mojo speeds things up without asking you to give up Python’s ecosystem.
Replacing C++ extensions. A lot of Python libraries lean on C++ under the hood for speed. Mojo can take that over with code that’s genuinely easier to read and maintain.
Want to build real skills in this space? HCL GUVI’s Intel & IITM Pravartak Certified Artificial Intelligence & Machine Learning Course, co-designed with Intel, covers Python, Machine Learning, Deep Learning, Generative AI, Agentic AI, and MLOps.
It runs through live classes, 20+ real projects, and 1:1 doubt-clearing sessions, with placement support from over 1000 hiring partners.
Mistakes Beginners Keep Making With Mojo Programming
A few habits trip people up more than anything else, especially given how much Mojo’s syntax has shifted recently.
- Copying let, borrowed, or inout from an old tutorial. As covered above, all three are gone. If your code won’t compile, this is very often why.
- Following outdated install steps. The old modular install mojo command doesn’t exist anymore. Use pixi or uv, as shown earlier.
- Assuming Mojo needs to replace Python everywhere. It doesn’t. For everyday scripts and glue code, plain Python is often just simpler.
- Writing everything in def and never touching fn. Convenient, sure, but you’re leaving the whole point of Mojo, the speed, on the table.
- Ignoring compiler warnings about old syntax. Mojo evolves fast. Today’s warning is often tomorrow’s hard error.
Wrapping Up
Mojo Programming takes the Python syntax millions of developers already know and pairs it with speed that used to be exclusive to C++ or CUDA. That’s a genuinely rare combination.
Mojo Programming has grown up fast, from its 2023 debut, through a full syntax overhaul, to a stable 1.0 release in 2026, now backed by Qualcomm’s resources after the Modular acquisition. If you work in AI, machine learning, or performance-heavy computing, it’s worth your attention.
Best way to start? Set up your environment with today’s tools, write a few small programs, and notice where it differs from Python as you go. The shift is gradual, and everything you already know about Python is a real head start.
FAQs
1. What is the Mojo programming language?
Mojo is a high-performance programming language developed by Modular. It is designed as a superset of Python, adding static typing, manual memory control, and hardware-level access to deliver performance comparable to C++, while keeping Python’s familiar syntax.
2. Who created Mojo?
Mojo was created by Modular, a company founded by Chris Lattner, who also created the Swift programming language and contributed significantly to LLVM and Clang.
3. Is Mojo the same as Python?
Mojo is not the same as Python, but it is designed to be compatible with it. Most Python syntax is valid in Mojo, but Mojo adds features like static typing, fn functions, structs, and direct hardware access that Python does not have.
4. How much faster is Mojo than Python?
Modular has reported benchmarks showing Mojo running over 35,000x faster than Python on specific numerical tasks. Real-world performance gains vary by use case, but Mojo is consistently much faster for compute-heavy workloads.
5. Do I need to know Python to learn Mojo?
Python experience is helpful because Mojo’s syntax is similar, but it is not strictly required. If you are new to both, starting with Python basics first will make learning Mojo more intuitive.



Did you enjoy this article?