Why not? Web SQL would not be different from WebGL/GLSL or even JavaScript itself in that respect. Developers use feature detection and and work to the lowest supported version. APIs and languages can evolve, but in (mostly) backwards compatible ways. Extension and versioning mechanisms can be made. That's how the web works and Web SQL could have worked that way too.
More broadly, you could apply arguments like this against everything in the entire web platform. Maybe everything should be a WASM module that developers could choose themselves! Image loading, video decoding, JS engine, why not? It's actually a beautiful vision and I'd be all for it if not for cache partitioning. Every site would have to re-download and re-JIT an entire browser engine before it could do anything.
WebGL/GLSL give the developer a low level api to the graphics hardware.
Video decoding apis talk to the hardware video decoding hardware.
OPFS gives developers a low level API to the persistent file system / HDD / SSD.
To clarify, Apple made a proposal[0] which got no real traction. It has migrated[1] to a Javascript API[2]
[0] https://github.com/WebKit/explainers/tree/main/model
The enemy of progress is perfect.
> I’m supposing that the problem is that the web browser is the universal platform for all applications
This is a feature not a problem.
> There’s a benefit for information consumption (web pages) being separate from functionality rich and infinitely fingerprintable “native capabilities”
What exactly is that benefit supposed to be? If you want a read-only publishing platform, put PDFs on a FTP site.
Isn't this like a revival of the dreadful era of browser plug-ins from Adobe Flash Player to Java applets?
The issue with flash and applets was not that you had to download stuff.
It was that the security was non-existent (leading to the embedded runtime routinely crashing your browser), the interactivity was divergent from its surroundings, and the accessibility model was MIA.
Also downloading 500K over 56k and over fiber or 5G are rather different propositions.
If we had block API and SQL (it could be just a concrete version running from WASM itself, to not bloat browser itself) it could save a lot on app size. App then could look at browser version and decide to use that or to download newest one to run.
Not only that, but WebSQL disables a lot of mundane functionality, like the instr() SQL function and it's impossible to VACUUM because WebSQL requires explicit transactions and VACUUM cannot run in a transaction. i had the "pleasure" of having to work with WebSQL over the past couple of months for purposes of comparing its performance to the new sqlite features, and IMO, WebSQL is, as the kids say today, _weak sauce_. Its API is far too limited.
All of a sudden you have multiple slightly different instances running just because there isn't a standard.
WASM SQLite is the correct solution. It’s extendable by the developer using it, they can uses SQLite extension modules, and build their own.
But almost more so it proves the idea of a WASM db engine backed by a low level block FS api. We will see other db engines uses this architecture. DuckDB have already done it. I’m sure MongoDBs Realm and CouchBase Mobile will do the same soon too.
We are in for an exciting time in the next few years.