Email list hosting service & mailing list manager

Database connections as subprocesses Lassi Kortela (14 Sep 2019 07:30 UTC)
Re: Database connections as subprocesses John Cowan (15 Sep 2019 01:06 UTC)
Re: Database connections as subprocesses Lassi Kortela (15 Sep 2019 06:28 UTC)
Re: Database connections as subprocesses John Cowan (15 Sep 2019 23:02 UTC)
Re: Database connections as subprocesses Lassi Kortela (16 Sep 2019 08:22 UTC)
Binary S-expressions Lassi Kortela (16 Sep 2019 17:49 UTC)
(missing)
Re: Binary S-expressions Lassi Kortela (17 Sep 2019 09:46 UTC)
Re: Binary S-expressions Alaric Snell-Pym (17 Sep 2019 11:33 UTC)
Re: Binary S-expressions Lassi Kortela (17 Sep 2019 12:05 UTC)
Re: Binary S-expressions Alaric Snell-Pym (17 Sep 2019 12:23 UTC)
Re: Binary S-expressions Lassi Kortela (17 Sep 2019 13:20 UTC)
Re: Binary S-expressions Lassi Kortela (17 Sep 2019 13:48 UTC)
Re: Binary S-expressions Alaric Snell-Pym (17 Sep 2019 15:52 UTC)
Re: Binary S-expressions hga@xxxxxx (17 Sep 2019 16:25 UTC)
Re: Binary S-expressions rain1@xxxxxx (17 Sep 2019 09:28 UTC)
Re: Binary S-expressions Lassi Kortela (17 Sep 2019 10:05 UTC)
Python library for binary S-expressions Lassi Kortela (17 Sep 2019 21:51 UTC)
R7RS library for binary S-expressions Lassi Kortela (17 Sep 2019 23:56 UTC)
Re: Database connections as subprocesses Alaric Snell-Pym (16 Sep 2019 08:40 UTC)
Re: Database connections as subprocesses Lassi Kortela (16 Sep 2019 09:22 UTC)
Re: Database connections as subprocesses Alaric Snell-Pym (16 Sep 2019 11:28 UTC)
Re: Database connections as subprocesses hga@xxxxxx (16 Sep 2019 13:28 UTC)
Re: Database connections as subprocesses Lassi Kortela (16 Sep 2019 13:50 UTC)
Re: Database connections as subprocesses hga@xxxxxx (17 Sep 2019 13:59 UTC)
Re: Database connections as subprocesses John Cowan (16 Sep 2019 22:41 UTC)
Re: Database connections as subprocesses Lassi Kortela (17 Sep 2019 09:57 UTC)
Re: Database connections as subprocesses Lassi Kortela (17 Sep 2019 10:22 UTC)

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

> A tangential but related issue is that I shy away from using read and
> write for "protocols" where possible due to the frequent presence of
> vendor extensions that allow for executing arbitrary code in read -
> which isn't a problem in trusted environments, but still seems like an
> unnecessary danger that could lead to an exploit escalating... I've
> ended up writing ad-hoc binary representations for protocol use when it
> would have been far nicer to use read and write. An untrusted-data-safe
> binary sexpression format SRFI would be most welcome with me - but I'd
> like it in its own SRFI rather than a persistence one, as I'd use it for
> protocols more than for persisting :-)

Thanks for the support, Alaric :) Once again, I agree with all your
points of view.

Almost forgot, here is Rivest's Internet Draft for portable
S-expressions: <http://people.csail.mit.edu/rivest/Sexp.txt>. Those are
text-based, but permit bytevectors (octet strings) to be encoded with a
length prefix, similar to rain1's encoding. The landing page with links
to C code: <http://people.csail.mit.edu/rivest/sexp.html>.

I would still prefer a binary encoding for interchange, since a text
encoding using length prefixes is not really human-readable or editable.
Also, people tend to open text files in text editors, which causes all
the usual problems with character encodings and whitespace to start
spreading. If we make binary S-expressions with the same data model as
text ones, it'll be trivial to convert back and forth, so people can
just convert to text for editing and inspection.

If there is interest, I can write a spec about such an encoding, and
solicit feedback. The basics are extremely easy to do with varints, as
demonstrated. Intricate data types like floats, timestamps, etc. are
harder, and could be left out, or if not, people like John know a lot
more about those than I do.

I'd like to have an encoding that has enough range that it can also be
used seamlessly from Common Lisp, Clojure and Emacs Lisp. In fact, I'd
like to have command-line program that converts between all the
different text/binary S-expression representations. You could just pipe
things to it as you went about your daily work.

The encoders/decoders could have an option for how to convert nil/#f/().