moxzi
Docs / Getting started / Choosing a runtime

Choosing a runtimealpha

Should I use the CLI, the server, the browser, or the on-chain builder?

moxzi is one compiler and four places to run it or its output: the moxzi CLI, the moxzid server, the moxzi-web browser package, and the compiler deployed as an IC canister. The constraint that makes the choice low-stakes is byte identity — the same compiler wasm runs in all four, and an artifact built anywhere deploys anywhere — so picking a runtime is a question of trust, latency and hosting, not of semantics.

The decision table#

Use caseUseWhyThe one thing that will bite you
Local iterationmoxzi CLIsub-second hello-world; the AOT cache reloads the 7.8 MB compiler in ~0.03 s instead of JIT-ing itfirst run on a machine pays ~1 s of JIT and says (JIT) under --timings; a big project needs --stack-budget raised or it takes minutes instead of seconds
CImoxzi CLI, or the Docker imageone binary, no dfx, no moc, no replica; provenance hash printed on every build so you can assert itcompiler.wasm/linker.wasm are not built by cargo build — CI must cache or ship them, and a job without them fails at build time, not at install time
Hosting a demomoxzid--web <actor> serves the actor's http_request interface at the root, so an actor is simply a website; state is durable across kill -9a non-loopback bind without --auth-token is refused at startup, and the /site/… gateway is open by design while the ops endpoints are not
Teaching / playgroundmoxzi-webactors and the compiler run in the tab; nothing to install, state persists to IndexedDB, deadlineMs kills a student's infinite loopa page cannot interrupt a running wasm call — deadlineMs and HTTPS outcalls both require worker: true, and outcalls additionally require COOP/COEP headers
Trustless build provenanceon-chain builder (--remote)the artifact is produced by a compiler anyone can inspect, from sources anyone can hash; the CLI still links locallythe escrow is real money and builds serialize — one canister is one job queue — and uploaded source sits in the canister's VFS where operators can read it
Running an app off-chainmoxzidIC message semantics without a subnet: rollback, timers, cycles, actor-to-actor calls, HTTPS outcalls, crash durabilityno certificates off-chain, single node, one shared token; anything depending on certified data needs the real IC

How the four relate#

The CLI is the one everything else assumes. moxzid and moxzi-web host the wasm the CLI produced; the on-chain builder replaces the compile, not the run. Nothing here is a replica emulator with consensus: moxzid and moxzi-web run one node with IC message semantics, which is the part a program can observe.

PropertyCLImoxzidmoxzi-webon-chain builder
Produces wasmyesnoin-tab compile, byte-identicalyes
Runs actorsnoyesyesn/a
Instruction meteringn/ayes (--instruction-limit, default 40e9)opt-in (meter: true), same default limit; unmetered, preemption is wall-clockn/a
Certificatesn/anonon/a
Durabilityn/asnapshot + write-ahead logIndexedDB (autosave, saveAll/loadAll)n/a
Costs moneynononoyes, when the operator has configured payment

Choosing between local and on-chain builds#

A local build and an on-chain build of the same sources produce the same bytes. That means the on-chain builder buys exactly one thing: an artifact whose production someone else can check. If nobody is going to check, build locally.

local moxzi build--remote <url> --canister <id>
Speedsecondsminutes, and it queues behind other jobs
Costfreeescrow at the CMC's live ICP↔XDR rate; settlement charges 3× actual use and refunds the rest
Who vouches for the bytesyoua canister anyone can audit
Source privacytotaluploaded files sit in the canister VFS; builds from mops tags upload nothing
Linkinglocalstill local — a deliberate, documented gap in the trust chain

On a fresh deployment payment is inert: the canister compiles for free and says so. It never silently charges.

Things you cannot do#

Next#

On this pageThe decision tableHow the four relateChoosing between local and on-chain buildsThings you cannot doNext