Re: Binary S-expressions Lassi Kortela 17 Sep 2019 10:05 UTC

> Hello, I have written a similar thing. Dotted Canonical S-expressions
>
> You can read about it here:
> https://gist.github.com/rain-1/a253e47b939fc0769524d8716541c96e
>
> the summary is that it's a compact representation of s-exps which
> supports nesting without escaping.

Very nice, thanks for mentioning it!

As you say, netstrings and bittorrent's bencode work on a similar principle.

Is there a particular reason for using ASCII text in these formats,
given that length-prefixed data is quite hard for humans to read and
edit even if it's text? Your DCS and TCS seem to be done more as
intellectual exercises, but I wonder about the other ones.

If going for a binary format, I would also like to add a magic number
(similar to PNG's). That's a good and cheap safeguard against speaking
the wrong protocol.