Neos-Metaverse / NeosPublic

A public issue/wiki only repository for the NeosVR project
193 stars 9 forks source link

WebAssembly Support #2818

Open uyjulian opened 3 years ago

uyjulian commented 3 years ago

Is your feature request related to a problem? Please describe.

I haven't seen an issue opened related to WebAssembly here yet.

One reason to use WebAssembly is that LogiX may be limited in some ways.
Another reason is that it would allow you to use other scripting languages like Lua, JavaScript, C++, etc.

Relevant issues

WebAssembly support was mentioned here: https://github.com/Neos-Metaverse/NeosPublic/projects/1#card-35346323

Describe the solution you'd like

The WebAssembly API basically supports the following:

This makes it easier to sandbox WebAssembly, as it can only call functions you expose to it.

Instantiation and read/write exposed buffer would probably require Collections support: https://github.com/Neos-Metaverse/NeosPublic/issues/256
As far as I know, there is no varargs facility within LogiX, so some similar solution would need to be implemented into LogiX.

Describe alternatives you've considered

Compiling WASM to LogiX might be possible but performance will be pretty bad.

Additional context

No response

Frooxius commented 3 years ago

As the note says, this is something we are considering, but right now we're not fully decided yet. I'm heavily leaning towards implementing this as the major scripting support, but if it's going to happen, it's going to be a while before we get to it.

Since large amount of content is going to be built on this solution, this is going to be a significant commitment from us and we'll need to put extra care into the API's and integration, to avoid any content breakage if we need to change something about the design or the system.