cx-binding-go
cxlib for Go
Why reach for it
The same C ABI, in the host's own idiom. cx-binding-go
is cxlib as a Go module: a thin wrapper over libcx's string-in,
string-out C ABI, so a Go program parses, canonicalises, hashes,
converts and evaluates CX with the very engine the cx binary runs —
byte-identical answers, nothing reimplemented.
Layer 1 is the contract every binding shares: sixteen canonical
methods — parse, bytes, hash, equals, eval, select, modify and the
node accessors — with identical semantics across hosts, so a document
hashed from Go is the document hashed from anywhere else. Identity
rides cx_canonical, cx_hash and cx_eq; selection, evaluation and
update delegate to cx_code_eval; nothing about a document is
retained inside libcx between calls. layer-1 is the table,
c-abi the surface beneath it, layer-2 the host-idiomatic
sugar above it that desugars to Layer 1.
We grade the binding against the front door's published ABI vectors —
one case per entry point a wrapper covers, an input document and the
canonical output, hash or refusal it must answer — through the
binding's own test, written in Go, which loads the file from its pin
and asserts every vector through its own wrapper. The same file is
checked against libcx directly by the front door's C test, so the
wrapper and the engine are held to one witness.
What it gives you
No CX module: a binding ships host code, not .cx files, so the table
below is the generator's note. What it gives you is the Go module
itself — the Layer-1 methods, and the package-level conveniences that
desugar to them.
This repository ships no bundled module of its own; what it gives you is above, and its links are below.
Try it
One ABI vector, replayed by this site's cx: an XML document imported
to CX through the entry point the wrapper's XmlToCx calls, and the
canonical text it must answer. The binding's own test asserts the same
vector through the wrapper; this page shows the engine's own answer.
$ cx --from=xml --to=cx input.xml
[user id=1 name=Alice]
Fixture abi-010-xml-to-cx in deps/cx-core-code/conformance/abi.cxd — replayed against this cx when the page was built.
Status
The binding is not consumed by cx — it consumes cx: its own
deps.cxd pins the front door for the C ABI and the V core it builds
libcx from, which is why the registry row carries no at= and the
figure draws no column on either side. It ships from its own
repository at its own cadence, and a pin moves there only when the
newer front door passes with it.
| fact | as the registry records it |
|---|---|
| ships as |
go-module
|
| status | extracted |
| pinned at |
96392afa6
— the registry's at=; deps.cxd carries no row for it, so nothing of it is in the build |
| builds on | none recorded — the registry row carries no pins= column yet |
| built on by | nothing pins it yet |
| bundled modules | 0 |
cx-binding-go plugs into: the repositories it builds on (left), the modules it ships (centre), the repositories that build on it (right) · drawn from registry/repos.cxd, deps.cxd and registry/modules.cxd when this page was builtLinks
- github.com/cx-home/cx-binding-go — the repository
- README — what it is, how to install it, what it pins
- The front door pins nothing of this repository, so no checkout of it is in the tree this page was built from: the two links above are the registry's row, fetched by the site's external-link step and verified against no tree here; its specification and its corpus, where it keeps them, are its own.