Description
Was chatting in the AS discord about AS bind, and figured this would be good to document in an issue as well 😄
- Identify the data id in: https://github.com/torch2424/as-bind/blob/master/lib/assembly/as-bind.ts#L15
- Pull the data out of linear memory by it's layout: https://www.assemblyscript.org/interoperability.html#class-layout or https://www.assemblyscript.org/memory.html#internals
I do think that library would be helpful for general Data management in a JS app, and could allow for a "Everything is a data view", making things similar on the implementation side. But I wouldn't want to force users into using a specific library, or inflate the code size (It's not super big at 11kb, but currently we sit around 4kb + tree-shakable): https://bundlephobia.com/[email protected]
What we probably want to do, per the steps I mentioned above, is expose the Standard Library automatically in the as-bind entry file.
And for custom objects, is offer a way in both JS and AS land to pass around custom objects using like a function call.
That also being said, I know per the working meeting, there's plans to build an AS bindgen soon-ish. Which would then be the preffered way to handle this. :slight_smile: But I don't know how soon is soon haha!