CI green. The example works end-to-end. #45
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "atoms"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What landed
examples/bson-decode/ — a self-contained Go program (no external deps) that demonstrates the complete
bson→readable decode pipeline:
atom ids against the cached map, renders atoms/compounds/lists/vars readably.
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.