- Arrays allow trailing commas!
- Comments! (From a JSON perspective, that's huge!)
- Dates are UTC!
- Simple syntax, no semicolon / commas, no need to check for matching braces!
- No way to go back to the global hash. Once you go down one level, can't go back up!
inGlobal = true
[keygroup]
inKeyGroup = true
# Here, you can't add a key to the global hash!
-
You can't have mixed data in arrays unless they're both one level deep!
So, it feels like arrays are typed, except that empty arrays are not.
key = [ [1], ["foo"], [] ]
- You can't have hashes inside arrays!
# That really should be an array.
[dependancy1]
groupId = "com.google.api-client"
artifactId = "google-api-client"
version = "1.13.2-beta"
[dependancy2]
groupId = "com.google.api-client"
artifactId = "google-api-client-servlet"
version = "1.13.1-beta"
- The specification is lacking!
- A document in UTF-16 / Windows 1252 must change encoding to UTF-8 in each string!
- What happens when the keygroup is the empty string?
- Lots of (informally-specified) things you can't encode: keys with
=
in them, keygroups with]
in them… (The current spec allows=
in keys by not forbidding it.) Which special characters are allowed in keys anyway?
Alternative: the Settings File Format.
I meant the same level of the hash, as we were talking about the global hash.
What? That's precisely the reason why static languages would have a hard time with heterogeneous arrays. Hence the proposal I linked to in my first response.
I stated this before. In the current spec, arrays are typed as
array
. This includes empty arrays.If my proposal is accepted, then arrays have type
array of [toml-type]
and empty arrays have a polymorphic type. This does not make them "untyped". Every value has a type. Moreover, the only time the type of an empty array remains polymorphic is when it is a top-level value:some-key = []
. When it is part of another array that has at least one value of concrete type, the empty array adopts that type.Tuples and arrays are completely different. Clearly you don't work with staticly typed languages. If you only live in the dynamic world, then the distinction between arrays and tuples is not meaningful to you. But configuration file formats should not only cater dynamicly typed languages.
TOML doesn't have multiple encodings. It is only UTF-8.
Also...
Yes.
=
are not allowed in keys. The spec says this.Not allowed.
Anything but
.
=
,\t
orPart of the problem with the spec is that it hasn't been formalized—nor does it provide an EBNF. It's still in informal English. Give it some time to breathe before criticizing it for being imprecise.