News for hackers. Stuff that matters.
Re:Show HN: Very low footprint JSON parser in portable ANSI C by aliguori on Sunday February 12, 2012 @03:15PM (#3582855)
There definitely is a lack of good JSON parsers for C. We wrote our own in QEMU. The relevant code is:

http://git.qemu.org/?p=qemu.git;a=blob;f=json-lexer.c;h=3cd3...

http://git.qemu.org/?p=qemu.git;a=blob;f=json-parser.c;h=849...

Among other things, this supports streaming, is fairly fast, and has gotten a fair bit of scrutiny against malicious input.

The lexer is a hand written state machine which seems like something you should never do but turned out to be pretty reasonable.

Re:Show HN: Very low footprint JSON parser in portable ANSI C by haberman on Sunday February 12, 2012 @05:35PM (#3583257)
What's wrong with YAJL?
Re:Show HN: Very low footprint JSON parser in portable ANSI C by lflux on Monday February 13, 2012 @04:13AM (#3584842)
Nothing, YAJL got a lot of things very right. We use it in our C daemons for a bunch of things. Not having to unpack the whole JSON into memory is pretty handy.
Re:Show HN: Very low footprint JSON parser in portable ANSI C by mikehuffman on Sunday February 12, 2012 @10:48PM (#3584120)
Nothing is wrong with yajl it is awesome! I have used the lua module for yajl for some time with no hiccups.
Re:Show HN: Very low footprint JSON parser in portable ANSI C by adobriyan on Monday February 13, 2012 @09:22AM (#3585642)

  case JSON_INTEGER:
  obj = QOBJECT(qint_from_int(strtoll(token_get_value(token), NULL, 10)));
Why is it so hard to parse integer from string correctly?