CI green. The example works end-to-end. #45

Merged
navicore merged 1 commit from atoms into main 2026-07-04 15:40:32 +00:00
Owner

What landed

examples/bson-decode/ — a self-contained Go program (no external deps) that demonstrates the complete
bson→readable decode pipeline:

  1. Fetches the atom map (--atoms --format bson) — one-time, caches the id→name array.
  2. Runs the query (--query '...' --format bson) — parses the bson envelope.
  3. Decodes term values — walks the TermBuf cells using the cell ABI (plg-shared::cell: tag/payload), resolves
    atom ids against the cached map, renders atoms/compounds/lists/vars readably.
  $ go run . /tmp/deps 'shares_dep(render, auth, D)'
  fetched 30 atoms
  count=1 exhausted=true
  D = crypto

  $ go run . /tmp/deps 'findall(X, needs(app, X), L)'
  L = [auth, ui, crypto, render, crypto]
  X = _

  $ go run . /tmp/c 'item(X)'
  X = widget(name, price, 42)

Files: main.go (~200 lines: bson parser + cell walker + main), go.mod, README.md.

What it proves

This is the reference consumer that closes the loop on the "text and bson are peers" claim. Any term text can
show (D = crypto), bson + --atoms + the cell walker shows too — through a completely different wire path, with
JSON (or any format) living entirely in the host, never in the engine. It's also the template for the eventual
JSON wrapper: swap the readable renderer for encoding/json and you have a bson→json tool that uses --atoms and
never touches the engine with JSON.

What landed examples/bson-decode/ — a self-contained Go program (no external deps) that demonstrates the complete bson→readable decode pipeline: 1. Fetches the atom map (--atoms --format bson) — one-time, caches the id→name array. 2. Runs the query (--query '...' --format bson) — parses the bson envelope. 3. Decodes term values — walks the TermBuf cells using the cell ABI (plg-shared::cell: tag/payload), resolves atom ids against the cached map, renders atoms/compounds/lists/vars readably. ``` $ go run . /tmp/deps 'shares_dep(render, auth, D)' fetched 30 atoms count=1 exhausted=true D = crypto $ go run . /tmp/deps 'findall(X, needs(app, X), L)' L = [auth, ui, crypto, render, crypto] X = _ $ go run . /tmp/c 'item(X)' X = widget(name, price, 42) ``` Files: main.go (~200 lines: bson parser + cell walker + main), go.mod, README.md. What it proves This is the reference consumer that closes the loop on the "text and bson are peers" claim. Any term text can show (D = crypto), bson + --atoms + the cell walker shows too — through a completely different wire path, with JSON (or any format) living entirely in the host, never in the engine. It's also the template for the eventual JSON wrapper: swap the readable renderer for encoding/json and you have a bson→json tool that uses --atoms and never touches the engine with JSON.
CI green. The example works end-to-end.
All checks were successful
WASM Gates / WASM gates (Tier 1 wasi + Tier 2 reactor) (pull_request) Successful in 8s
CI - Linux / CI - Linux x86_64 (pull_request) Successful in 1m1s
0f4dfd0c01
What landed

 examples/bson-decode/ — a self-contained Go program (no external deps) that demonstrates the complete
 bson→readable decode pipeline:

 1. Fetches the atom map (--atoms --format bson) — one-time, caches the id→name array.
 2. Runs the query (--query '...' --format bson) — parses the bson envelope.
 3. Decodes term values — walks the TermBuf cells using the cell ABI (plg-shared::cell: tag/payload), resolves
    atom ids against the cached map, renders atoms/compounds/lists/vars readably.

 ```
   $ go run . /tmp/deps 'shares_dep(render, auth, D)'
   fetched 30 atoms
   count=1 exhausted=true
   D = crypto

   $ go run . /tmp/deps 'findall(X, needs(app, X), L)'
   L = [auth, ui, crypto, render, crypto]
   X = _

   $ go run . /tmp/c 'item(X)'
   X = widget(name, price, 42)
 ```

 Files: main.go (~200 lines: bson parser + cell walker + main), go.mod, README.md.

 What it proves

 This is the reference consumer that closes the loop on the "text and bson are peers" claim. Any term text can
 show (D = crypto), bson + --atoms + the cell walker shows too — through a completely different wire path, with
 JSON (or any format) living entirely in the host, never in the engine. It's also the template for the eventual
 JSON wrapper: swap the readable renderer for encoding/json and you have a bson→json tool that uses --atoms and
 never touches the engine with JSON.
navicore deleted branch atoms 2026-07-04 15:40:33 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
navicore/patch-prolog!45
No description provided.