125 points · by jcelerier · 9y ago · 118 comments
Adding a new thing for all browsers to implement and slowly become consistent on just as CSS is maturing into something great with flexbox and grid support in more browsers doesn't seem to be addressing the quoted problem. ... I assume the author's idea wasn't just that browsers should all adopt Qt's implementation and stick to that one implementation.
If people want QML in webpages, surely that could be implemented on top of JS+HTML+CSS like a web framework. If it as a web framework is shown to work very well for developers and fit the web ecosystem but has some practical issues like performance, then that would be good fuel to motivate browser developers and standards groups to standardize webpages based on QML. If it as a web framework works well and doesn't have intractable performance issues, then ... it could stay as a web framework and become popular if it really does work well for developers. Why saddle browsers with the responsibility to implement more than they need to if HTML+CSS+JS provides a good base for other paradigms to be implemented on top of?
I'm not a fan of stacking too many abstractions on top of each other. QML basically consists of the same ingredients as other web tech: a javascript runtime + GL/ES renderer + network access manager = same things a HTML5 engine needs under the hood. Surely these could be reused in a browser implementing QML.
https://blog.chromium.org/2017/05/goodbye-pnacl-hello-webass...
There is the Qt Quick WebGL Streaming official project - https://news.ycombinator.com/item?id=13744631 - but this is a different thing entirely: instead of running the QML app on the client, the app runs natively on the server. Instead of rendering the UI directly using OpenGL, the scenegraph generates a stream of WebGL commands. An accompanying JavaScript library receives this command stream through a web socket an replays it in the browser on a WebGL canvas. Kind of like what Remote Desktop does.
Also:
> Building for HTML5 is free. There are some non-essential paid tools that can help. Qt requires a commercial license for most commercial use on mobile.
Source: https://www.developereconomics.com/cross-platform-apps-qt-vs...
https://github.com/qmlweb/qmlweb/projects/1 shows how much is yet to be done.
My opinion is that QML not going to supersede web tech any time soon. As broken as CSS is, it is here to stay for the a while yet. The tooling for QML isn't great. You're heavily relying on QT Creator etc and the licensing around all that stuff. The exact opposite of FOSS that the web embraces.
Also FWIW, I know it's a holy issue but when you copy lines round in python etc you ARE having to add and remove those extra bits of syntax except they're invisible, they're spaces/tabs (don't even). Any sane person would have to have white space visibility turned on in their editor so would just be looking at cruft anyways.
What I ultimately wanted, was to get a discussion going and see if other people (who know both QML and HTML) share my view - that QML would be a great alternative (not replacement) to HTML for writing web UIs.
[1] https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL
The same is true for Microsoft's XAML, except XAML is a general-purpose configuration language for describing a collection of .NET objects -- in some ways it is comparable to Spring in Java.
Way back in the day, Visual Basic was a system for "writing simple code that creates a collection of objects", most famously for GUIs.
use CSS preprocessor to generate CSS
use framework (i.e. React) to transformate pseudo-HTML component model to HTML5 at runtime
use a tool like Babel to transform your-favorite-pseudo-JS (i.e. Typescript) to the JS-supported-by-the-users-browser-at-that-session
... all of this only for making alive a GUI.Seriously, it is like a sick joke. HTML was never designed for declatatively describing an UI and we have had to kludge it for the last 15 or 20 years. First, with forms and input tags and postbacks, then with AJAX, now with S.P.A. tools. It's still a heap of kludges.
The sooner we can have a good,state of the art, portable, declatative UI language, the better.
All of this for making alive a GUI using the 2017-summer-season toolchain. Meanwhile, plain HTML with <form> elements and server-side processing miraculously continues to work.
Of course i would be very happy if I could still do everything done in such way...
How is QML different from XAML? XAML isn't purely a UI markup format, but it doesn't seem to have gotten traction with the web development community. Someone has created http://www.cshtml5.com/, but it's not something I've seen developers talk about within the .NET community (the most likely people to adopt XAML, if it became available for the web.)
QML / Qt Quick gets a lot of traction, from mobile and embedded systems developers and lately a lot from automotive industry. It's just largely unknown to web developers, because it's not on that platform. What I would like to see, is that it got noticed from web developers too and then maybe it will get some push to get to the web.
> they aren't as flexible, don't solve web problems as well as the existing solutions
IMO, it's the current web technology that creates those "web problems" :) I don't say that QML solves them all. But it couldn't hurt if we have an alternative to HTML+CSS.
I went from a project using xaml requiring massive system resources to another built in qt running speedily on an intel atom. I wasn't too familiar with either frameworks when I started. Qt was also way easier to maintain despite being built on top of c++ template magic
MVVM is not an anti-pattern, it's just a simple way to communicate changes to a retained-mode UI framework (XAML's rough analog to React's shouldComponentUpdate). Data binding prevents a lot of error-prone glue code.
Disclosure: I work at Microsoft.
To give my reference, I'm getting smooth 1080p 60fps when not too many shaders are involved with Qt on a Raspberry Pi 3.
That said, it is, by far, the best desktop UI library for Windows-only apps. I wouldn't consider using anything else until/unless the following were equal to WPF. The amount of engineering gone into the framework, the thoughtful design, the critical mass of use.
QML is a declarative & reactive programming language, while XAML (and FXML mentioned earlier) are only for markup.
You can't do this in pure XAML:
Item {
x: 5
y: x + 2
Timer {
onTriggered: x = x+1;
interval: 50
}
}
Here, every 50 milliseconds, x would be updated, and y would be updated automatically accordingly to the new value of x.That's a great point.
Here's a clarifying question: regardless of the quality of HTML5 standards, does access to inline svg DOM nodes fulfill an important purpose? If you think the answer is yes, then QML cannot replace HTML5 because its primitives are less expressive than SVG paths.
How about patterns and vector effects?
Perhaps, I should clarify... In my blog, I don't call for replacement of any current web technology. I am simply proposing an alternative client language that would exist side-by-side with current tech. Purely from technical perspective I believe QML could be this language, because unlike HTML, it was purpose-designed from the beginning as a UI language.
It does not mean rewriting browsers from scratch either. QML and the Qt Quick library share many aspects and technologies with any HTML browser - a JavaScript core, a web access network stack, utilizing native graphics acceleration APIs. So already there would be many common shared components. In my idea, QML would be just another frontend (language) reusing those components. Although implementing QML on top of current tech (HTML+JS+WebGL) is also within the realm of possibility, it's entirely not what I had in mind and would defeat the purpose.
I also don't want to add any non-standard extensions or plugins to existing browsers. What I would like to see, is QML being adopted as a new web standard. I realize this does not happen overnight and that there are political, commercial, licensing and consensual prerequisites that need to be solved first. It would be interesting to hear the thoughts of Digia and KDAB (the companies behind Qt) on this.
From a technical standpoint, I don't see any obstacles why this could not happen. QML is conceptually a simple language and I think it could be standardized relatively easily. The next step would be to standardize the library of UI elements (Qt Quick) or its minimal viable subset for version 1.
It seems like there needs to be some strategy for how this would roll out to market and feasibly gather market share before I could take the concept seriously.
The goal would be strictly to get .qml supported as a render target the same way .html (and in many browsers, .mp4 / .png / .svg / .json etc) is today.
Single code base to create rich Android, iOS and browser app?
This is not necessarily what is wanted though. You are thinking like a graphic designer and ignoring accessibility, user preferences and genuine client platform considerations (imagine a web app designed before the advent of smartphones which assumes the presence of a mouse). The way the web works is as a negotiation between the developer/designer and what the user's browser is prepared to present to them (based on how it's been configured).
What of being described here is something a lot more like flash. Which is possibly OK for actual native applications.
React and Angular and their ilk are too abstracted for my tastes. Too much tooling required.
This is my experience learning angular for my latest role.The basic concepts seem easy to grasp but there are so many thing going on "for free" that I can't reason about what is actually happening. I'm hoping it becomes easier with time but the tooling is making things harder than it needs to be.
And what jQuery does not do is the one important thing — declarative data binding.
By the way, another built-in thing in browsers is Web Components — having a component model is also necessary for modern app development. So if you take Web Components and add data binding and some other sugar, you get Polymer. Here's a good overview of each layer of sugar it adds: https://www.youtube.com/watch?v=assSM3rlvZ8
I also don't like React and Angular — but I absolutely enjoy working with Polymer.
I'm not sure if that's a particularly good feature to have. At the very least, the ideal UI for a desktop application will usually be different from that of a mobile application.
By all means make it cross-platform, but there really ought to be mechanisms for adapting to different platforms. HTML+CSS does a reasonably good job of this nowadays.
I've talked before about an idea to split layout into a new technology, freeing HTML and CSS to only consider content and presentation:
It's not the simplest or clearest thing around.
The easiest-to-integrate React/Vuejs components are very close to purely declarative, in my experience.
It behaves like a widget-based programming language toolkit, so you would have global style properties with per-item optional overrides.
First we'll start by breaking the browser and everything that integrates with it.
FTFY
There are many shortcomings to HTML, yes. "Just replace it" is not the right answer. It has never been, for the same reasons that you don't "just rewrite" an old code base. There's more value than the naked eye can see.
(Oddly, the web has just the example for that - Netscape 6.0. That was a from-scratch-rewrite, and oh my, was it painful)
Poorly.
You can restrict future versions, but what exists now is absolutely free to use by anyone. If browsers wanted to adopt QML according to its current API, Digia could never, ever, ever do anything to stop them as long as the products obey the LGPLv3 source version.
QML is a great answer to "a web UI standard" but the web is built on backwards compatibility. Of that restriction were born fantastic technologies and toolkits, such as React, which make the need for an answer kind of moot.
I think this is a case of: "if it were going to happen, it would have happened already". QML has existed for a long time (8 years is like five decades in web years) and it hasn't happened. Same reason I kind of roll my eyes whenever people mention client-side certificates when good CSA solutions are brought up... if it were gonna happen, it would have.
What is this being downvoted for now?
QML in the browser doesn't fill an actual need, and because it's unknown to most web devs even if perfect support magically appeared in all browsers tomorrow, it would not actually be used right out of the gate.
It was, at one point, but now that all of the browsers autoupdate and mobile device lifespan is about 2 years, it's rare for anyone to test on anything very old. Try submitting a bug to a site that things don't work on IE5 or NN6.
You can browse essentially every single site from 1995 and see exactly what you would have seen at the time.
> if it were going to happen, it would have happened already
Backward compatibility allows another technology to be used side by side with existing one ( WebAssembly ? ).
"How far can you go with MySQL or MariaDB?"
No.
At the very least the "law" needs to be rephrased in a less catchy way, but then no one would reference it.
> No.
Seems to me like a clear, coherent and realist answer.
"No."
I mean, that's not entirely wrong. You'd go much farther with PostgreSQL. ;)
Yes, QML is nice. Yes, it would be great if everyone used that instead of <your solution here>. But it's not going to happen. What will happen instead is that web-native solutions will outcompete imports again and again, as they have since the dawn of the web, because the shape of the space itself privileges solutions that are able to handle the terrain. Yes, React kind of sucks in places. Yes, its PATENTS file is discomfiting. No, it won't be replaced anytime soon; we literally just got here.
Attempting to replace front-end web dev with markups and paradigms from the desktop is the software equivalent of marching on Moscow. There are better things you could do with your soldier's bodies.