Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persistent data structures? #20

Open
joakim opened this issue Jan 1, 2021 · 1 comment
Open

Persistent data structures? #20

joakim opened this issue Jan 1, 2021 · 1 comment

Comments

@joakim
Copy link

joakim commented Jan 1, 2021

Could the binary structures serve as the basis for persistent data structures, implemented as HAMT?

@zandaqo
Copy link
Owner

zandaqo commented Jan 3, 2021

That's an interesting question. The binary or *view structures can encode any structured data one can describe, say, with JSONSchema. I use them as a simpler, js specific alternative to FlatBuffers for storage and transfer where JSON is too much of an overhead and the structures are too complex to just get away with a DataView or TypedArrays.

In case of HAMT, we can, for example, encode the resulting array of nodes as a VectorView (or several) of MapViews representing structures for nodes. This will essentially make the result immutable, since we cannot change the length of the created VectorView(s), and have some overhead depending on the way we describe the structures for nodes, though I'm sure it will be much less than most other ways of encoding will give us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants