Skip to content

feat: syrup_lite — 550-line embeddable encoder/decoder + 112-variety fixture#4

Merged
bmorphism merged 2 commits into
plurigrid:mainfrom
bmorphism:syrup-lite
Apr 24, 2026
Merged

feat: syrup_lite — 550-line embeddable encoder/decoder + 112-variety fixture#4
bmorphism merged 2 commits into
plurigrid:mainfrom
bmorphism:syrup-lite

Conversation

@bmorphism

Copy link
Copy Markdown
Member

A minimal, zero-dependency Syrup encoder/decoder for embedding in constrained environments.

What

  • src/syrup_lite.zig — 550 LOC, full OCapN Syrup spec (11 value types)
  • test/variety_112.syrup — 6444-byte test fixture (112 Toki Pona Heyting algebra records)
  • variety_112.clj — Babashka encoder for generating Syrup from Clojure

Why

The existing syrup.zig is a 102K LOC full-stack system. This is the single-file alternative:

  • Drop into any Zig project for Syrup support
  • wasm32-freestanding compatible
  • Clean readable reference implementation
  • 22 tests + roundtrip-verified against the 112-variety fixture

Test fixture

112 Syrup records encoding the join-irreducible generators of a Heyting algebra over Toki Pona content words, each with GF(3) polarity, semantic category, chirality, bidirectional typechecking mode, and ACSS azimuth/elevation.

Roundtrip verified: Clojure encode → Zig decode → Zig encode → bitwise identical (6444 bytes).

Stats

  • 64 checkable, 48 synthesisable
  • 72 terms, 40 coterms
  • 22 unit tests on Zig 0.13.0
  • 0 fixed points in the derangement

…fixture

- Full OCapN Syrup spec: bool, int±, float32/64, bytestring, string, symbol, list, dict, record, set
- Comptime generic encodeStruct tiles over any Zig type
- Canonical comparison for sorted dicts/sets
- 22 tests passing on Zig 0.13.0
- Test fixture: 112 Toki Pona Heyting algebra records (6444 bytes, bitwise roundtrip)
- Babashka encoder for generating Syrup from Clojure
@bmorphism bmorphism merged commit 83701e4 into plurigrid:main Apr 24, 2026
2 checks passed
bmorphism added a commit that referenced this pull request Apr 24, 2026
Records the 2026-04-24 merge train disposition: #5 merged
(0.16 native path, rip compat.zig), #4 merged (syrup_lite),
#1 closed-superseded. Open PRs: none.

Local-only artifact; not pushed. Travels with the
arena_parrot_harness work-in-progress until the next push cycle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant