You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`ruby.wasm` uses two C extensions to turn Ruby in to a guest module.
3
+
The `js` extension enables Ruby to use JavaScript APIs.
4
+
The `witapi` extension exports Ruby's interpreter interface to allow the host to use the Ruby interpreter.
5
+
In other words, `js` allows Ruby to talk to Javascript and `witapi` allows a host to talk to Ruby.
6
+
7
+
Under each subdirectory, there is a `bindgen/*.wit` file outlining the interfaces for each form of communication.
8
+
Specifically, `bindgen/rb-js-abi-host.wit` describes embedder's requirements and `bindgen/rb-js-abi-guest.wit` describes exported API from Ruby interpreter.
9
+
The `.c` and `.h` files are autogenerated from [wit-bindgen](https://github.com/bytecodealliance/wit-bindgen#host-runtimes-for-components).
10
+
You can read more about it in the [contributing guide](/CONTRIBUTING.md#re-bindgen-from-wit-files).
11
+
Note that we currently do not use the latest version of wit-bindgen because of how fast it is changing, with features being changed or even [removed](https://github.com/bytecodealliance/wit-bindgen/pull/346) at times.
0 commit comments