TAO: compact lists

Note: This is subject to future work. Errors, ambiguities, and omissions are to be expected.

The following JSON array:

["parsley", "sage", "rosemary", "thyme"]

may be represented in TAO as:

[parsley][sage][rosemary][thyme]

or

[[parsley][sage][rosemary][thyme]]

Because TAO is a minimal syntax, both of these forms are much more compact. Compactness is a feature of TAO.

However if we compare a similar S-expression:

(parsley sage rosemary thyme)

or even CSV1:

parsley,sage,rosemary,thyme

We see that these are significantly more compact. It may become apparent that each value in the list incurs an overhead of an additional character compared to S-expressions or CSV. This might be significant for a very long list of values like this.

In such case a special grammar for single-character-delimited values may be imposed either explicitly or implicitly (to further save characters) in TAO. S-expressions or CSV themselves might be embedded.

However, this is not necessary nor desirable in the general case of a list.

The encoding for lists that TAO suggests allows for easy recursive extension of each value by simply adding further levels of nested brackets:

[parsley[fresh]][sage][rosemary[dried]][thyme]
`; or
[[parsley[fresh]][sage][rosemary[dried]][thyme]]

In the case of S-expressions this would require first adding another pair of brackets around the “parent” value:

((parsley fresh)sage(rosemary dried)thyme)
; or
((parsley(fresh))sage(rosemary(dried))thyme)

which is more cumbersome and error-prone and removes the compactness advantage from that level of nesting.

In case of CSV nesting is not supported.


  1. CSV is technically not a fair comparison for TAO, since it is not a TAS. It is used here however as an extreme example to illustrate a point.↩︎