moxzi documentation
A Motoko compiler written in Motoko, and the runtimes that execute what it builds.
moxzi is a Motoko compiler written in Motoko, together with runtimes that execute Motoko actors with Internet Computer semantics in four places: your laptop, a server, a browser tab, and the Internet Computer itself. It is 0.1.0-alpha.1, source-available under BUSL-1.1, and the pages below try to be exact about what is proven and what is not.
The one idea that explains the rest#
The compiler is an ordinary Motoko program. It has no privileged runtime, no native extensions and no build machine of its own — so anywhere a Motoko actor can run, the compiler can run too.
That single property is what produces everything else in these docs. A canister can compile Motoko because a canister can run a Motoko actor. A browser tab can compile Motoko for the same reason. And because it is one compiler rather than four ports of one, the wasm it emits is byte-identical in all four places — which is the claim the rest of this documentation exists to substantiate.
Start where you are#
<!--CHAPTERS-->
Proof over promises#
Every claim on this site maps to something you can execute. This is the checklist that runs before anything here is allowed to say "works" — make alpha-check runs all of it.
| Claim | Proof | Command |
|---|---|---|
| The compiler compiles itself on mainnet, byte-identical | 177 files, 2,345 messages; artifact 830f3e87… matches the local build exactly | moxzi build bin/compiler-canister/Main.mo --remote |
| A real 661-file application builds on mainnet, byte-identical | evm_engine, 4,138 messages, artifact 178c6429… | moxzi build ../evm.mo/src/evm_engine/main.mo --remote |
| 221 programs compile to identical bytes across independent compiler builds | two-compiler corpus sweep | PAR=6 scripts/compiler_byte_neutral.sh |
| 149 programs behave identically in a browser and natively | browser corpus sweep, 0 diverging | scripts/web_corpus_gate.sh |
| The native runtime matches a real IC replica | differential harness | scripts/moxzid_*.sh |
Actors survive kill -9 — snapshot and write-ahead-log replay | crash gate | scripts/moxzid_crash.sh |
| An actor can be a website (queries, updates, SSE) | 11-beat gate | scripts/moxzid_web_gate.sh |
| An actor can be a WebDAV drive, and survives murder | 16-beat gate | scripts/moxzid_webdav_gate.sh |
mo: package imports compile in a browser, byte-identical to the CLI | browser mops gate | scripts/web_mops_gate.sh |
| The resumable parser can be interrupted anywhere without changing bytes | seam storm | scripts/parse_seam_gate.sh |
| A runaway message in a browser costs only itself — the actor survives and its neighbours are untouched | metering gate | scripts/web_meter_gate.sh |
What a build costs on-chain#
Measured on mainnet on 2026-08-21, against canister xcn6l-iqaaa-aaaai-raq6q-cai. These are observed cycle-balance deltas, not estimates.
| Build | Source | Messages | Cycles |
|---|---|---|---|
hello.mo | 1 file, 217 B | 52 | ~0.001 T |
| the compiler, self-compiling | 177 files, 8.0 MB | 2,345 | ~1.6 T |
evm_engine | 661 files, 15.3 MB | 4,138 | ~1.6 T/attempt |
Caution: do not price a build from instruction counts. The IC bills work that
performance_countercannot observe — garbage collection, memory operations, scheduling. Measured against real spend, the counter under-reports by 2.3×–3.4×, and the ratio is not constant across workloads. Price from the measured cycle balance instead. That is what settlement does.
What this is not, yet#
This is an alpha, and the honest list is kept as a first-class page rather than a footnote. The headlines: there are no certificates off-chain, because a forged subnet signature would be worse than no signature at all; per-instruction metering in a browser is opt-in, because V8 has no fuel and a module must be instrumented to count its own; moxzid is a single node with one shared auth token; and on-chain builds serialise per canister, where the operator can read uploaded source unless you build from a mops tag.
See Limits for every bound with a number attached, and Open questions for the design problems that are still genuinely unresolved.
License#
Source-available under the Business Source License 1.1 — free for non-commercial use and for commercial development, test and evaluation. Commercial production use and competing hosted offerings require a commercial licence. Each version converts to Apache-2.0 four years after release, with a Change Date of 2030-08-31. This is not OSI open source and we do not call it that.
Next#
- Install moxzi — get the toolchain and confirm it works.
- Architecture — the moving parts, if you prefer to understand before you type.
- Choosing a runtime — a decision table, if you already know what you want to build.