@zl2tod @becomethewaifu @thomasbeagle
I don’t like to blame abstraction because good abstractions are crucial to building performant systems. No one can have in-depth knowledge of how to optimise every layer in the stack.
The problem is that many of the abstraction layers are built either for a set of requirements that no longer exist or with no reference to the needs of the layers above.
To take a trivial example:
OpenStep (1994, later rebranded as Cocoa by Apple) has an incredibly rich view class for editing text. It gives you a zero-effort way of providing a plain or rich-text editing functionality but also gives you hooks to plug into any aspect of the layout pipeline. You can precisely control kerning, define the shapes that text will wrap into, replace the hyphenation algorithm with one of your own, and so on. It integrates with the native scroll view, so it’s easy to render large amounts of editable text that exceed the size of the screen. 90% of uses just pick the default. 99% are handled by just setting attributes on ranges in the text that users provide. The remaining 1% use the fine-grained control. This means that basically every native Mac app gets to reuse the same code. It spent a couple of decades getting optimisations and rich text editing is smooth and consistent across all Mac apps that don’t use Electron.
Now contrast this with web apps. The web provides a native plain text editing box that gives almost no control over the contents. It provides a rendering tree for things in the DOM that you can control. But if you want to create an editing view for rich text (especially if you want it to have custom semantics), you don’t have a good common abstraction. So everyone implements their own, using bits of JavaScript that go and produce terrifyingly layered things in the DOM. And this is much slower than a native rich text view on macOS.