From mboxrd@z Thu Jan 1 00:00:00 1970 Path: eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Lawrence D'Oliveiro Newsgroups: comp.lang.ada Subject: Re: In memory Stream Date: Thu, 22 Feb 2024 19:53:02 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Injection-Date: Thu, 22 Feb 2024 19:53:02 -0000 (UTC) Injection-Info: dont-email.me; posting-host="0628152959bd9fc4f57a17e17cabba1f"; logging-data="61281"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18Q2sqq2YZ3isEGs66Ihw7B" User-Agent: Pan/0.155 (Kherson; fc5a80b8) Cancel-Lock: sha1:JeY17vsH90nqEEVz+fRJXZe56b0= Xref: news.eternal-september.org comp.lang.ada:66118 List-Id: On Thu, 22 Feb 2024 09:54:07 +0100, Dmitry A. Kazakov wrote: > On 2024-02-21 20:44, Lawrence D'Oliveiro wrote: > >> Think of a stream of bytes as the ultimate meta-format. > > Of course not. It is not a format it is a transport layer. > [ BTW, it is not bytes, it is octets actually ] We normally work with bytes here. And your “transport layer” is what gets the bytes from one place to another. So my point still stands: the bytestream is the ultimate lowest-level meta-format. > Implementation of serialization/deserialization on top of > JSON is exponentially harder than on top of an octet stream. We already have libraries for doing that, at least for byte streams. That’s why it’s so much easier to build on top of those, rather than going back to bytes every time. As for octets--I guess you’re on your own. > Alone specification of handling missing, superfluous, wrongly typed > fields is a huge work before a single line of code is written. All the code for that already exists, in most if not all common languages. > 5. JSON cannot specify constraints, like value ranges, precision, > variable record fields, array bounds. Those are specific to the format you are building on top of the meta- format. > 6. JSON has no means of reflection. Again, this is specific to the format. For an example of how you can do this, see Varlink .