feat: implement WASM phase 1 DValue ABI

This commit is contained in:
udo
2026-06-12 12:42:56 +00:00
parent 7e2faf1472
commit 80285b7fb4
8 changed files with 657 additions and 725 deletions
+23
View File
@@ -0,0 +1,23 @@
:title
ucb_encode
:sig
String ucb_encode(DValue value)
:see
ucb_decode
0_DValue
json_encode
:content
Serializes a `DValue` to UCEB1, UCE's binary DValue wire format for the WASM membrane and future cross-instance calls.
UCEB1 is length-prefixed and binary-safe. It preserves nested maps, list-shaped maps, empty lists, and scalar bytes, including embedded NUL bytes. Use JSON/YAML/XML serializers for human-facing formats; use UCEB1 when UCE code needs the native DValue protocol.
```cpp
DValue payload;
payload["name"] = "uce";
payload["items"].push("first");
String bytes = ucb_encode(payload);
```