3 ms·
Over the past year or two I've been working on a (currently theoretical) design for a kind of pseudo-competitor to the web that's based on that observation. Th
by mike_hearn 4y ago
Over the past year or two I've been working on a (currently theoretical) design for a kind of pseudo-competitor to the web that's based on that observation.
The fact that the web ignores most rules of platform design (because it was never meant to be one) isn't really a new observation. Most platforms build their higher level APIs on top of their lower level ones, so you can always drop down a level if the higher levels aren't working for you. You've got a widget toolkit but you can render your own and if you do you aren't losing anything else because you're using the same lower levels as the OS widgets.
So why doesn't HTML work that way? Partly path dependency, partly philosophy and partly the difficulty of sandboxing low level code, as the sibling comment observes. However, the latter has been getting easier with time as operating system kernels improve their sandboxing abilities. It's also not always necessary. Do I care if Slack or Hacker News is sandboxed? Not really. Some sandboxing is nice just for peace of mind against security exploits but I do actually trust these brands and don't think they're going to exploit me. A more aggressive sandbox is useful when following links to random unknowns like people's blogs, but the web's design doesn't recognize that such a thing as gradients of trust exist.
An alternative approach would be to reject the attempt to write a giant spec for all of computing, and instead embrace competition, diversity and layering. Start with a small core that knows how to download files and compose them together. It can fetch native apps into an HTTP cache, update them efficiently, execute them and delete them when the cache gets full. At that bottom layer the core enforces the platform's native security mechanisms (code signing, GateKeeper, SmartScreen etc). Then allow people to create native sandboxing apps that can be composed with other code to run that other code inside kernel level sandboxes. Responsibility flows downwards, so it's the sandboxing app that takes the risk of being blocked as malware if it fails in its core duty. Then you can compose VMs with the kernel sandboxing apps, and at each layer of the cake you're exposing IPC APIs that allow apps to e.g. allow their GUI to be embedded in a browser-style tabbed WM, to abstract and sandbox the platform's native accessibility APIs, to support form auto-fill and all the other features you might want.
Such a thing would be quite different to the web, for example it would naturally support command line apps and servers. It would also be less centrally planned, as the core would mostly be a kind of dependency resolver that ensures components can be connected together across sandboxed IPC boundaries and provides some level of UI sharing beyond the native window manager. The spec would be minimal - the downside is the user-agent would be less generically powerful because you aren't forcing everything into a single model, the upside is the spec would actually be implementable because it's not trying to do anything.
The design I've got also allows for document formats, crawling/indexing, authentication and other things that are useful to have in a web competitor, but there's no space to go into all that right now.
The biggest problem is one of incentives. Google's bottomless pockets makes browsers fat but also kills any incentive to compete, as there's no obvious way to pay for the maintenance of any alternative. Having a small and tight core spec helps, but someone still has to do some work. Apple solve it by selling hardware but nobody else has a workable economic model.
- mwcampbell 4y ago> to abstract and sandbox the platform's native accessibility APIs I wonder if it's important to expose something close to each platform's accessibility API to sandboxed applications, or only the cross-platform abstraction over those APIs. For the latter, my AccessKit [1] project might be worth looking at. [1]: https://github.com/AccessKit/accesskit https://github.com/AccessKit/accesskit
- mike_hearn 4y agoWhy not both? The idea behind allowing the sandbox to be pluggable is the sandbox authors can decide how and what to expose. If the sandbox author thinks it's safe to expose the native accessibility APIs directly it can, if they don't then they may wish to expose a platform-specific proxy emulation with extra validation (in the way that Chrome exports OpenGL into the sandbox), or they may wish to expose only a platform abstraction, and that platform abstraction could also be used outside of any sandboxes as well if the app is code signed. AccessKit certainly looks highly competent - putting an Mojo RPC interface over it would be a good way to expose an abstraction over platform specific a11y interfaces. And of course there's no rule that says an abstraction must always provide just the lowest common denominator. Abstractions can also expose platform specific features for the unique stuff that can't be properly abstracted. I suspect a11y APIs will gain significant importance this decade, once people realize they can hook AI up to accessibility trees more easily than working with pixels and the like.
- mwcampbell 4y agoIMO, now that I think about this some more, letting a sandboxed app directly implement native accessibility APIs is risky. First, there's the fact that on Windows, macOS, and Linux (or more accurately, Unix desktop environments that use AT-SPI), the native accessibility API uses screen coordinates. So a provider exposing screen coordinates outside of its window seems like a vulnerability. AT-SPI is very trusting of the toolkit/application in general, with no verifiable link between the accessibility tree and the X11/Wayland windows/surfaces. And while I'm not aware of other specific vulnerabilities in UI Automation on Windows, I wouldn't be surprised to find that they exist. I'm the least familiar with the macOS accessibility API. > I suspect a11y APIs will gain significant importance this decade, once people realize they can hook AI up to accessibility trees more easily than working with pixels and the like. I hadn't considered that programmatic accessibility might be helpful for AI applications. Within the accessibility community, AI is more often seen as a provider, i.e. filling in accessibility gaps, through OCR and now more advanced applications of machine learning such as iOS's Screen Recognition. But I hope you're right.