If I recognize the first digit, then I *can* hand that over to an
external function to accumulate the digits that follow.
And what is that external function going to do with this information?
The point is you didn't parse anything if you just sent the digit.
You just delegated the parsing further. Parsing is only meaningful if
you extracted some information, but your idea is, essentially "what if
I do nothing?".
Under that constraint, I'm not sure I can parse anything. How can I
parse a string (and hand it over to an external function) until I've
found the closing quote?
Nobody says that parsing a number is the only pathological case. You, however, exaggerate by saying you cannot parse _anything_. You can
parse booleans or null, for example. There's no problem there.
In principle, any language that has infinite words will have the same
problem with streaming [...]
[...] If you ever pondered h/w or low-level
protocols s.a. SCSI or IP [...]
The real problem is how the JSON is set up. If you take umpteen data structures and wrap them all in something like a list, then it may be a tad hard to stream as you may not necessarily be examining the contents till the list finishes gigabytes later.
By that definition of "streaming", no parser can ever be streaming,
because there will be some constructs that must be read in their
entirety before a suitably-structured piece of output can be
emitted.
In the same email you replied to, I gave examples of languages for
which parsers can be streaming (in general): SCSI or IP.
You can't validate an IP packet without having all of it. Your notion
of "streaming" is nonsensical.
Whoa, whoa, hold your horses! "nonsensical" needs a little bit of justification :)
It seems you don't understand the difference between words and
languages! In my examples, IP _protocol_ is the language, sequences of
IP packets are the words in the language. A language is amenable to
streaming if the words of the language are repetition of sequences of
symbols of the alphabet of fixed length. This is, essentially, like
saying that the words themselves are regular.
You can't validate an IP packet without having all of it. Your notion
of "streaming" is nonsensical.
One single IP packet is all you can parse.
On Thu, 3 Oct 2024 at 08:48, Left Right <olegsivokon@gmail.com> wrote:
You can't validate an IP packet without having all of it. Your notion
of "streaming" is nonsensical.
Whoa, whoa, hold your horses! "nonsensical" needs a little bit of justification :)
It seems you don't understand the difference between words and
languages! In my examples, IP _protocol_ is the language, sequences of
IP packets are the words in the language. A language is amenable to streaming if the words of the language are repetition of sequences of symbols of the alphabet of fixed length. This is, essentially, like
saying that the words themselves are regular.
One single IP packet is all you can parse. You're playing shenanigans
with words the way Humpty Dumpty does. IP packets are not sequences,
they are individuals.
ChrisA
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 12 |
Nodes: | 8 (0 / 8) |
Uptime: | 44:23:14 |
Calls: | 173 |
Files: | 21,502 |
Messages: | 79,839 |