Archivo para 8 diciembre 2011

QMLPart: enabling a declarative web

As some of you already know, I started last year with some university friend Wadobo, a spanish-based free software startup. Lately we’ve been working with QML and now that I know it, it’s really nice. Some weeks ago I was with danigm (also from Wadobo) and we were talking about how nice it is to do mobile applications in QML, and how web applications are taking over desktop applications more and more. Do you know GTK already has an HTML/JS frontend? Demo here. BTW, Gnome guys have been working on something similar to QML too, ClutterScript.

And then the idea came out of the blue. QML could be (in my dreams 馃槈 the successor of HTML. I know, sounds crazy doesn’t it? That’s because it is crazy. So anyway, I wanted to test the concept, and today I coded this litle KPart called QmlPart that simply loads a .qml file into the KPart. The code is really minimal and it works beautifully, both in Konqueror and in rekonq, and loads fine both local and remote QML files and remote files, even if the QML application is divided in multiple files.

I am really surprised how easy it was to do this KPart. I uploaded to wadobo’s web server the Qt Declarative examples and most of them work out of the box with QmlPart. Here is a screencast:

Why would we want to make the web declarative? Because QML is much more powerful than HTML/CSS. Those of you that know QML will probably agree. HTML doesn’t even have a proper way to create column or row layouts. All kind of animations, transitions, states are easy-peasy in QML. And its object orientation is quite powerful, as they have properties, inheritance, etc. The web of 2011 can be much easily done in QML than in current web technologies.

What would be the path of action? This is just a proof of concept, and it might end here. Or it might not. If we get serious, we would first try to agree in a standard for a declarative web (talk to Gnome/ClutterScript guys), work in including this standard in web browsers, create a library in Javascript that allows loading declarative files as HTML/JS as a fallback for browsers without native declarative web support, and that way we can attract people to the platform, and then we would have something.

Either way, I had my fun today with this little kpart and all those crazy ideas around it. Mission accomplished.