If you have specialised knowledge of integrating scripting into a Rust program (a game, specifically) with a relatively high performance target and relatively low concern for protection against malware (basic restrictions of host APIs is nice but ultimately not necessary), please hit me up I have questions as I’m not experienced with the specific field

specifically I’m switching away from Rhai because it’s too slow for my usage and because my game is an automation game that has all the content built with scripting, ideally I’d want a very high performance target, anything short of JIT or native won’t be enough. the game’s logic mostly consists of independent scripts that send messages to each other via an actor system, and rendering is done by asynchronously collecting rendering commands from scripts. wasm isn’t out of the picture but it’s clunky and I don’t know how to make it performant or how to minimise serialisation overhead.

#rust #gamedev #rustgamedev #scripting

@twinkle if wasm checks most of the boxes, especially with wasmtime or another JIT enabled wasm runtime, then the issue of serialization stems from copying data back and forth. Because both the host and the guest are rust, or something enough rust like to not use utf16, you can use the wasm runtime to read the strings directly from the linear memory pointers a function returns, and from what I know, also write to linear memory blocks and pass that over when the code should read from it, but I'm unsure about the last part