Hello there, author here. I just finished making this tiny parser for JSON with comments and optional trailing commas. Writing it was pretty enjoyable and I'm fairly satisfied with the result.
I'm sharing it here partially because some of you may find it useful and partially because I'd also like to personally see more of these kinds of performance-oriented JS submissions on HN so I wanted to contribute in that regard too.
Compared to JSON you mean? Yeah that's the only difference behavior-wise.
It'd be stupid to run a full-blown linter on user-provided JSON settings for this for example, so there are some use cases where something like this is useful.
Good; comments and optional trailing commas are the two things I thought missing in JSON.
(Some applications might have use for other things too, such as non-Unicode text, 64-bit integers, cross-references, etc. However, such applications presumably would use a different format rather than JSON anyways. For things that can use JSON (which is many things), this JSON parser is good enough.)
4 comments
[ 2.7 ms ] story [ 15.4 ms ] threadI'm sharing it here partially because some of you may find it useful and partially because I'd also like to personally see more of these kinds of performance-oriented JS submissions on HN so I wanted to contribute in that regard too.
It'd be stupid to run a full-blown linter on user-provided JSON settings for this for example, so there are some use cases where something like this is useful.
(Some applications might have use for other things too, such as non-Unicode text, 64-bit integers, cross-references, etc. However, such applications presumably would use a different format rather than JSON anyways. For things that can use JSON (which is many things), this JSON parser is good enough.)