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 Alaric Snell-Pym 17 Sep 2019 12:22 UTC
On 17/09/2019 13:05, Lassi Kortela wrote:

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

I am lulling you into a false sense of security, so you support MY
terrible ideas later... ;-)

> 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.

Yes. If you're not trying to be human-processible, then making the
format as convenient as possible for the machine (and programmer)
becomes paramount.

> 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.

I'd like that!

> 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.

Just follow the Scheme numeric tower etc. and everything sort of falls
out naturally, IMHO.

Rationals? Store them as two integers.

Complex? Store them as two numbers.

Inexacts are the tricky one, as unlike all the other types, there's no
procedures to simply split them into parts that we can already represent
- and we would like to exactly represent inexacts, as it where,
reproducing them exactly the same way (assuming that the receiving
implementation's representation isn't less exact then the sending
one's). But peeking under the hood, one can note that most (all?)
inexact number representations are IEEE floating points, and either
provide a "raw IEEE double" (pick an endianness) value format, or avoid
problems with implementations that have inexact representations that
aren't a strict subset thereof by sending inexacts as two arbitrary
integers - mantissa and exponent - with a few special values for
infinities. Even the "subnormal" numbers very near 0 can be represented
in that form, but it's a bit of shuffling to convert between that and
Scheme numbers.

As for timestamps and stuff - you can store the arguments to make-time,
by using the accessors in srfi-19, etc!

> 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.

It would be nice to add it as an input/output format in magic-pipes, my
sexprs-in-shell-pipelines toolkit:
https://www.kitten-technologies.co.uk/project/magic-pipes/doc/trunk/README.wiki

--
Alaric Snell-Pym   (M7KIT)
http://www.snell-pym.org.uk/alaric/