This post is mostly a rant to get out my frustrations in relation to my quest to write Linux desktop applications using GTK. I’ve tried two and a half languages so far and have had challenges with each. Those languages have been / are rust, vala, and D which is the one I’m currently trying out. There will be four sections of this post. Three sections (one for each language) each containing a short writeup of my experience with the language followed by a “like” and “dislike” section. The last section is for my concluding thoughts.
My relationship with rust is easily compared to that one guy, you know, the one who breaks up with his girlfriend every so often, but they always get back together for some romantic reason or another and hope that this time will be different.
Every time I come back I have an “Aha!” moment where I think I understand the borrow checker or how to solve a particular problem which I couldn’t solve before, only to find there is another thing I can’t do. The answer is usually something like “You shouldn’t be trying to do it that way in rust” (the object oriented way). But what would be really helpful is having a document explaining the design patterns I should be using in rust. I haven’t had much formal training in design patterns and most of the stuff out there is for object oriented programming languages.
Vala is an interesting one. This is my first time trying it and I was able to get way further on my project with less looking up how to do things and less frustration. At first. The interesting thing about vala is that it doesn’t compile down directly to machine code. What it does is it compiles down to ‘C’ which then compiles down to machine code. Sorta like how TypeScript compiles down to JavaScript.
This is also where I started learning how to use the meson build system which I found to be really cool and interesting, and also fast. It builds really fast. It is pretty easy to understand and there is a lot of good documentation and support out there.
The vala syntax is great! They borrow a lot from C#, which despite Microsoft’s best intentions (I’m sure) is a decent language with a lot of good design choices and a large community which can aid you.
Vala doesn’t have a large community though. Well, except for Elementary OS it seems. But even then that’s only because Elementary OS is built on GTK. Vala isn’t useable without GTK.
The main reasons I decided to look elsewhere are mainly:
I think most of these issues are related to how vala compiles into C GObjects.
There were a few things that lead me to try this.
Since I don’t have much experience let me jump into the likes / dislikes.
You may be wondering “Why GTK? why not QT? or some other GUI toolkit?”. The answer is really quite simple. I like the GNOME desktop environment and I use it. GNOME is built with / on GTK and so it makes sense to write my app to fit in with it. In addition I like the look of phosh and I want my app to look good on that particular mobile interface.