10 ms·
Oof - the point of WebAssembly is not to stick your entire UI in Canvas. This really rubs me the wrong way, it's a major step backwards for accessibility and u
by danShumway 8y ago
Oof - the point of WebAssembly is not to stick your entire UI in Canvas.
This really rubs me the wrong way, it's a major step backwards for accessibility and user control.
WebAssembly lets you bypass Javascript - it should not be viewed as a license to build web apps that ignore user-defined shortcuts, don't work with screenreaders, aren't responsive on mobile, can't be customized with user-defined CSS, and that can't be scraped or automated in the browser.
Honestly, at the risk of sounding dismissive, I am increasingly suspecting that native developers just don't understand what the web is trying to do. The web is different from native because it's solving problems that native developers don't even realize they have.
Sometimes APIs on the web are difficult because they're poorly designed. But sometimes APIs are difficult because they're solving really hard problems that developers aren't aware of. Before those APIs are thrown in the trash, we should take a step back and think about why they were built in the first place.
It will be a large blow to the software industry if the result of WebAssembly is that everyone ignores large portions of what made the web great in the first place.
- gear54rus 8y agoWell tough, should've thought about it before proposing it. Now every fat ad fucker with money is going to shove banners using new black box and nothing is going to stop them. Do the benefits outweigh that problem? Up to debate. Mixing "difficult APIs" into this is just missing the point IMO. It's the black box potential that attracts the average web pest today.
- danShumway 8y agoIf we want to tackle black boxes, the problem isn't so much WebAssembly as it is Canvas itself. As to whether the benefits of that outway the problems it introduces... eh, people can decide that for themselves. Not to diminish what you're saying because I agree with you, but I'm less upset about malicious site operators (they could always have been doing this even before WebASM) and more concerned about the beginner (or advanced) programmer that's looking at this thinking, "sweet, I can write my app in Qt, hit an export button, and everything will magically just be fine." Honestly, I'm not even upset at that developer - they should be able to just hit a button and have it magically work. I'm upset that Qt isn't rendering any of their stuff to the DOM. CSS is good enough to handle this nowadays, it can't possibly be easier to write their own rendering engine from scratch than it would be to just use the tools that are already built into every browser. They should be using Canvas only as a fallback when nothing else will work.
- badsectoracula 8y agoIt probably is easier to write their own rendering engine because, sadly, they've already have done it - for quite some time now, instead of using any native drawing functionality Qt renders the entire window contents in a pixel buffer and dumps that to a native toplevel window (FWIW GTK+ 3 and later do the same thing). In this case all they have to do is dump the pixel buffer to the canvas instead.
- candiodari 8y agoIf the web had decent components for apps with a consistent look, behavior and data model across browsers, perhaps this is how things could be. Fact is, after 38 (!) years HTML does not have a data list component that works well (what I mean is [1], something that I could put 10.000+ items in and expect to work. Something useful). I don't know about you but I'm not even 38 years old, so given that people are starting talking to me about midlife crisis, implying I'm about halfway to death by natural causes, I think at this point I should conclude I will be dead before the web will have basic usable working components. Also I hate the totally inconsistent look of the components we do have. I mean anything I make on linux or windows is close to intolerable on mac. Which is, of course, why all designers totally avoid them and instead just totally redesign everything from scrollbars to buttons. The web is ... decent ... for what are essentially slide handouts ("websites"). Let's start making some real applications now. [1] http://doc.qt.io/archives/qt-4.8/qlistwidget.html http://doc.qt.io/archives/qt-4.8/qlistwidget.html
- pjmlp 8y agoBecause we all know how WebForms, JSF, GWT are so great at it. Not only do we need to deal with rendering to the DOM, we need to hack their rendering code when CSS issues pop up across browsers.
- jcelerier 8y ago> it can't possibly be easier to write their own rendering engine from scratch Did you know that the original rendering engine of webkit & blink, khtml, was Qt's ? Besides, the platform abstraction that allows to use Qt on top of WASM is less than 3k lines of code - everything else is the same whether you're on windows, mac, whatever.
- ex3ndr 8y agoOr you can just implement required accessibility features somehow.
- danShumway 8y ago> somehow That being the required word. If Qt does all of its own rendering and ignores browser APIs, there's no way for it (just as an example) to defer to custom system fonts if a user is dyslexic. Even assuming that the browser did expose everything necessary to re-implement its accessibility stack, screen readers and translators on the web are all using CSS and the DOM to figure out what to say. The only way to get real integration with browser accessibility tools and extensions would be for Qt to put wrappers around all of the entry points like DOM selectors. And if that's the plan, why not save everyone a bunch of trouble and just use the DOM correctly to begin with?
- TimTheTinker 8y ago... But it is possible to write bridge code that uses browser APIs to provide custom user fonts to Qt for use in a <canvas>.
- danShumway 8y agoOh crud, you are completely right about that. I forgot that canvas allows you to pass in a font family when it draws text. Fair enough, Qt could theoretically read a font from the body CSS and then use it for internal text rendering. Although, correct me if I'm wrong, but Qt probably isn't using `fillText` to render it's font. A few other people here have mentioned that they're doing their own rendering and spitting out raw pixels. (As far as I know) there's no way for Qt to leverage user fonts if it keeps on using that strategy. And again, if they're already planning on abstracting text out to use native browser APIs, why not go all the way and put the text in a DOM element?
- martin_ky 8y agoThis release of Qt for WebAssembly is the first officially released prototype of this technology. Qt comes from the native desktop world where it relies and builds on top of the whole rich world of native OS APIs. There's nowhere near that API support on the web platform at the moment. Also Qt might not be using the full capabilities of the web platform in this first release. Naturally, the first results are crude. But Qt has a great platform abstraction mechanism, so I'm sure it will only improve over time, either making better use of existing web APIs or support new ones as they become available. Also it is worth to point out, that there are really 2 GUI toolkits in Qt: Qt Widgets - the more classical, desktop UI paradigm. Yes, this renders everything into a bitmap and therefore translates better to the Canvas model on the web. QML / Qt Quick - more DOM like, declarative UI with modern animation, scripting and data binding features. This maps better to the HTML DOM model. In theory at least, however, the similarity is only superficial. Under the hood, the QML visual elements are rendered with WebGL.
- alxlaz 8y ago> WebAssembly lets you bypass Javascript - it should not be viewed as a license to build web apps that ignore user-defined shortcuts, don't work with screenreaders, aren't responsive on mobile, can't be customized with user-defined CSS, and that can't be scraped or automated in the browser. At the risk of sounding dismissive of web technology, this describes virtually every web application I've seen. Many years ago (early 00s), I dreamed of a web that was exactly as you describe it, but what we have today is far from it. If applications that don't overload user-defined key events (apparently, this year it's trendy to ignore Page Up and Page Down events because they break custom scrolling...), respond well to being customized with user-defined CSS, are easy to scrape and automate, and don't have entirely foreign and weird UI metaphors were a thing on the web, we certainly wouldn't have people clinging to native applications. But this really isn't the web we have. What's left as an advantage for this model of running native UI code in a canvas is that at least you get native looks, as opposed to whatever the cheapest UX designer the company managed to hire cranked out on his sixth sleepless night in a row, and get to skip the boring installation, and get some free sandboxing with it. It's definitely not great and it's far from what I hoped we'd have but I'm willing to take it over what we have now.
- martin_ky 8y agoI think, it's time to start to perceive content publishing and application authoring as two distinct disciplines. The problems you describe arise from mixing them freely and without much thought.
- danShumway 8y agoI've posted this elsewhere as well, but I don't think they are two separate disciplines. I think that application authors in many cases should be restructuring their apps to fit content publishing paradigms. The majority of native apps that I use basically boil down to fancy ways to display or edit document-like data. Music players, maps, terminals, text editors, file browsers, etc... I think these interfaces would all be more elegantly expressed via an HTML-like model; and the insistence of application developers that they need pixel-perfect control over these kinds of interfaces is just a relic of a world when everyone used desktop computers with a single resolution monitor. There are of course a ton of smart people who disagree with me on that, so take it with a grain of salt.
- 1ris 8y agoThe web today rebuilds the scrollbar in javascript (overriding Browser UI), reimplements the DOM in js (I doubt this abstraction is more lightwight than rendering into a convas) and builds single page applications (making URL way less usefull, breaking back and forward, and open in new tab buttons). This doesn't look any different. This web application does not have to pretend to be a hypertext, but otherwise this looks very familiar. And there is something to gain: A proper language, less resource wasted at run time, the vision of "Compile once, run anywhere", but this time for real and sandboxed.
- Vinnl 8y ago> The web today rebuilds the scrollbar in javascript Who does that? > reimplements the DOM in js I am assuming you are referring to the Virtual DOM? In which case: no it doesn't. It's an abstraction for working _with_ the DOM, but it doesn't do away with all the advantages of the DOM - like canvas does. > (making URL way less usefull, breaking back and forward, and open in new tab buttons). This indeed used to be done, but with the History API having been usable for years, you hardly ever encounter that any more nowadays.
- pjmlp 8y ago> > The web today rebuilds the scrollbar in javascript > Who does that? Google in some of their developer docs for example.
- hajile 8y agoWebkit browsers have the (somewhat limited) ability to manipulate the scrollbars with pseudo-selectors. For everything else, it's JS or deal with whatever horribleness that browser gives you. History API is standard, but not usable for a lot of things. I'm on a project that has to play nicely with server-side routing, so we are forced to use hash routing like it's 2001. Likewise, the ability to save state in the builtin History API forces some workarounds and doesn't play too nicely with things like testing.
- 1ris 8y agoWhat pjmlp and hajile said. Besides: Yes, I meant virtual DOM. And yes it does. It's another (complex) layer of indirection encapsulating already extremely high level API, that is already looks like the most elaborate API to navigate a tree. And what advantage does using the dom bring me? Respect my font settings? My system Theme and accessibility settings? In theory zooming should be easier, but in partice it isn't. My keyboard settings more than a canvas? Is is really easier for a screenreader to navigate thru thousands of divs (with CSS!) and images with no alt text then just take a image and OCR it? Text reflow on mobile is better. But AFAIK Chrome removed this feature because it broke to many websites anyway. Opera is the only brower to do it. Market share ~5%. Even with the History API you completely break all assumptions about url. You can share a link with a single page app just like you can with this example; it doesn't make much sense, tho.
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- deleted 8y ago[deleted]
- martin_ky 8y ago> Oof - the point of WebAssembly is not to stick your entire UI in Canvas. Well, the way your operating system works with UI is that it gives each application one or more pixelbuffers, where the apps draw their pixels however they want (2D drawing API, 3D gpu-accelerated API, a widget toolkit, a HTML DOM renderer, etc). At the end of the day, you could say that any application interface is just a metaphorical Canvas - a memory buffer that is composited with other apps and eventually copied over to the screen buffer by the OS. Web browsers are becoming more and more like operating systems in this regard. Is it a good thing? That would be a good discussion. > This really rubs me the wrong way, it's a major step backwards for accessibility and user control. Accessibility has really nothing to do with Canvas, when you look at it simply as the API for drawing pixels. Accessibility is a way of providing the OS (or in this case the Browser, which in turn provides this info to the OS) with a parallel stream of information that describes the scene (text content, navigation controls, etc.) The OS then makes this info available to accessibility tools such as screen readers or data scrapers. Accessibility is a completely orthogonal concept and should not be tied to rendering. For example, you are probably not going to need to support a Braille screen reader in a 3D zombie shooter game, yet you can use Canvas 3D to render it. After all, accessibility in games is a different topic entirely. What you want, is an accessibility API that you can use or ignore, depending on your use case. If you don't want to deal with an accessibility API manually, use a widget toolkit that does it for you. Coincidentally, the Qt Widgets library has accessibility features implemented when the underlying platform provides an accessibility API. > Sometimes APIs on the web are difficult because they're poorly designed. I agree that most of the issues described in the parent post is a direct consequence of bad or non-existent API. After all, a runtime is nothing without powerful APIs. > I am increasingly suspecting that native developers just don't understand what the web is trying to do. The web is different from native because it's solving problems that native developers don't even realize they have. In all honesty, I believe if web developers took some lessons from the native world, they would realize that many of the problems of the web platform arise from its poor design and application of wrong paradigms on the wrong problems. Take the whole web UI thing for example. Even most trivial things, like trying to center something on the screen in HTML+CSS is a horrendously difficult chore with many possible and no right way of doing it. The whole idea, that a simple markup language that was designed for publishing and linking of text documents, can be used as the basis of a general-purpose application platform, is ridiculous.
- pjmlp 8y agoMany of those native developers are actually full stack developers that have seen both sides of the fence across several jobs.
- de_watcher 8y agoLet's be real. The defining thing of the web was the distribution model: you install a VM (the browser), and all the software just loads. But the rendering/interaction web tech was designed for documents, not applications. That browser VM is an OS in disguise. We should be able to use application development tools on it.
- flohofwoe 8y agoI mostly agree, but: > Sometimes APIs on the web are difficult because they're poorly designed. > But sometimes APIs are difficult because they're solving really hard > problems that developers aren't aware of. Before those APIs are thrown > in the trash, we should take a step back and think about why they were > built in the first place. I think the reality is much simpler. Most Web APIs are bad because they have been designed to solve an overly specific problem, with the assumption that Javascript is too slow, and finally messed up by too many cooks. The worst examples are WebAudio and WebRTC. A good Web API (unfortunately about the only one) is WebGL. Most Web APIs deserve to be thrown into the trash TBH. Browser makers and web standard makers need to read the extensible web manifesto again and again and again: https://github.com/extensibleweb/manifesto https://github.com/extensibleweb/manifesto
- hajile 8y agoConsider Electron if it shipped with only v8, wasm, and a builtin canvas-style buffer without the rest of the HTML trappings. You now have a UI platform that is safe, performant, and (most importantly) runs everywhere the same way. The web is creeping closer to becoming a Java that actually works. In another decade, we will have come full-circle. Someone will have the "new" idea of adding a declarative layer (maybe with some XML-like syntax) that can be translated to canvas. While the few remaining old devs will remember, all the new devs will jump on this "emerging technology" and we'll start re-inventing anew. And so the wheel turns....
- profalseidol 8y agoAh The Wheel of Time. It turns and Ages come and go, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth returns again.
- cjhanks 8y agoNo disrespect intended, but not all worlds are the same. A lot (maybe most?) of software is written for explicit purposes to targeted audiences. I am not going to hire a blind person to label signs, a deaf person to review music, or an illiterate person to review books. Sometimes you have a bunch of C++ code that works, but the difficulty of application distribution upgrade is high... okay, to the web we go! FLASH was bad in many of the same ways; but it played a valuable role in people's lives.