Xlinka / NeosPlus

NeosVR Plugin Extra Logix nodes and features
https://discord.gg/9QAaMtXwke
Other
29 stars 19 forks source link

Run WebAssembly Executables #99

Open kazu0617 opened 1 year ago

kazu0617 commented 1 year ago

https://github.com/Neos-Metaverse/NeosPublic/issues/2818

jeanahelver commented 1 year ago

potential candidate library for wasm is WasmerSharp

Frozenreflex commented 1 year ago

This library doesn't use an external dependency, and compiles to an IL assembly, so it should work on more platforms and be easier to distribute. I'm not super familiar with WebAssembly, so there's lots of different aspects I don't know about. but given the nature of it, I presume the effective implementation would amount to custom Logix nodes and custom component drivers, perhaps with separate "WasmBinary" objects to allow for reusing code as sudo-libraries. Beyond that, I'm again not familiar enough with WebAssembly to speculate implementation details.

jeanahelver commented 1 year ago

that seems like a very bad idea since this will give full access to the system since its IL and can call system libraries. you want the interpreted version that has a "fuel" cost so you can halt it from infinite loops and the likes.

Frozenreflex commented 1 year ago

Unless the compiler is giving access to stuff it shouldn't, and if I'm reading the docs properly, the only way it would have access to the system is if said system libraries are imported, which we have control over and wouldn't give access to. You aren't able to just "create file IO instructions that steals your neos session key", you're limited to Wasm operations and whatever the compiler creates out of that. Fuel cost seems to be a hand-wavey argument to me, if we need to prevent infinite loops there's ways of doing it.

Xlinka commented 10 months ago

i feel like we might have to build our own runner to run these webasm most of the stuff is out of date and idk about others considerations on this.