jake2 icon indicating copy to clipboard operation
jake2 copied to clipboard

Add WASM module loader for AI and other pluggable functionalities

Open samoylovfp opened this issue 2 years ago • 1 comments

Proposal to add foundation for a WebAssembly module loader. This will allow developing sandboxed plugins, developed in any language that can target WebAssembly

Options I found are

1. Wasmer

Pros

  • Industrial strength interpreter guaranteeing correctness and performance.

Cons

  • Contains native code, limits platform support to amd64-{darwin,linux,windows}.

2. KTWasm

Pros

  • Pure-kotlin implementation.
  • Only ~3k lines of code, should be easy to debug and improve.

Cons

  • Seems abandoned, lacking thorough documentation.

I would go for the second option, I don't think performance will be of an issue. Switching between options should be fairly straightforward as well.

If this sounds like a good idea I would require help with packaging or vendoring the dependency and integrating it into the game loop

samoylovfp avatar Jan 24 '23 07:01 samoylovfp

So far the option 3. GraalVM WASM looks most promising approach

demoth avatar Feb 12 '23 21:02 demoth