slovo/.llm/BETA_7_SERIALIZATION_DATA_INTERCHANGE.md

62 lines
2.4 KiB
Markdown

# 1.0.0-beta.7 Serialization And Data Interchange Target
Status: released as `1.0.0-beta.7` on 2026-05-22.
`1.0.0-beta.7` targets a deliberately narrow serialization/data-interchange
foundation after the beta.6 networking slice. The goal is compact JSON text
construction for CLI, file, and loopback-network programs without pretending
that Slovo already has the collections and string APIs needed for a complete
JSON library.
## Slovo Source Surface
The staged source facade is `lib/std/json.slo`, importable explicitly as
`std.json`.
Exported helpers:
- `quote_string : (string) -> string`
- `null_value : () -> string`
- `bool_value : (bool) -> string`
- `i32_value : (i32) -> string`
- `u32_value : (u32) -> string`
- `i64_value : (i64) -> string`
- `u64_value : (u64) -> string`
- `f64_value : (f64) -> string`
- `field_string`, `field_bool`, `field_i32`, `field_u32`, `field_i64`,
`field_u64`, `field_f64`, and `field_null`
- `array0`, `array1`, `array2`, `array3`
- `object0`, `object1`, `object2`, `object3`
The array and object helpers accept already-encoded JSON text fragments. They
are compact construction helpers, not recursive data structures.
## Runtime Call
The facade wraps one compiler-known runtime call:
- `std.json.quote_string(value string) -> string`
The hosted runtime symbol is `__glagol_json_quote_string`. It returns a
complete compact JSON string literal including surrounding quotes. It escapes
quote, backslash, newline, tab, carriage return, backspace, form feed, and
other control bytes. Allocation failure uses the existing string allocation
trap.
## Fixtures And Benchmarks
- `examples/projects/std-import-json/` exercises explicit `std.json` source
import.
- `examples/projects/std-layout-local-json/` mirrors the facade as a local
module fixture and keeps the source-search contract explicit.
- `benchmarks/json-quote-loop/` adds a local-machine timing scaffold for JSON
string quoting across Slovo, C, Rust, Python, Clojure, and Common Lisp/SBCL.
## Deferrals
This scope does not add JSON parsing, recursive JSON values, maps/sets, generic
collections, source-level byte/character scanners, slicing, streaming encoders,
schema validation, Unicode normalization, embedded NUL support in the current
null-terminated runtime string ABI, stable runtime helper symbols, stable
ABI/layout/ownership guarantees, or a stable standard-library API freeze.