Skip to content
This repository was archived by the owner on Nov 22, 2026. It is now read-only.

mojo-json v0.1.0

Choose a tag to compare

@amarbarosys amarbarosys released this 21 Oct 10:19
· 28 commits to main since this release

mojo-json v0.1.0

Released: 2026-10-21 · Commit: the one tagged v0.1.0 · Previous: first release

What it does

JSON for Mojo: a strict RFC 8259 parser and a writer whose output is byte for byte the same as Python's json.dumps, in the compact, default and indented layouts.

Highlights

  • Passes JSONTestSuite: all 95 must-accept files with the same values as Python, all 188 must-reject files rejected.
  • Writer identical to json.dumps on 516 generated documents in 4 layouts, floats included (rounded half to even, as Python does).
  • Parse 3.6x faster than Python's C-accelerated json (4.6 MB, 20 passes: 199 to 206 ms vs 734 to 763 ms); dumps 1.6x faster; same peak memory.

Changes

First public release, no earlier version.

Verified

Check Result
scripts/check.sh: JSONTestSuite 318 files vs a Python oracle PASS all, 0 failures
scripts/check_gen.sh: 531 generated documents decoded, 516 encoded in 4 layouts, vs Python PASS all, 0 failures
12 mutants of the library all killed by the two gates
scripts/ci.sh on a pristine Ubuntu 24.04.5 VM PASS ci

Known limits

  • No streaming parser, no big integers, no NaN or Infinity in parsed documents.
  • Duplicate keys are kept in order; get returns the first.
  • Nesting depth stops at 1000.

Upgrade / run

git clone https://github.com/amarbaro/mojo-json && cd mojo-json && uv sync
mojo run -I src examples/quickstart.mojo

Commits

  • v0.1.0 first public release (one commit)