maxdavidson / structly

Tool for working with binary data types in JavaScript
MIT License
14 stars 1 forks source link

Variable length arrays? #158

Open bnolan opened 5 years ago

bnolan commented 5 years ago

Would it be possible to add varying length arrays to structly? Love this package, use it in cryptovoxels for all player communications over a websocket.

maxdavidson commented 5 years ago

Hi, thanks for showing interest in this package! I really haven't paid enough attention to it recently.

I suppose that would require adding pointer types, and then storing the referenced objects in the buffer next to the main object. There would probably have to be a lot of breaking changes. The required buffer size wouldn't be determined during schema creation anymore. The views wouldn't work either, since that would require allocating new space.

What features of structly are you using? I'd prefer to remove some complexity somewhere else if adding this. Things like modifying data/buffers in place and the data views would have to go.