A TOML alternative for nested configuration
TOML is explicit about types, which is why people like it. Nesting is where it gets awkward: every level is a dotted header, and a list of records is a run of [[arrays.of.tables]]. NOVA keeps the explicit types and writes nesting as indentation.
config.toml [[services]]
id = "auth"
port = 8080
[[services.volumes]]
path = "/data"
[[services]]
id = "api"
port = 3000config.nova services:
- id: auth
port: 8080
volumes:
- path: /data
- id: api
port: 3000Children are indented exactly two spaces. Any other indentation is an error, not a different structure. Block structure, spec §4.3
What changes
| Topic | TOML | NOVA | Spec |
|---|---|---|---|
| Nesting | Dotted table headers | Indentation, exactly two spaces per level | §4.3 |
| Lists of records | Arrays of tables, [[x]] | Block lists, or a table with a row count | §4.9 |
| Null | None; leave the key out | null is a value, distinct from an absent field | §2 |
| Integers | 64-bit, with hex, octal, binary and _ separators | Exact and arbitrary size; decimal digits only | §4.5 |
| Dates | Offset and local date-times, dates and times | Timestamps are instants; the offset is not kept | §2.6 |
| Validation | External tools | A built-in schema language | §6 |
Migrating
Convert in either direction. Going back to TOML works when the root is a record and nothing is null; a list of records becomes an array of tables again.
nvf convert config.toml --to nova -o config.nova
nvf convert config.nova --to tomlAn offset date-time becomes a timestamp. Local dates and times become strings, because NOVA has no local kinds. TOML mapping, spec §11.2
When to stay with TOML
- Your tool reads TOML, such as Cargo or
pyproject.toml. Keep TOML there. - Your configuration is flat. With one or two levels, TOML’s headers cost little, and nothing has to be indented.
- You rely on local dates or times, such as an opening hour without a time zone. NOVA would read them as strings.
Questions
Does NOVA have inline tables?
Yes, as flow records: {id: auth, port: 8080}. Flow lists, tuples, sets and maps work the same way and may span lines inside the brackets.
Why go back to indentation?
Because it is fixed by the grammar. Children are indented exactly two spaces, tabs are not allowed in indentation, and anything else is an error.
Are bare words typed like in YAML?
No. A bare word is a string unless it is true, false, null or a strict number, so the explicitness you get from TOML stays.