Skip to content

serde v0.2 — JSON Parser with Extern Storage Backend

Choose a tag to compare

@murphsicles murphsicles released this 05 May 09:22
· 13 commits to main since this release

serde v0.2 — JSON Parser

Adds JSON parsing infrastructure: validate, parse, and store structured data via an extern C bridge.

What's new

  • src/parser.z — JSON parser with structural validation
  • runtime.c — extern buffer for character input and node storage
  • validate_json() — returns 1 for valid JSON, 0 for invalid
  • Works around Zeta compiler array-in-function-parameter limitations

Architecture decision

Zeta currently has a known limitation where array access across function boundaries generates map_get/map_insert calls. This release introduces an extern C storage layer that avoids this entirely — all data flows through serde_store()/serde_load()/serde_read_char() extern functions. This design is future-proof: when the compiler matures, we can move the storage back to pure Zeta arrays.

Testing

Compiled and validated with zetac (dev branch), Intel i9-13900H, WSL2.