On 23/09/2024 18:07, Adam Zielinski wrote:
If PHP had WASM support, WordPress could ship curl.wasm as a fallback and focus on the product more than on the plumbing.
As has been pointed out a couple of times already, this particular use case really doesn't stand up to scrutiny.
- The chances of PHP making it a requirement that everybody who installs the PHP runtime *must* also install a WASM runtime are close to zero. It's actually much more plausible (though still unlikely) that we would make libcurl a hard requirement. - Hosts who do not install ext/curl because they don't trust it are very unlikely to trust something as complex and versatile as a WASM runtime. - Hosts who do not install ext/curl because they only install the base package provided by Ubuntu/RedHat/Alpine/etc won't install an ext/wasm, because it won't be included in that base package. I can't stress enough that those base packages are not "the default build of php-src", they are entirely controlled by the package managers at each distribution/repository. - Hosts who already install a variety of PHP extensions will already install ext/curl, so are not relevant *for this particular example*.
The use case I *can* see is for *high-end* hosting services, who already install a range of extensions, including ext/curl, but don't allow users to upload binaries. (Mike gave the example of Pantheon.) They might allow users to upload and run more niche extensions, if it was proven that WASM provided a better sandbox than just running binary code inside an OS container.
I don't actually know what market share that kind of service has, with cheaper shared hosts on one side, and container-based hosting like DigitalOcean (where you can upload native binaries already) on the other.
Regards, -- Rowan Tommins [IMSoP]