@felixdrp/gcf-wasm 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -92,6 +92,32 @@ text as rows arrive, and crossing into wasm for every row would cost more
|
|
|
92
92
|
than it saves. They follow the same quoting and number rules as the module,
|
|
93
93
|
and the tests check that the two agree.
|
|
94
94
|
|
|
95
|
+
## Compatibility and limits
|
|
96
|
+
|
|
97
|
+
* **Spec 3.6.0 output.** The encoder factors constant columns
|
|
98
|
+
(`## users [3]{id,name=Ada}`), as SPEC v3.6.0 §7.4.7 requires, byte for
|
|
99
|
+
byte like Blackwell's gcf-typescript 2.7.0. Decoders written for older
|
|
100
|
+
versions of the spec cannot read it: `@blackwell-systems/gcf` 2.6.1, the
|
|
101
|
+
latest on npm at the time of writing, predates spec 3.6.0 and fails with
|
|
102
|
+
`invalid field name: name=Ada`. Check the version of the decoder at the
|
|
103
|
+
other end.
|
|
104
|
+
* **JS values are normalised like `JSON.stringify`.** `encode(value)`
|
|
105
|
+
serialises with `JSON.stringify` semantics, the host-value normalisation
|
|
106
|
+
that SPEC §2.3.2 allows: `undefined` and functions are omitted, `NaN` and
|
|
107
|
+
`±Infinity` become null, array holes become null, `toJSON` is honoured
|
|
108
|
+
(so a `Date` becomes its ISO string), and a `Map` or `Set` becomes `{}`.
|
|
109
|
+
Normalise such values yourself if they matter. For exact key order
|
|
110
|
+
(numeric-looking keys), encode JSON text with `encodeJson`.
|
|
111
|
+
* **Memory keeps its peak.** Each codec has one WebAssembly memory that
|
|
112
|
+
grows to the largest payload it has handled and never shrinks
|
|
113
|
+
(WebAssembly memory cannot shrink). It is reused, not leaked, but a
|
|
114
|
+
single 300,000-row payload leaves about 150 MB reserved. In long-lived
|
|
115
|
+
processes, watch `codec.exports.gcf_memory_pages()` (64 KiB pages) and,
|
|
116
|
+
after an unusually large payload, drop the codec and create a fresh one
|
|
117
|
+
with `init(bytes)` or `init(module)`; `init()` without arguments always
|
|
118
|
+
returns the same shared instance.
|
|
119
|
+
* **Streaming encoders run in JavaScript** (see above).
|
|
120
|
+
|
|
95
121
|
## CLI
|
|
96
122
|
|
|
97
123
|
```sh
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@felixdrp/gcf-wasm",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Fast, strict codec for the Graph Compact Format (GCF v3.6.0): an 88 KB WebAssembly SIMD engine written by hand in WAT, with a zero-dependency JS API for Node, Bun, Deno, browsers and edge runtimes.",
|
|
5
5
|
"keywords": ["gcf", "graph-compact-format", "llm", "tokens", "token-efficient", "serialization", "json-alternative", "mcp", "webassembly", "wasm", "simd", "wat"],
|
|
6
6
|
"license": "Apache-2.0",
|