feat: syrup_lite — 550-line embeddable encoder/decoder + 112-variety fixture#4
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 ClojureWhy
The existing
syrup.zigis a 102K LOC full-stack system. This is the single-file alternative: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