Replies: 1 comment
-
Yes, you can compile the complete Rhai engine to WASM. In fact the Rhai web playground is based on a WASM engine. https://rhai.rs/book/start/builds/wasm.html However, for a simple plugin/config/customization system you have no need to go to WASM. You can simply define a plugin API that Rhai scripts can write to (e.g. implement certain functions). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am making an editor and want to have a WASM plugin ecosystem e.g. via
extism
.I want to allow people to compile e.g. Rust to .wasm and then execute that
But. I also want to support a scripting language, and Rhai seems pretty cool!
From what I can tell, compiling Rhai directly to .wasm is not possible
But compiling the interpreter to .wasm is possible.
So I'm thinking to do this:
I suppose my WASM sandboxing will then extend to Rhai too, or do I need to also sandbox the Rhai scripts from Rhai?
Is this general direction the right way to go? I have very little experience in this area.
If you could give me a small example of a tiny plugin system that supports both interpreting Rhai scripts and also WASM blobs, with functions being registered through a single WASM interface. I would appreciate that!
Beta Was this translation helpful? Give feedback.
All reactions