15 votes

Speedy Desktop Apps with GTK and Rust

Tags: rust, gtk

4 comments

  1. [4]
    feigneddork
    Link
    I think this looks really cool, and there is always something inside of me that gets really excited when I hear news about desktop GUI tools. At the same time, I think it will take a lot more than...

    I think this looks really cool, and there is always something inside of me that gets really excited when I hear news about desktop GUI tools. At the same time, I think it will take a lot more than just a nice wrapper around an existing GUI framework to sell desktop GUI tools to people.

    I think that a lot of GUI devs realise that quite a lot of people don't want to develop using Electron or make web based GUIs where we have this hefty server backend/JS frontend on the user's machine to do something (e.g. GitKraken). But the problem is that desktop GUI hasn't offered anything better than the current web development.

    Here is what current web development offers:

    • Multi platform development - if I write an app for the web, I can target lots of platforms - desktop, mobile, TVs? Basically anything that can run a modern web browser can run my web app. That's powerful as hell.
    • Better tools to develop UI - with desktop, the tooling is incredibly inconsistent and trying to get semi-complicated form layouts out (like e.g. having a label header, then having an inner layout manager of three columns where on the left and middle column is a list, and on the right is buttons like "transfer", "save", "cancel" etc) can be an utter pain to solve. On the web? Use flexbox or divs. You can find this out within minutes and implement a basic idea within 15-30 mins to get a feel for the design and whether it will work out or not.
    • Compilation - The best desktop UI I've ever used was Qt - it was a lovely event driven UI thing. The one thing I absolutely hated about it was the billions of toolchains that needed to be installed just so one evening I can make a "hello world" app and forget about it again. With web apps, there's relatively little compilation, even with node and some of the ugliness that comes with it (coughs node_modules folder, package.json bizzarre versioning coughs) it takes a matter of minutes to build a new project and then to package it up into something that is servable via netlify or whatever.
    • Licensing - Qt was amazing, but unless you were developing open source software pretty much forget about it. Compare this to webapps where a lot of them are just straight-up MIT licensed projects - and I'm talking about entire frameworks.
    • Rate of innovation on the tech - with desktop tooling, you'd have to wait months if not years to see a signififcant improvement in the tooling. Compare that to web development where I feel like I can't really keep up with the rate of innovation.
    • Rapid development iteration - I can just write code in my editor, save it, and the changes immediately appear in my browser. The old "make a change, then compile, then run it" feels ancient and obsolete when you've done web development.

    Now lets look at the cons of web apps:

    • Resource intensive - native apps are incredibly optimised with their platform. Web apps at the least need a modern, bloated browser which is basically it's own OS in it's own right.
    • Slow - see resource intensive.
    • Does not feel or behave native - even if you had a lot of CSS to change the style of it, there will be things like DOM rendering that will give the game away pretty soon.

    Maybe there are more cons, but as a developer it's plainly easy to see why desktop GUIs have died... Unless pigs start flying and Microsoft, Apple, and the Linux community work together to build a cross platform framework where all the dev has to do is specify a layout of some kind and it would produce the same but native component on each platform whilst allowing app code to run on the platform natively without a VM of some kind and with tooling that allows iterative development and a relatively small toolchain that allows building and rebuilding super quickly.

    But I doubt that will happen any time soon.

    5 votes
    1. [2]
      tindall
      Link Parent
      You are describing libui

      Unless pigs start flying and Microsoft, Apple, and the Linux community work together to build a cross platform framework where all the dev has to do is specify a layout of some kind and it would produce the same but native component on each platform whilst allowing app code to run on the platform natively without a VM of some kind

      You are describing libui

      8 votes
      1. feigneddork
        Link Parent
        Even though its still in alpha, that is incredibly promising and I hope it takes off and gains traction.

        Even though its still in alpha, that is incredibly promising and I hope it takes off and gains traction.

        3 votes
    2. Akir
      Link Parent
      I disagree with many of your points. Regarding UI, There are many cross-platform UI toolkits, and most of them automatically attempt to match the look-and-feel of the platform they run on, which...

      I disagree with many of your points.

      Regarding UI, There are many cross-platform UI toolkits, and most of them automatically attempt to match the look-and-feel of the platform they run on, which is something that webapps don't usually even bother with. I wouldn't say that the tooling is better for the web than it is for desktop apps, either, since there are plenty of great WYSIWYG UI editors for desktop apps wheras most UIs are written directly in code, either in the form of HTML or using a framework. A while back I did a little bit of work with Swing (even though it was already depreciated at the time), and it honestly reminded me of building an HTML interface, except with the Java mindset. JFX, which was supposed to replace Swing, is extremely similar to how you build an interface with HTML - heck, it even uses an offshoot of XML to define scenes

      Licensing is much less of a problem than it was in the past. Qt is far from the only way to build cross-platform GUI applications. But if you really wanted to, you could easily use Qt in your closed-source commercial software by making the GUI separate from the business logic, which would mean that only your GUI would have to be licensed under the terms of the GPL. Once again, Qt is not your only choice. Try out GTK, wxWidgets, Swing, JFX, or any other number of open-source toolkits. Heck, even .NET is cross-platform thanks to Mono.

      I don't see what the problem is with the rate of innovation for desktop apps. Not being able to keep up with modern developments seems like a liability than anything positive. Stability is extremely important, and maintaining an application is much easier if you don't have the frameworks you rely on changing constantly.

      But things kind of change depending on what you mean by cross-platform. If you are talking about different computers with different operating systems, native desktop apps are fine. If you are talking about adapting to TVs and phones, that's a whole different can of worms; these devices are used differently and have different UI design goals. In any case, most of these devices will also have ways to build native apps, so simply being able to target them isn't really much of a point given how broad the scope of our current conversation is.

      There is just one last thing I want to point out: web applications aren't becoming big because every programmer is choosing to build them suddenly. Web applications are becoming big because companies are trying to turn away from software you purchase a license for to software you subscribe to.

      Honestly, I think there are too many minute points to be made on either side for this conversation to be meaningful.

      3 votes