js0n icon indicating copy to clipboard operation
js0n copied to clipboard

c99 code, no jump tables, no gcc specifics

Open nigoroll opened this issue 7 years ago • 0 comments

I looked into js0n for some particular purpose (and I am still considering it for its simplicity) and, sort of as a by-product, rewrote it to not use the jump tables and gcc specifics. As is with default compiler options, this code is also somehow more efficient (15% or so).

On the way, I also noticed the limitations, which may be worth documenting more clearly

  • extraction only from the first object level
  • does not save context, so it will accept any terminator for arrays/objects as in {a:1, b:2] or [1,2,3}

I guess that's only scratching the surface, but at any rate, documenting the fact that for its great simplicity and speed, js0n by no means is a full parser.

Feel free to just close this PR if you want to keep the existing structure, but I did not want to miss the opportunity to share this code in case anyone is interested.

nigoroll avatar Aug 27 '18 08:08 nigoroll