Re: Portable S-expressions
Lassi Kortela 20 Apr 2021 13:09 UTC
> As a thought... define a compat-symbol/number as the first entry in the
> file, which will determine specific variations.
A format signature is a good idea, but I'd leave it for more complex
syntaxes. The idea of POSE is to establish an extremely simple baseline
- similar to JSON, which also decided to be so simple that it doesn't
require a version number.
> Or define a new symbol for things like booleans, that are not used by
> any implementation or language, and that can be trivially parsed into a
> local representation.
Scheme's #t and #f (or #true and #false) are a good representation for
unambiguous booleans IMHO. A syntax supporting booleans could simply use
those.
> In other words, it may be useful to define a sub-or-super-language which
> can be trivially parsed by all extant languages, instead of trying to
> find a subset of all languages that can be parsed identically by all
> languages. I think that any such subset will be too small to be useful,
> and will eventually result in either of the two options above, if the
> idea continues at all.
Fully agreed on all points.
I can say from personal experience that a syntax with only lists,
numbers, symbols, and strings is very useful. Probably not for serious
code, but certainly for data, and for simple domain-specific languages.