Expand description
json parse and stringify over the runtime Data graph.
Parsing maps a json document straight onto values candela already has: an object becomes a map keyed by strings, an array becomes an array, and a scalar becomes int/float/string/bool/null. No new runtime type is needed.
Parsed values allocate the way the program’s own do, reusing freed slots, so a parse can start or carry on a collection. The value is built top-down to stay reachable while it does: the outermost list or map sits on the recursion stack, a collection root, until the parse ends, and each entry goes into its parent before anything inside it is allocated. A string is interned, since a map finds a string key by its slot.
Functions§
- json_
parse - Parses a json document into a
Datagraph. A malformed document returns a short static reason. - json_
stringify - Serializes a
Datavalue to a json string.