Context aware
Remote, embedded, imported, type-scoped, and property-scoped contexts with protected-term and propagation behavior.
CBOR‑LD 1.0 · Swift 6 · Apple + Linux
Encode JSON‑LD into compact CBOR‑LD, restore it under explicit limits, and inspect the evidence behind every compatibility claim. The open core stands alone; optional GPU acceleration connects to the separately licensed SemanticCompute binary.
{
"@context": "…/activitystreams",
"type": "Note",
"summary": "Exact by construction"
}
Interoperability evidence
The test platform crosses Swift output through independent JavaScript, Rust, Python, and Go paths, then keeps byte consensus separate from semantic round‑trip agreement.
| Fixture | Cross-decodes | Bytes | Status |
|---|---|---|---|
| empty / uncompressed | 16 / 16 | exact | passed |
| default table | 16 / 16 | exact | passed |
| inline context | 16 / 16 | exact | passed |
| custom type table | 16 / 16 | exact | passed |
| JSON shapes | 16 / 16 | semantic | passed |
| Unicode + boundaries | 16 / 16 | exact | passed |
Measured, release mode
Explore the current in-process round-trip results. Each adapter warms up first, consumes every result through a barrier, and excludes process startup and protocol I/O.
One core, explicit boundaries
Recursive JSON trees, context inheritance, dynamic maps, and document loading remain in the native Swift core. Dense, bounded byte and integer workloads can use a separately installed, commercially licensed SemanticCompute binary through the optional adapter.
Remote, embedded, imported, type-scoped, and property-scoped contexts with protected-term and propagation behavior.
Bound input bytes, nesting depth, container sizes, duplicate keys, indefinite lengths, and preferred-width validation.
Build dictionary indexes once, deduplicate context loads, and preserve per-document semantic isolation across concurrent work.
Transport hashes, structural fingerprints, pinned resources, verification reports, and versioned out-of-band manifests.
Swift Package Manager
The core is a regular open-source Swift library. SwiftPM resolves its tagged source and chooses the appropriate linkage for your application.
The optional adapter requires the SemanticCompute binary package and a SemanticCompute licence. Its CPU fallback preserves results when a dispatch is unsuitable; it does not remove the build, link, or redistribution requirement after the adapter is imported.
dependencies: [
.package(
url: "https://github.com/entertrainmentuk/swift-cborld.git",
from: "0.1.0"
)
]
import CBORLD
let bytes = try await CBORLD.encode(document)
let restored = try await CBORLD.decode(bytes)
precondition(restored == document)