On 20 September 2024 20:27:34 BST, Larry Garfield <la...@garfieldtech.com>
wrote:
>Logistical question, for those with more stdlib expertise: Since we have other
>extensions in php-src that only work if you install some other library as well
>(eg, curl), which distros pretty much take care of for us, would a small
>in-php-src extension that is just a thin wrapper for Wasmtime or similar be
>viable? Not embedding Wasmtime into the php-src code, just the extension, and
>it's up to the user/distro to install both so that they work.
This is basically what I was answering, to the best of my understanding, here
<https://externals.io/message/125499#125619> and here
<https://externals.io/message/125499#125638>
It's absolutely possible to build a PHP extension that interfaces to a WASM
runtime, and links have been shared to at least two projects doing just that.
Adding that to the php-src repo doesn't change what that extension can do, it
just marks it as "approved" in some slightly ill-defined way, and restricts it
to having new releases only once per year.
I think there's an impression that somehow by proposing that "we" add some
complex functionality "to the language", it will suddenly attract developers
and become stable and universally adopted; but it's really the other way
around: once there's a mature implementation, and some people offering to
maintain it, we can consider moving it to the php-src repo, if that seems
beneficial. (And if other constraints are met, such as licensing.)
At which point, some managed hosting servers might be more willing to install
it. Not the ones who don't even install ext/curl, those are never going to
benefit from this. But maybe the ones who install a reasonable list of
features, but are a bit wary of installing PECL extensions they don't know much
about, can be persuaded to trust their users with a WASM sandbox.
There have been a couple of mentions on this thread of writing an RFC, but I
can't think of anything that an RFC could realistically propose right now. So I
say again, to those of you interested in the topic: contribute to the projects
already building the extensions, that's where the next steps are, not here.
Regards,
Rowan Tommins
[IMSoP]