News for hackers. Stuff that matters.
Re:Parsing JSON Is a Minefield (2016) by recursive on Monday October 11, 2021 @01:17PM (#28830609)
> use an evented parser

I've never heard of this. A google search isn't particularly illuminating. What is an "evented parser"?

Re:Parsing JSON Is a Minefield (2016) by dragonwriter on Monday October 11, 2021 @01:26PM (#28830701)
> What is an "evented parser"?

Also knowns as a “streaming parser”, its a parser that takes in a data stream and produces a stream of events which client code can handle; it allows more flexible handling than deserializers, including ability to handle arbitrarily large input. SAX is a streaming/evented parser API for XML, and there are similar ones for other formats.

Re:Parsing JSON Is a Minefield (2016) by rovolo on Tuesday October 12, 2021 @07:27PM (#28846342)
The sibling comments are good descriptions, but here are example interfaces:

- Normal parser https://www.javadoc.io/static/com.google.code.gson/gson/2.8....

- Streaming parser https://www.javadoc.io/doc/com.google.code.gson/gson/latest/...

Re:Parsing JSON Is a Minefield (2016) by Smaug123 on Monday October 11, 2021 @01:26PM (#28830707)
Just a parser which fires events you can listen on when its internal state machine changes state.
Re:Parsing JSON Is a Minefield (2016) by throw_m239339 on Monday October 11, 2021 @01:21PM (#28830653)
Google "event-based parser"