Skip to content

Commit 28caf7f

Browse files
Forthoneykateinoigakukun
authored andcommitted
improve READMEs for ext directory
1 parent c0be5fd commit 28caf7f

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

ext/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Ruby extensions
2+
`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.

ext/js/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

ext/witapi/README.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)