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

Array / record support #52

Open
Autumnlight02 opened this issue Oct 13, 2024 · 3 comments
Open

Array / record support #52

Autumnlight02 opened this issue Oct 13, 2024 · 3 comments

Comments

@Autumnlight02
Copy link

Will things like arrays of structs be possible or a key value store where we have any key but an struct value? or would these things still need to be passed on via postmessage?

@acutmore
Copy link

Hi @Autumnlight02, the proposal currently includes another new construct "shared arrays". These are fixed length arrays that can contain shared values, and are themselves shareable.

https://github.com/tc39/proposal-structs#shared-arrays

@Autumnlight02
Copy link
Author

So we will not have anything like maps / sets @acutmore or is that for the next stage? I would like if we could have sets and maps and increase their size by chunks on demand

@acutmore
Copy link

I think it's very unlikely that this proposal itself would grow to include Map/Set like collections. More likely to be something investigated by a follow on proposal. Structs and SharedArrays are both fixed size, shared collections that can also be resized would add an extra layer of complexity. If a proposal gets too large it can make it difficult to make progress (of course there are also downsides to splitting into lots of micro-proposals too).

I suspect the use cases that need this functionality will initially implement them on top of Shared{Structs/Arrays}. Using a tree/skip-list and a user-land hashing function for example.

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