Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Jsonpak: JSON that is not bloated for Nim (github.com/planetis-m)
2 points by planetis 10 days ago | hide | past | favorite | 1 comment
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.





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.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: