Hello Duy!
Thanks for chiming in the conversation.
Le jeu. 2 janv. 2020 à 09:13, Duy Nguyen <xxxxxx@gmail.com> a écrit :
>
> On Wed, Jan 1, 2020 at 9:04 PM Amirouche Boubekki
> <xxxxxx@gmail.com> wrote:
> >
> > Hello schemers!
> >
> > You can find the code and early draft specification at
> > https://github.com/amirouche/SRFI-JSON
>
> Is there any survey on json support status of "main" scheme implementations?
>
> I know Gauche supports json [1], and if this srfi was to be added to
> Gauche, I would love to see Gauche's implementation reused with a thin
> wrapper on top to provide the srfi api. Other schemes that already
> support json might want to go the same route.
>
> [1] https://practical-scheme.net/gauche/man/gauche-refe/JSON-parsing-and-construction.html
I am not sure about Gauche implementation [0]. I guess, it depends
how the PEG parser is implemented.
[0] https://github.com/shirok/Gauche/blob/master/lib/rfc/json.scm
I will extend the early draft to make it possible to implement Gauche interface.
In particular Gauche JSON module is not a streaming parser. Streaming
parser are useful in contexts where JSON are very big, and you only
need a slice of it. Example of such JSON include wikidata's JSON dump
[2]. I recognize that is not a very common use case to stream parse a
bigger than memory JSON.
[2] https://www.wikidata.org/wiki/Wikidata:Database_download#JSON_dumps_(recommended)
I think the main advantage of the parser I am working on, is that it
is safer or at least wants to be safer.
Also, there is existing stream parser for JSON in various language, so
it is clearly something:
- https://www.npmjs.com/package/JSONStream
- https://github.com/AMDmi3/jsonslicer
- https://github.com/danielyule/naya
- https://github.com/zserge/jsmn
And the following has an interesting rationale for the use of streaming parser:
- https://github.com/squix78/json-streaming-parser