comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: In memory Stream
Date: Thu, 22 Feb 2024 09:54:07 +0100	[thread overview]
Message-ID: <ur723f$3pirk$1@dont-email.me> (raw)
In-Reply-To: <ur5jr0$3b3kv$2@dont-email.me>

On 2024-02-21 20:44, Lawrence D'Oliveiro wrote:
> On Wed, 21 Feb 2024 08:43:13 +0100, Dmitry A. Kazakov wrote:
> 
>> On 2024-02-20 23:32, Lawrence D'Oliveiro wrote:
>>> On Tue, 20 Feb 2024 21:45:46 +0100, Dmitry A. Kazakov wrote:
>>>
>>>> The burden of checks is moved to the application, the format is same.
>>>
>>> Isn’t that how all formats are implemented?
>>
>> There is a difference in semantics of checks.
> 
> 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 ]

> All extra layout
> on top of that is “moved to the application”, as you say. But it just
> takes more work starting from such a low level; starting from a higher
> point, like JSON, reduces that work.

Not at all. Implementation of serialization/deserialization on top of 
JSON is exponentially harder than on top of an octet stream. Alone 
specification of handling missing, superfluous, wrongly typed fields is 
a huge work before a single line of code is written. Furthermore,

1. JSON is unable to represent basic data, like time stamps. These must 
be encoded as strings accompanied with parsing and checks. Compare that 
with encoding as octets.

2. JSON is not extensible in any sense. You cannot add new syntax 
elements to JSON.

3. There is no any abstraction by which you could reuse JSON encoding. 
I.e. this element is like that element. Repeat this by number of times 
specified by that.

4. Nor JSON supports extensions objects. Compare it with Ada's extension 
aggregates:

    http://ada-auth.org/standards/rm12_w_tc1/html/RM-4-3-2.html#I2535

5. JSON cannot specify constraints, like value ranges, precision, 
variable record fields, array bounds.

6. JSON has no means of reflection. Talking about "metas", there is no 
way to convey a JSON description of an object (rather than instance = 
data) to another node. Both sides must know each other prior to 
communication. I don't say that dynamic binding is a good idea for 
communication for for tall claims made and all immense overhead involved...

JSON is an extremely crude primitive hobbyish idea a lazy undergraduate 
in horticulture might have about a communication protocol... (:-))

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2024-02-22  8:54 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-16  9:41 In memory Stream DrPi
2024-02-16 10:40 ` J-P. Rosen
2024-02-16 12:40 ` Dmitry A. Kazakov
2024-02-16 12:49 ` Pascal Obry
2024-02-16 20:19 ` Simon Wright
2024-02-16 21:54 ` Lawrence D'Oliveiro
2024-02-17  9:19   ` Dmitry A. Kazakov
2024-02-17 22:00     ` Lawrence D'Oliveiro
2024-02-18 10:06       ` Dmitry A. Kazakov
2024-02-17 13:36 ` DrPi
2024-02-17 14:26   ` J-P. Rosen
2024-02-17 14:42     ` DrPi
2024-02-17 18:52       ` J-P. Rosen
2024-02-18  0:02       ` Lawrence D'Oliveiro
2024-02-17 14:48     ` Dmitry A. Kazakov
2024-02-17 14:28   ` Dmitry A. Kazakov
2024-02-17 14:56     ` DrPi
2024-02-17 18:09     ` Simon Wright
2024-02-17 21:33       ` Dmitry A. Kazakov
2024-02-18 10:06         ` Simon Wright
2024-02-18 13:02           ` Dmitry A. Kazakov
2024-02-18 20:58             ` Lawrence D'Oliveiro
2024-02-18 22:10               ` Dmitry A. Kazakov
2024-02-18 23:44                 ` Lawrence D'Oliveiro
2024-02-19  8:32                   ` Dmitry A. Kazakov
2024-02-20  0:41                     ` Lawrence D'Oliveiro
2024-02-20  8:55                       ` Dmitry A. Kazakov
2024-02-20 19:37                         ` Lawrence D'Oliveiro
2024-02-20 20:45                           ` Dmitry A. Kazakov
2024-02-20 22:32                             ` Lawrence D'Oliveiro
2024-02-21  7:43                               ` Dmitry A. Kazakov
2024-02-21 19:44                                 ` Lawrence D'Oliveiro
2024-02-22  8:54                                   ` Dmitry A. Kazakov [this message]
2024-02-22 19:53                                     ` Lawrence D'Oliveiro
2024-03-25 11:07                                       ` Nioclásán Caileán Glostéir
2024-03-25 21:21                                         ` Lawrence D'Oliveiro
2024-02-18  0:00   ` Lawrence D'Oliveiro
2024-02-18 10:06     ` Dmitry A. Kazakov
2024-02-18 20:56       ` Lawrence D'Oliveiro
2024-02-18 22:10         ` Dmitry A. Kazakov
2024-02-18 23:47           ` Lawrence D'Oliveiro
2024-02-19  8:39             ` Dmitry A. Kazakov
2024-02-20  0:43               ` Lawrence D'Oliveiro
2024-02-19  9:24         ` Björn Lundin
2024-02-19  9:46           ` Dmitry A. Kazakov
2024-02-20  0:42             ` Lawrence D'Oliveiro
2024-04-02  0:21               ` Kevin Chadwick
2024-04-02  0:27                 ` Lawrence D'Oliveiro
2024-04-02  3:27                   ` Kevin Chadwick
2024-04-03 19:43                     ` Pól Niocláſ Caileán Gloſtéir
2024-04-03 22:44                       ` Chris Townley
2024-02-18 11:36     ` Björn Lundin
2024-02-18 20:57       ` Lawrence D'Oliveiro
2024-02-19 14:59         ` Björn Lundin
2024-02-19 17:01           ` Chris Townley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox