Gtk3 vs HTML5

The last few weeks I’ve been working on an interesting new idea, hacking out a prototype.

The code is not really clean enough for public consumption yet, and a bunch of features are missing. However, its now at the stage where it can be demoed and evaluated.

I think the best way to introduce it is via a video: (original theora file)

[vimeo width=”763″ height=”512″]http://vimeo.com/17132064[/vimeo]

Basically, its a backend for Gtk+ 3 that renders in a browser.

A more techincal description for the web geeks among us:

Each toplevel window is mapped to a canvas element, and the content in the windows is updated by streaming commands over a multipart/x-mixed-replace XMLHttpRequest that uses gzip Content-Encoding to compress the data. Window data is pushed as region copies (for scrolling) and image diffs. Images are sent as data: uris of uncompressed png data.

Input is gathered via dom events and sent to the server using websockets.

Right now this is Firefox 4 only, but it could be made to work in any browser with websockets.

Now, I want to know, Is this useful?

There are two basic ways to use this, you can either run your own apps on your own server and access it from anywhere (kinda like screen). Or you can put it on a public server that spawns a new instance of the app for every user (gimp on a webpage!).

If you had this technology, what cool stuff would you do with it? What apps would you run, and how would you use them?

175 thoughts on “Gtk3 vs HTML5”

  1. > If you had this technology, what cool stuff would you do with it?

    I’d use it for a new version simple application – the Awkwords word generator (see the website). So far, it’s been a web application. I am planning to completely rewrite it for the 2.0 version and I’m not quite decided yet if the new one should be a web application again, or a desktop application. Many people find it convenient to use it on the Web but some have asked how to use it offline. For using it offline one has to install Apache, PHP and put the application in the web root. Not convenient, a real desktop app would be better for offline use.

    So, if it was possible with a good toolkit (which GTK presumably is) to develop an application that could be either installed as a classic desktop app or used remotely as a web app, I would use that for the new version of Awkwords. Everyone could either use it as before over a web interface, or install it locallly. I’d prefer a quality implementation, that is:
    – fast: it should run on slow connections sufficiently, as a normal web application would
    – compatible: supporting a variety of browsers

    Transmitting pixmaps is not a way to go – at least text and basic form widgets should be translated into HTML to save bandwidth and to enable the browser to see text as text, not image.

    The interface should be then operated offline (as it normally is in web applications, not counting AJAX), a message to the server would be sent only if the user does something that triggers a function in the application. That is, if I for example just change the text in a text field an I have no callback hooked on that in the application, it should be done completely client-side without contacting the server. Then, I would for example click the button “Generate” in my app – the client side would know my application has a function hooked on the click on that buttion, so it would send the state of the UI to the server and trigger the signal there.Similarly, if a change in the UI is made server-side, the server would trigger an update in the client-side UI. I think it could be done with GTK generating some javascript with AJAX. A javascript would have to listen with AJAX for server updates – there is a toolkit called APE ( http://www.ape-project.org ) for that.

    That’s just my ideas. I think the idea of having the same app accessible both as an offline installed app and as a web app is interesting.

  2. It’s a step for gtk to become a RIA platform. It make X server become obsolete. But it’s not enough. Qt with QML is better. I expect the QML runtime for web browsers. But Flex is still the best choose.
    If the X/Gtk guys implement NeWS for linux in 1990s. The linux GUI architecture will ahead of the times. What a pity.

  3. Are you kidding?

    I have a bucket of apps that I make available as web apps now that I would way rather distribute as zero-configuration desktop apps which is what this looks like from a user point of view.

    I have an employee compensation reporting and benefits management system that I would way, WAY rather write in GTK+ than the current morass of HTML, CSS, and JavaScript that the GUI requires now.

  4. “Using same library on desktop and web even without any plugins.”
    That’s sounds amazing.

    May be we can connect our linux desktops over web based remote desktop someday. huh! :)

    Thanks Alexander for great prototype.

  5. I agree with @tanisha: I can think of a number of “web” based games distributed under Firefox. No more javascript based widgets for me if this happens.

    Thanks. Let’s hope for a public release early this new year ;-)

  6. At first I thought this was somekind of HTML5 + JavaScript backend (everything running in the browser). I almost jizzed in my pants.

    But sending PNG’s is still cool, though produces a LOT of traffic and is not for scalable web apps whatsoever: try running 1000 gimps.

    Though accessing your own special app with that would be possible.

  7. I know exactly what I would do with it. I would replace all of the closed-source ERP deployments we have with a Tryton back end.

    The only problem with this solution is the requirement to constantly update the PNG images at high speed. ERP deployments tend to extend across broad regions, so this could get weird. It could also get crazy when a user connects over a 3/4G phone wireless connection through their browser (Firefox/Chrome/Safari) and has to suffer through blocky breakages that a test environment is not subject to (because usually you are on the same LAN as the test system when building a new system).

    So basically, if this could be brought to perform well under significant network stress, it would be an amazing thing for business applications and move them light-years beyond the current AJAX dependent world (granted, HTML5 has the potential to move the world beyond Flash and AJAX on its own anyway, but…).

    Awesome idea. GTK on the web. Even if your current streaming PNG concept doesn’t work well under network stress, the concept of pushing GTK through the browser is so good that the sky really is the limit. Imagine *any* GTK app being available over the web. If it worked smoothly and reliably it would entirely solves the application server dilemma — and introduce a somewhat frightening SaaS revolution, come to think of it.

    Cheers!

  8. With me, the wife, and the kids all being gnome and xfce users at home, it would be fun to run off a central server at home with a UPS. Well, it would be fun for me at least…LOL.

    This would be great in a small office too I could imagine

Comments are closed.

Leave a Reply

Your email address will not be published. Required fields are marked *