| The separation between documents and programs assumes we know ahead of time all the things people might want to put inside a document. The evolution of the web shows this not to be true. Is Google maps a document? Obviously not. But a document can still embed a Google map meaningfully and sensibly. For comparison, consider that apple just proposed adding a html tag to display 3D models, just like an image. The problem is that even basic interaction with a 3d model requires complex controls. There is no single standard for materials and lighting. The going methods are optimized for photorealism. So adding a model tag just means baking in a set of assumptions, and doing so before you have a good idea of the kinds of things people will want to do with it and can't. This is the real story of the web: poorly conceived standards and APIs, frozen before the medium had time to find its feet. It's a horse designed by committee in a world of cars. You could turn the question around: why should webpages be dynamic at all? Just make a dumb client that requests rendered SVGs from a server after a client tells you its screen size. Oh but that can't work because it's not really a document, but a dynamically laid out program after all. If you want to displace the single page apps of the world, design a "document" format actually capturing all the nuances people want from them... Or get off the pot. |
Also this series of pages was extremely popular on HN, and can't be done without programs embedded in documents:
https://ciechanow.ski/gears/
In this case it's done quite "literally" !
https://ciechanow.ski/js/gears.js
Although on closer reading the OP does make a distinction between documents embedding programs, and programs that build up documents (like medium.com), which I agree is an anti-pattern.