4 ms·
Show HN: Parser for JSON with comments, 80% smaller and 6x~70x faster than JSON5
- fabiospampinato 6y agoHello 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.
- chovybizzass 6y agoso the only benefit is comments and trailing comments? A linter will rip all that out anyway
- fabiospampinato 6y agoCompared 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.
- zzo38computer 6y agoGood; 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.)