What this is about
Most teams pick one language for the web page, one for the data scripts, one for the fast parts and one for the graphics card. We tried to pick one for as much as we could: Mojo. Our command-line tools, our libraries and the code that runs on our graphics card are all written in it.
This article explains why, in plain words. It also lists what we paid, because a choice with no cost is usually a choice nobody has looked at closely.
Why it matters
Every language switch costs time. You rewrite code, you translate ideas, and you can introduce a bug at each border. If you run a small lab, that time is most of your budget.
If you are a beginner, the lesson is the same at a smaller size. A tool in one language is easier to read, test and fix than the same tool split in three. You do not need to copy us. You need to know what you give up when you choose.
What we got
1. The same source on the CPU and the GPU. Our engine, mojo-baro, runs language models on one AMD RX 7900 XTX. Every GPU kernel in it is Mojo. We also wrote one exponential function, fexp32, in Mojo and ran it on both the processor and the graphics card. Over 40,017 test inputs the two sides gave different answers on 0 of them. With the standard function they disagreed on 19,437. That is hard to do if each side has its own language.
2. Small libraries that copy tools we already trust. Our mojo-libs table lists 38 libraries. Each is a Mojo copy of something people know, such as Python's json, csv, subprocess or argparse. Because the original is a Python program, we can run both on the same input and compare the output. We call the original the oracle. Article 5 in this series shows how.
3. One style for everything. A command-line tool, a library and a GPU kernel look alike. The same person can read all three, and so can a coding assistant that helps us.
4. Speed where it counts. In our READMEs, mojo-args is about 13 times faster than argparse on 200,000 parses. mojo-semver parses a version in 42 ns against 1,579 ns for the Python package, measured on a Ryzen 7 7800X3D. A command that starts often feels these savings.
What it cost
The compiler changes. Mojo is young. Version 1.1 removed one form of if with a variable. Version 1.2 clashed with a helper we had declared. We keep a ledger file of known compile errors, and our porting tool feeds it back to the model that helps us write code. We also build every library against the weekly nightly release, so we hear about breaks early.
It is not all Mojo. In mojo-baro, the web server in front of the engine is written in Rust. It handles the chat template, the tokenizer and the request queue. Building the engine also needs CMake and a C++ compiler for one small shim. In Mojo libraries, mojo-gzip calls the system libz, because that library is already excellent. We use the best part of each world and we say so.
Some things are slower. Our mojo-hashlib hashes 64 MiB with sha256 in 145 to 150 ms. Python takes 27 to 28 ms, because OpenSSL uses special processor instructions. We did not hide that row.
Small mistakes hide in hot loops. In our zstd work, an array that checks its bounds on every write cost about 15 percent. The program went from 68 to 80 MB per second when we wrote through a raw pointer instead. Nothing in the source showed the cost. We found it by reading the machine code.
The toolchain is a moving date. The mojo-baro README says the move to Mojo 1.2.0 happened on 2026-10-29. Rows measured before that date are marked as older. We have to carry the toolchain version next to every number.
When we leave Mojo
Sometimes a small loop behind a C interface is easier in another language. We have a separate article on that. Mojo is our default, not our rule.
A rule of thumb for your own choice
You do not have to use Mojo to learn from this. Here are the questions we ask before we pick a language for a tool.
- Does a trusted version already exist? If yes, we can copy it and compare. That favors a language where we can write the copy close to the original's behavior.
- Will it run many times, or on a lot of data? If it runs once a week on a small file, speed does not matter and we pick whatever is quickest to write.
- Does it touch the graphics card? Then we want the card code and the rest in one place, so that one person can follow a result from the command line to the kernel.
- Is a mature library already the right answer? Then we call it, as
mojo-gzipcallslibz, and we do not rewrite it.
Notice that none of these questions says "which language is best". They ask what the job needs, and they allow a different answer on a different day.
Words you may not know
- Oracle: a trusted program whose output you compare with yours.
- GPU kernel: a small function that runs on the graphics card, many copies at once.
- Nightly release: the newest build of a tool, made every night and less tested.
- Shim: a thin layer of code that joins two parts that do not fit.
- Library: code you import, so you do not write it again.
Try it
- Browse the mojo-libs table and note which row replaces a Python module you use.
- Open the mojo-baro project page to see a whole engine in one language, plus the Rust edge.
- Read the mojo-baro repository and look at its
kernelsfolder. Every file there is Mojo.
Read next
- Same bits on the CPU and the GPU explains the shared exponential in full, with its costs.

Comentarios
Aún no hay comentarios.
Iniciar sesión para comentar.