Skip to content

mojo-json

mojo-json is a JSON serializer written in Mojo. The runtime and the code generator are Mojo. They do not wrap simdjson or any other C, C++, or Rust JSON library.

  • Why JSON


    What JSON is, how objects, arrays, strings, and numbers work, and how pretty-print, JSON Lines, Pointer, and Patch fit together.

    Read Why JSON

  • Instructions


    Install Mojo 1.1.0 with pixi, write a JSON Schema, generate Mojo, run the tests, and publish this site.

    Open Instructions

  • Examples


    Encode and decode generated types, JsonValue, JSON Lines, pretty-print, Pointer, and Patch.

    See Examples

  • Techniques


    How encode and decode work: pre-sized writes, SIMD scan, SWAR digits, one-pass floats, and which ideas were measured and dropped.

    Read Techniques

  • Test data


    What lives under testdata/ (schemas, oracle text, JSON Lines, Pointer samples) and why each file is there.

    Read Test data