Hacker News new | ask | show | jobs
by yari_ashi_zero 3956 days ago
HTML is for hypertext documents, and CSS an organ of the same organism called 'HTML/CSS'. It's made for text documents, and applying it to the implementation of GUI-centric applications has always been an ugly hack. For awhile (90s to 00s AJAX) it was necessary, and now the whole professional ecosystem has built up tremendous inertia over the millions of accumulated people/hours of perfecting this 'competency'/hack. Now though, I would recommend to switch over to building 2D webapps entirely out of SVGs (say with React + Flux) e.g.: https://github.com/Terebinth/Vickers or, even better, to building them entirely out of WebGL. SVGs are easy and would lead to a wonderfully efficient workflow, but I think WebGL holds the advantage for performance considerations, given the way it goes to the hardware.
3 comments

I don't believe WebGL is suitable for rendering applications. Look at game UIs, they usually are either crap (low-cost games, where devs didn't sped too much time and simply blit button sprites somewhere on screen), or the authors had to implement a widget set on top of GL (WoW comes to mind). But a widget set is exactly what React and web components give you (built in top of basic building blocks like divs and spans and of course CSS for styling).

And while HTML was initially created for hypertext documents, it doesn't mean it can't be used for somthing else. I disagree that it's an ugly hack. Some parts may not be suitable for GUI apps (uhm, like <blink>), but then simply don't use them in your application. Or implement something better on top of the good parts (like React did). Eventually the good parts may be come standard.

Moving entirely to svg for user interface has some of its own issues (i.e. there's no default layout engine in svg; everything is essentially absolutely positioned...) but would be interesting to think about. Moving entirely to WebGL would only be viable if you don't care at all about accessibility though. For some subset of applications that might be acceptable (i.e. games), but for something like gmail or other similar applications it's definitely not.
You just have to create widgets libraries, compile them to WebAsm or something alike, and export an event-based framework for the developers to use. It can even be in another language, compiled to WebAsm.

Or, alternatively, you can just use Flash, instead of cloning it.

There is already a very compact 2D vector-oriented format with its own scripting language: SWF. You don't even need to use Adobe's implementation - there are alternative Flash Players and authoring tools out there.