On Tue, Jun 2, 2020 at 10:22 AM Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:
"I'm developing a JSON parser."
May I ask why Nathan? This sounds like reinventing the wheel when there
are at least three really good parsers already available.
No problem. BTW, which three parsers might you be referring to? YAJL must
be one, for sure. I agree that it sounds like reinventing the wheel, but
I'll share some of my rationale.
Broadly speaking I need a JSON parser to consume web services as well as
support web-service clients. That's a big deal to me. But in response to
reinventing the wheel, let's take YAJL as an example. It implements a CGI
interface, whereas none of our web applications use CGI.
Also, I need to support the parser. As I've reviewed the YAJL C code, I
didn't feel comfortable enough with the code to support it. It also
includes a procedure that converts the JSON to UTF-8 prior to parsing,
which I question. The parsing logic to me looks like it could be coded to
perform more efficiently. I'd like to come up with something that performs
better, even though my standards for performance may be higher than most.
I have several ideas that would streamline the API. For example reading
JSON arrays directly into RPG data structures, comparable to data-into, but
implemented with a procedure interface instead.
SAX parsing within YAJL is very confusing to me. I think that can be
improved significantly.
Nathan.
As an Amazon Associate we earn from qualifying purchases.