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

Handling WebAssembly (AssemblyScript) objects from JS. #112

Open
trusktr opened this issue Jun 14, 2020 · 3 comments
Open

Handling WebAssembly (AssemblyScript) objects from JS. #112

trusktr opened this issue Jun 14, 2020 · 3 comments

Comments

@trusktr
Copy link

trusktr commented Jun 14, 2020

This seems like it might be the tool for the job. I saw you comments in the WebAssembly Discord #assemblyscript channel. Btw there's an official AssemblyScript Discord server now!

I'm working to port Three.js to AssemblyScript.

For people who will write in AssemblyScript, they'll just import the code and use it like normal. But there will be people who will (and for some of my projects I will) want to or need to write JavaScript and interface with things in WebAssembly. As an example, I'm working on custom elements that represent objects to draw on the screen with WebGL. It currently uses Three.js under the hood, in plain JS. But once I have ported enough of it to AssemblyScript, I'd like to run the WebGL engine in WebAssembly but I will need to interface with the custom elements which are JavaScript.

I've no idea how it will work yet, but something like what you are working seems like a possible way to create interfaces to the same objects that live in a WebAssembly module.

For example, if I were writing in pure AssemblyScript, then I could make a new Mesh and set some properties on it. But if I'm in JS, I would also like to do the same (but still have it be in the WASM module).

Any thoughts on this?

@Bnaya
Copy link
Owner

Bnaya commented Jun 18, 2020

hey @trusktr!
Your project looks super cool!

I think that what you describe is possible, I will be happy to have a skype/zoom/whatever call about it
My email is me@bnaya.net

If you are working with well-defined objects shapes you may want to also look at:
https://github.com/GoogleChromeLabs/buffer-backed-object#readme
Maybe it will be a better fit for your use case

@trusktr
Copy link
Author

trusktr commented Jun 23, 2020

Oh neat, thanks for sharing buffer-backed-object!

My username on Discord is trusktr#1223. That's the best place to chat, if you're on there.

@alienself
Copy link

Any update on this? @Bnaya Is it possible to share object buffer with assemblyscript?

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

3 participants