News for hackers. Stuff that matters.
Re:Brython: an implementation of Python 3 running in the bro... by bri3d on Monday July 19, 2021 @05:24PM (#27887419)
The "y to CSS" part would still be there - even with WebAssembly, your UI options are still pretty much the DOM (great for documents and form entry, not so great for applications) or canvas (too low level and loses platform consistency, accessibility, usability, really every affordance of an operating system).
Re:Brython: an implementation of Python 3 running in the bro... by UnpossibleJim on Monday July 19, 2021 @10:51PM (#27889602)
I'm going to ask an ignorant question and I'm sorry, but couldn't you basically write an application in web assembly, using OpenGL and creating whatever UI you wanted in there, and just use CSS for the scaffold? You'd only need a mobile and desktop web app, but you'd need one anyway, right? (Note.. I'm very obviously not a web developer, so forgive my naivete).
Re:Brython: an implementation of Python 3 running in the bro... by bri3d on Tuesday July 20, 2021 @11:21AM (#27894856)
That was my second option - canvas.

WebGL is a type of HTML5 canvas context. Unfortunately, there are major drawbacks which I also outlined - it's too low level and loses platform consistency, accessibility, usability, and really every affordance of an operating system - you're starting over from scratch and loading in dependencies or writing your own implementation of some immensely challenging concepts (font rendering on its own is usually several hundred kb of code and could fill textbook upon textbook).

If you're familiar with GL UI frameworks like dear-imgui, they do all work pretty well in WebAssembly. But again, they're compromised from the start because you lose all OS consistency and accessibility. And unlike in games, where these frameworks are often employed, OS consistency isn't expected, and accessibility is sadly ignored, the experience of a cross-platform UI framework appearing in a canvas element on the web becomes jarring very quickly.

There is an alternative approach, like Google Docs employs and the sibling poster linked - combining the DOM for input elements with custom rendering. But, this is really, really complex and challenging.

Every time I develop applications for the web, I yearn for an application-focused presentation layer which provides the expected fundamentals around accessibility, OS consistency, and rendering layout while ditching the hacks-on-hypertext minefield of CSS and the DOM.

Re:Brython: an implementation of Python 3 running in the bro... by hnfong on Monday July 19, 2021 @11:21PM (#27889752)
Yes. For example: https://workspaceupdates.googleblog.com/2021/05/Google-Docs-...

But it's going to be a very "heavy" custom framework that takes time to download and load. Overkill in most cases.

Re:Brython: an implementation of Python 3 running in the bro... by UnpossibleJim on Tuesday July 20, 2021 @10:37AM (#27894277)
Ok. Makes sense. Thanks =)
Re:Brython: an implementation of Python 3 running in the bro... by peterthehacker on Monday July 19, 2021 @07:46PM (#27888575)
Good point. I was thinking of changing styles via DOM, like CSS-in-JS, but you’re right that “y to CSS” would still be there.