Closed leiserfg closed 1 year ago
There are no examples yet sadly. It should be enough however to run the wasm2luajit
tool on the WebAssembly file of your choice to translate it.
From there, it'll produce a module returning a sort of init function. Call that function with any host functions that your C code expects your Lua to implement (if any), and it will return a table with the module parts. Then, you should be able to call the C functions from the func_list
directly.
While we currently lack a specific C example (I will get to it eventually), the new Rust one explains some universal concepts. https://github.com/Rerumu/Wasynth/wiki/From-Rust,-to-Lua
It sounds here like you want to specifically use a C library, in which case you'd just interface with the exports from the Lua end like I mentioned previously.
I'm interested in using this as a way to ship a C library into a nvim plugin. Is there an example project so I can pick up quickly on how to use it?