From 17115c07f0cd180d01d1d368a688db06cb33567f Mon Sep 17 00:00:00 2001 From: Forthoney Date: Wed, 23 Aug 2023 10:22:07 -0400 Subject: [PATCH] improve READMEs for ext directory --- ext/README.md | 11 +++++++++++ ext/js/README.md | 5 ----- ext/witapi/README.md | 5 ----- 3 files changed, 11 insertions(+), 10 deletions(-) create mode 100644 ext/README.md delete mode 100644 ext/js/README.md delete mode 100644 ext/witapi/README.md diff --git a/ext/README.md b/ext/README.md new file mode 100644 index 0000000000..30d9ea7dc3 --- /dev/null +++ b/ext/README.md @@ -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. diff --git a/ext/js/README.md b/ext/js/README.md deleted file mode 100644 index e9315f5a27..0000000000 --- a/ext/js/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Ruby extension to manipulate JavaScript API - -This extension enables to use JavaScript API from Ruby program. - -`bindgen/rb-js-abi-host.wit` describes embedder's requirements. diff --git a/ext/witapi/README.md b/ext/witapi/README.md deleted file mode 100644 index 5da6bc9373..0000000000 --- a/ext/witapi/README.md +++ /dev/null @@ -1,5 +0,0 @@ -# Ruby extension to export the Ruby interpreter interface - -This extension enables to use Ruby interpreter from embedders. - -`bindgen/rb-js-abi-guest.wit` describes exported API from Ruby interpreter.