SqueakJS icon indicating copy to clipboard operation
SqueakJS copied to clipboard

FFI callouts to WASM

Open codefrau opened this issue 7 months ago • 0 comments

An interesting project would be to compile a C library to WASM and call its functions from the image via FFI, just like other VMs do. That might enable the use of a wide range of existing libraries.

The C source code would be compiled into a WASM module, and then we would need some boilerplate code that would expose the functions inside the WASM as JS functions useable by the FFI plugin (which would hopefully be generated by the compilation process).

The FFI test library would be a good candidate for compiling because it uses all kinds of parameter passing etc. So instead of reimplementing it in JS as #177 suggests, it would be compiled to WASM and then called.

codefrau avatar Jul 16 '24 00:07 codefrau