Re: JDBC and subprocess protocol Lassi Kortela 30 Sep 2019 15:55 UTC

>> Are the hazards of text so great they outweigh the
>> presumed advantages for debugging, i.e. using a serialization library
>> which allows transparent use of either?

Sorry, I missed the "transparent use of either" part.

I would write any subprocesses to use a binary format only. Any
binary-speaking process can be easily turned into a text-speaking
process by adding a binary<->text filter to the front. For example as a
Unix process:

     binary-to-text-filter process-that-speaks-binary args...

binary-to-text-filter launches process-that-speaks-binary with pipes on
stdin/stdout such that any text the user writes to the filter's stdin
goes as binary to the subprocess's stdin, and any binary data coming
from the subprocess's stdout is written as text to the filter's stdout.

In Scheme it's even easier since we have portable libraries to read and
write the binary format so we can just read it into Scheme objects and
write Scheme objects (this is what I'm already doing :)

My overarching design goal would be to make each subprocess as simple as
possible, so text traffic is one complex thing that is simple to
eliminate by relying on consumers of the subprocesses to have richer
tooling.