Draft implementation of core sexp/binary Lassi Kortela (24 Sep 2019 09:56 UTC)
Re: Draft implementation of core sexp/binary Lassi Kortela (24 Sep 2019 11:21 UTC)
Re: Draft implementation of core sexp/binary Lassi Kortela (24 Sep 2019 11:55 UTC)
Binary writer and more mixed feelings about ASN.1 Lassi Kortela (24 Sep 2019 16:23 UTC)

Re: Draft implementation of core sexp/binary Lassi Kortela 24 Sep 2019 11:21 UTC

Reader in 140 lines of Scheme:
<https://github.com/Schemepersist/universal-encoding/blob/master/core/text/read.scm>

* No floats yet.
* null is read in as the symbol 'null, not a special null object.

I added vertical-bar notation for symbols since I think it's essential
that both symbols and strings can contain arbitrary characters even in
the simplest subset of the encoding. In keeping with the "no limits"
theme, that makes it so much simpler to implement writers when they can
be confident they can encode any characters they have.

I would also add a bytevector notation to even the simplest subset. IMHO
the ability to read and write arbitrary bytes is basic "Programmer's
Bill of Rights" territory and is again in keeping with the "no limits"
theme.

Since we are planning a dual binary format, recall that it's trivial to
write arbitrary strings, symbols and bytevectors as binary simply by
using write() without any quoting. To preserve this duality it's
simplest to work a little harder to provide equivalent range in the text
format.