MLSNBN: the value model beneath JSON

Map, List, String, Number, Boolean, Null: separating the values from the format that transports them.

sUTL · Guide · Reference · Examples

MLSNBN is the value model sUTL evaluates: Map, List, String, Number, Boolean, Null.

JSON is a textual syntax. A program parses that text and obtains ordinary host-language values: dictionaries or objects, lists or arrays, strings, numbers, booleans, and null. YAML, MessagePack, and CBOR can produce the same values, within the appropriate subset. A programmer can also construct them directly, with no JSON text involved.

MLSNBN names that shared model. It is a way to talk about the values without saying "JSON" when the text format is not what is meant.

MLSNBN value :=
    Map<String, MLSNBN value>
  | List<MLSNBN value>
  | String
  | Number
  | Boolean
  | Null

Map keys are strings. Lists are ordered sequences. Numbers are the JSON number domain. Boolean and null are distinct from numbers and from each other.

An API may send JSON on the wire while its real contract is MLSNBN:

HTTP bytes
    ↓ JSON decoding
MLSNBN value
    ↓ application semantics

Another encoding can replace JSON without changing that value model.

sUTL programs are MLSNBN too. A transform is not a separate source language. It is a value in this model, which a host can store, send, inspect, and evaluate like any other value.

The longer history of the idea is in the essay.

Source

Adapted from the sUTL source material.

Back to sUTL · Software & Agents · All topics

View page as JSON