A JSON alternative with comments, timestamps and exact decimals
JSON has one number type, no dates and no comments, and leaves duplicate keys to the parser. NOVA reads JSON as it is, adds those types, and rejects a duplicate key everywhere.
order.json {
"id": 9007199254740993,
"price": 19.99,
"created": "2026-11-17T16:00:00Z",
"role": "user",
"role": "admin"
}order.nova # comments are allowed
id: 9007199254740993
price: @decimal("19.99")
created: @timestamp("2026-11-17T16:00:00Z")
role: adminThe JSON file on the left does not convert: nvf stops at the second "role" and says where it is. Records, spec §2.10
What changes
| Topic | JSON | NOVA | Spec |
|---|---|---|---|
| Comments | None | # comments, kept by the formatter and by patches | §4.1 |
| Numbers | One number type; precision depends on the reader | int, float, decimal and rational are distinct, and integers are exact | §2.5 |
| Dates and durations | Strings by convention | @timestamp(…) and @duration(…), or a schema field that resolves the string | §4.8 |
| Duplicate keys | Left to the parser; often the last one wins | Rejected by every parser and decoder | §2.10 |
| Other kinds | Objects and arrays | Also sets, tuples, maps with any key, variants and bytes | §2 |
| Hashing | Needs a separate canonicalization scheme | One canonical encoding, so every value has a SHA-256 revision | §2.13 |
Migrating
nvf reads JSON directly, so you can start with queries before converting anything. Converting is lossless: objects become records, and numbers without a fraction or exponent become exact integers.
nvf convert order.json --to nova -o order.nova
nvf get api-response.json 'items[?price<10].name' -rA duplicate key stops the conversion $ nvf convert order.json --to nova
× order.json: JSON byte 103: duplicate key "role"Going back $ nvf convert order.nova --to json --strict
× conversion to JSON is lossy:
│ .id: integer beyond ±2^53 may lose precision in many JSON readers
│ .price: decimal written as a string
│ .created: timestamp written as an RFC 3339 stringWithout --strict the same conversion succeeds and prints the losses as warnings. Decimals, timestamps and durations become strings. JSON mapping, spec §11.1
When to stay with JSON
- A browser or an API client reads the data. Every platform has a JSON parser; NOVA has a Rust implementation today, with other languages planned. Convert at that boundary with
nvf convert --to json. - You need a format that is stable today. NOVA is a 0.1 draft, and minor versions must match exactly while the major version is 0.
Questions
Can nvf read my JSON files without converting them?
Yes. nvf get and nvf convert detect JSON and JSON Lines input, so curl … | nvf get - 'items[?price<10].name' -r works like jq -r.
What happens to timestamps and decimals when I write JSON?
They are written as their canonical text in a string, and the converter reports each one. Sets and tuples become arrays, maps become arrays of [key, value] pairs, and a variant with a payload becomes {"tag": payload}.
Why is price: 19.99 not a decimal?
A bare number with a fraction is a float, as in JSON. Write @decimal("19.99"), or type the field decimal in a schema and leave the number plain.