Skip to content

Show HN: Jsonpak: JSON that is not bloated for Nim

github.com/planetis-m
2 pointsplanetis1 comment
On HN

My library uses packed ASTs for compact and efficient JSON representation, with JSON Pointer, JSON Patch support. It also offers a recursive sort function, that allows to provide repeatable hashes and canonical JSON. Performance can be further enhanced by replacing for loops with memmove operations. The next steps would be to write a schema validator and a fuzzer.

Comments

I will add that as a library, it has a big potential to be used in resource restricted envs, such as microcontrollers. Every other JSON library under the sun uses HashMaps or Btrees to structure the tree which end up wasting space. Another interesting one called Araq/packedjson whose ideas I borrowed, might be the most space efficient design so far, however it looses on speed comparisons on operations that involve removing items. That's because some structure should be maintained and this library provides the best trade-off between complexity and space efficiency.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.