Skip to content

Commit a4753ab

Browse files
committed
docs: update README.md about plugins in C
1 parent 40b7e5e commit a4753ab

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

README.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ In the last seven years I've done a few projects involving rust and WebAssembly:
6363

6464
## Usage
6565

66-
### pluginlab (rust)
66+
### pluginlab (rust) - REPL cli host
6767

6868
#### Install
6969

@@ -195,7 +195,7 @@ cargo binstall wasm-tools@1.235.0
195195
just dl-wasi-sdk
196196
```
197197

198-
### pluginlab (rust)
198+
### pluginlab (rust) - REPL cli host
199199

200200
#### Build
201201

@@ -328,14 +328,23 @@ In [`.github/workflows/web-host.yml`](./.github/workflows/web-host.yml), after t
328328

329329
To be sure that the preview server is up and running before running the tests, we use the [`webServer.command` option](https://playwright.dev/docs/test-webserver) of [playwright.config.ts](./packages/web-host/playwright.config.ts) to run `WAIT_FOR_SERVER_AT_URL=http://localhost:4173/webassembly-component-model-experiments/ npm run test:e2e:all:preview`
330330

331+
### plugins
331332

332-
### plugins (TypeScript)
333+
There are currently plugins implemented in 3 languages (most of them are in rust):
333334

334-
You can write plugins in rust in [`crates/plugin-*`](./crates), you can also write plugins in TypeScript in [`packages/plugin-*`](./packages), thanks to `jco componentize` (based on [componentize-js](https://github.com/bytecodealliance/componentize-js)).
335+
#### Rust
335336

336-
There is a [`packages/plugin-echo`](./packages/plugin-echo/) example plugin in TypeScript.
337+
You can write plugins in rust in [`crates/plugin-*`](./crates).
337338

338-
The downsides of writing plugins in TypeScript is mostly that your `.wasm` file will be **much larger** than the one compiled from rust:
339+
#### C
340+
341+
You can write plugins in C in [`c_modules/plugin-*`](./c_modules), thanks to `wit-bindgen` (based on [wit-bindgen](https://github.com/bytecodealliance/wit-bindgen)).
342+
343+
#### TypeScript
344+
345+
You can also write plugins in TypeScript in [`packages/plugin-*`](./packages), thanks to `jco componentize` (based on [componentize-js](https://github.com/bytecodealliance/componentize-js)).
346+
347+
The downsides of writing plugins in TypeScript is mostly that your `.wasm` file will be **much larger** than the one compiled from rust or C:
339348

340349
- ~100KB of wasm for the rust plugin
341350
- 11MB of wasm for the TypeScript plugin
@@ -344,9 +353,10 @@ The reason is that a JavaScript runtime needs to be embedded in the `.wasm` file
344353

345354
More about the [SpiderMonkey runtime embedding](https://github.com/bytecodealliance/ComponentizeJS?tab=readme-ov-file#explainer).
346355

347-
### plugins (Other languages)
356+
#### Other languages
357+
358+
Coming.
348359

349-
Coming soon.
350360

351361
## Developer experience
352362

0 commit comments

Comments
 (0)