Skip to content

Improve READMEs for ext directory by @Forthoney #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions ext/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Ruby extensions
`ruby.wasm` uses two C extensions to turn Ruby in to a guest module.
The `js` extension enables Ruby to use JavaScript APIs.
The `witapi` extension exports Ruby's interpreter interface to allow the host to use the Ruby interpreter.
In other words, `js` allows Ruby to talk to Javascript and `witapi` allows a host to talk to Ruby.

Under each subdirectory, there is a `bindgen/*.wit` file outlining the interfaces for each form of communication.
Specifically, `bindgen/rb-js-abi-host.wit` describes embedder's requirements and `bindgen/rb-js-abi-guest.wit` describes exported API from Ruby interpreter.
The `.c` and `.h` files are autogenerated from [wit-bindgen](https://github.com/bytecodealliance/wit-bindgen#host-runtimes-for-components).
You can read more about it in the [contributing guide](/CONTRIBUTING.md#re-bindgen-from-wit-files).
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.
5 changes: 0 additions & 5 deletions ext/js/README.md

This file was deleted.

5 changes: 0 additions & 5 deletions ext/witapi/README.md

This file was deleted.