Posted by creationix 9 hours ago
My one eyebrow raise is - is there no binary format specification? https://github.com/creationix/rx/blob/main/rx.ts#L1109 is pretty well commented, but you can't call it a JSON alternative without having some kind of equivalent to https://www.json.org/ in all its flowchart glory!
This lib keeps the compact representation at runtime and lets you read it without putting all the entities on the heap.
Cool!
Being able to copy/paste a serialization format is not really a feature i think i would care about.
Unless, to read that correctly, it only has a text encoding as long as you can guarantee you don't have any unicode?
(Or to avoid using cat to read, whatever2json file.whatever | jq)
Docs are super unclear.
Think of it as a hybrid between JSON, SQLite, and generic compression. This format really excels for use cases where large read-only build artifacts are queried by worker nodes like an embedded database.
That would make parsing faster and there will be very little in terms on tree (json can't really contain full blow graphs) but it's rather complicated, and it will require hashing to allow navigation, though.
Even a technically superior format struggles without that ecosystem.
This did catch my eye, however: https://github.com/creationix/rx?tab=readme-ov-file#proxy-be...
While this is a neat feature, this means it is not in fact a drop in replacement for JSON.parse, as you will be breaking any code that relies on the that result being a mutable object.
Is it versioned? Or does it need to be..
The viewer is cool, took me a while to find the link to it though, maybe add a link in the readme next to the screenshot.