TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

2 点作者 planetis大约 1 年前
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.

1 comment

planetis大约 1 年前
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.