GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(id): Zig guest SDK skeleton with json + grid helpers (#12596) by dezren39 · Pull Request #12793 · developing-today/code

Conversation

@dezren39

@dezren39 dezren39 commented Nov 23, 2026 •
edited by blacksmith-sh Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Refs #12596

First slice of the third guest language (Phase 12 exit criterion 3: guest languages with a passing conformance suite, at least 3; results-first plan step A7). It moves the acceptance criterion "a Zig guest SDK with screen, json, grid, and cap helpers equal to the Roc libraries" from nothing to two of the four helpers landed and tested — it does not close the issue.

What this slice lands

  • pkgs/id/examples/zig-sdk/src/json.zig: Zig port of RocJson — value type, decode/encode with the same 64 KiB in/out limits and 64-level nesting limit, exact number lexemes, same DecodeError codes (InvalidJson 0 … WrongType 6). Tests mirror the Roc expect cases, including the 64-depth and 64 KiB limit cases.
  • pkgs/id/examples/zig-sdk/src/grid.zig: Zig port of RocGrid — bounded row-major grids with never-trapping get/set, neighbors4, row/bytes/dimensions/fromCells.
  • build.zig / build.zig.zon: static library + zig build test; minimum Zig 0.16.0, matching the tree's Zig pin (the roc-world host's build.zig.zon wants 0.16).
  • zig-toolchain.sh: version guard mirroring roc-toolchain.sh, pinned via new pkgs/id/nix/zig-version (0.16.0).
  • zig-sdk-test.sh: guard + zig fmt --check + zig build test + a wasm32-freestanding build proving the SDK compiles for the guest target.
  • .gitignore: Zig build outputs (.zig-cache, zig-out) ignored.

Two deliberate differences from Roc, documented in the README and at the use site: memory is explicit (caller-provided allocator; an arena is the natural fit in a wasm32-freestanding guest), and Grid.set mutates in place instead of returning a new grid.

Verification (local, no laptop needed)

Downloaded pinned Zig 0.16.0 (verified shasum) to ~/tools/zig-0.16.0 and ran ZIG=~/tools/zig-0.16.0/zig bash zig-sdk-test.sh:

  • Version guard: "Using pinned Zig compiler 0.16.0"
  • zig fmt --check: clean
  • zig build test --summary all: 31/31 tests passed
  • zig build -Dtarget=wasm32-freestanding: OK (SDK compiles for the guest target)

No Rust changes, no laptop build needed for this slice.

What remains on #12596

  1. screen helper (Zig port of Screen, including render_json).
  2. cap helper (Zig port of RocCap).
  3. A playable example world (e.g. zig-counter, mirroring roc-counter) exporting the Plaza ABI v1 surface from roc-world/ABI.md.
  4. A conformance run of that example against the F12.7 suite, and wiring zig-sdk-test.sh into the roc-test just recipe once the nix-provided Zig version is confirmed to be 0.16.0 (deliberately left out of this slice rather than risk breaking just ci).

Run Proof on this PR
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
dezren39 added 2 commits November 23, 2026 02:58
@dezren39
feat(id): Zig guest SDK skeleton with json + grid helpers (#12596)
9c2a95c
First slice of the third guest language (Phase 12 exit criterion 3,
results-first plan step A7): the Zig SDK skeleton plus the two pure
helpers everything else builds on.

- src/json.zig: Zig port of RocJson — value type, decode/encode with
  the same 64 KiB in/out limits and 64-level nesting limit, exact
  number lexemes, same DecodeError codes (0-6). Tests mirror the Roc
  expect cases, including the 64-depth and 64 KiB limit cases.
- src/grid.zig: Zig port of RocGrid — bounded row-major grids with
  never-trapping get/set, neighbors4, row/bytes/dimensions/fromCells.
  set mutates in place (Zig idiom) instead of returning a new grid.
- build.zig / build.zig.zon: static library + zig build test; minimum
  Zig 0.16.0, matching the tree's Zig pin.
- zig-toolchain.sh: version guard mirroring roc-toolchain.sh, pinned
  via pkgs/id/nix/zig-version.
- zig-sdk-test.sh: guard + zig fmt --check + zig build test +
  wasm32-freestanding build.

Refs #12596
@dezren39
chore: ignore Zig build outputs (.zig-cache, zig-out) (#12596)
740615b
zig build writes its cache and install tree next to build.zig; keep
them out of the tree so the new zig-sdk cannot be committed with
build artifacts.
@dezren39
dezren39 requested a review from a team as a code owner November 23, 2026 02:59
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 73200be2-6226-4d37-b8ca-94183e405a99
Commits

Reviewing files that changed from the base of the PR and between 4768d8a and 740615b.

Files selected for processing: 10

  • .gitignore
  • pkgs/id/examples/zig-sdk/README.md
  • pkgs/id/examples/zig-sdk/build.zig
  • pkgs/id/examples/zig-sdk/build.zig.zon
  • pkgs/id/examples/zig-sdk/src/grid.zig
  • pkgs/id/examples/zig-sdk/src/json.zig
  • pkgs/id/examples/zig-sdk/src/root.zig
  • pkgs/id/examples/zig-sdk/zig-sdk-test.sh
  • pkgs/id/examples/zig-sdk/zig-toolchain.sh
  • pkgs/id/nix/zig-version
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

  • X
  • Mastodon
  • Reddit
  • LinkedIn
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dezren39 dezren39 mentioned this pull request Nov 23, 2026
id: F12.8/A7 third guest language — Zig SDK passing conformance with a playable example #12596
Closed
dezren39 added a commit that referenced this pull request Nov 23, 2026
@dezren39
feat(id): Zig guest SDK screen + cap helpers (#12596)
1a89181
Zig ports of the Roc Screen and RocCap libraries, completing the
four-helper parity the issue asks for (screen, json, grid, cap):

- src/screen.zig: cell-grid Screen with putText/putRow/putGrid/
  fill/rule/boxed and renderPlain/renderJson/renderAnsi plus
  renderRowsJson and boxEdge. The JSON screen document is
  byte-for-byte the Roc one (run-length style spans, default runs
  omitted, rows padded to width); tests mirror the Screen.roc
  expect cases.
- src/cap.zig: RocCap Session (issue/attach/requests/counter/
  fromPending/answered/done/isEmpty) and the eight request
  document builders, on top of the SDK json values; documents
  encode byte-for-byte like Roc.

Drawing and session updates mutate in place (the grid port's
precedent); renders and documents allocate from a caller-provided
allocator. Verified with pinned Zig 0.16.0: zig fmt --check clean,
zig build test green (22 new tests), wasm32-freestanding build OK
via zig-sdk-test.sh.

Stacked on xaltha/12596-zig-sdk (PR #12793, slice 1) — retarget to
main once that merges. Refs #12596.
This was referenced Nov 23, 2026
feat(id): Zig guest SDK screen + cap helpers (#12596) #12827
Merged
feat(id): Zig counter example world on the Zig SDK (#12596) #12837
Merged
@dezren39
dezren39 removed the request for review from a team November 23, 2026 05:56
@dezren39
dezren39 merged commit 81f24b9 into main Nov 24, 2026
2 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@dezren39
dezren39 deleted the xaltha/12596-zig-sdk branch November 24, 2026 00:26
@dezren39 dezren39 mentioned this pull request Nov 24, 2026
test(id-worlds): add zig-counter to the F12.7 conformance modules (#12596) #14470
Merged
@developing-today-fleet developing-today-fleet Bot added audit:partial PR partially implemented; gap filed audit:completed-later Gap completed by later merged PR and removed audit:partial PR partially implemented; gap filed labels Nov 27, 2026
@developing-today-fleet developing-today-fleet Bot mentioned this pull request Nov 27, 2026
AUDIT-7 Lane 4 — MERGED-PR-AUDIT: merged PRs since 2026-10-23 vs their spawning issues #13879
Open
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

audit:completed-later Gap completed by later merged PR

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@dezren39
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.