I wrote a JSON library

Jonathan M Davis jmdavisProg at gmx.com
Tue May 7 12:15:32 PDT 2013


On Tuesday, May 07, 2013 20:36:19 Sean Kelly wrote:
> Now obviously, in many cases convenience is preferable to raw
> speed, but I think code in Phobos should be an option for both
> types of uses whenever possible. What I'd really like to see is
> the variant-type front-end layered on top of an event-based
> parser so the user could just use parseJSON as-is to generate a
> tree of JSON objects or call the event-driven parser directly
> when performance is desired. I don't think the parser needs to
> be resumable either, since in most cases JSON is transported in
> an HTTP message, so a plain old recursive descent parser is fine.

Yeah. For both JSON and XML, it should be quite possible to implement a low-
level API which gives you raw speed and then build more convenient APIs on top 
of them, thereby giving users the choice. And given how slices work, parsers 
like this should be able to beat the pants off of most parsers in other 
languages, especially with the low-level API.

- Jonathan M Davis


More information about the Digitalmars-d mailing list