WordPress / wordpress-playground

Run WordPress in the browser via WebAssembly PHP
https://w.org/playground/
GNU General Public License v2.0
1.58k stars 221 forks source link

Review Extism applications for Playground #1478

Open adamziel opened 1 month ago

adamziel commented 1 month ago

https://extism.org/ is a cross-language framework for building with WebAssembly.

Let's review if it's useful for:

Some questions:

brandonpayton commented 3 weeks ago

I haven't looked at the details yet but can naively imagine using it to load Wasm modules that are callable from JS and/or PHP. A blueprint step or other configuration could load a Wasm component and expose it for use by JS or PHP contexts. At that point, we have the option to leverage so much more from within Playground.

I'm curious what it would look like to use Extism like this within Playground. The browser already provides the Wasm runtime, so we'd need to be able to instantiate Wasm with Browser APIs and expose the exports to PHP. Perhaps this is something Emscripten would just handle. This is making me think about Inception-esque layers and can be fairly confusing.

Another thought: I wonder if there is any value in inverting this to get Playground into more things rather than more things into Playground.

Is it at odds with the The WebAssembly Component Model? Should we just wait for that?

From https://dylibso.com/blog/why-extism/:

A lot of great work is being done in the Wasm community to define specifications like WASI and the Component Model that make Wasm development easier. We at Dylibso are participating in these efforts and working to make sure Extism supports the Component Model as it develops.

Would the advantages outweight an added maintenance burden, bugs, abstractions?

If we ship the capability as a pre-deprecated feature, we can find out :)