265 points · by gtirloni · 2y ago · 192 comments
I have been involved with Vala in it’s early day and some hardcore GObject/C users never quite liked the C code that Vala generated although it was perfectly valid and exposed a very clean C header to interface with it.
I think that Vala is a really great tool for building applications that make use of Glib/GObject. For example Gtk applications, but also GStreamer and DBus applications.
If you aren't developing a DAW, a browser, or some other performance critical GUI app, you're moving to Electron and other layout engine solutions. And who should blame you, people don't want to fiddle with GTK_Window_Context_Handler* gtk_wdw_ctx_hdlr_ptr = Init_GTK_Window_Context_Handler(Window_Context* w_ctx); just to make a damn app.
Even if Vala drops in to save us all from noodling with Window Context Rocket Ship Handlers, layout engines are more portable solutions. The decline of WPF and Winforms is proof of this.
wpf is still heavily used in industry so that isnt very convincing to me
That’s why I mention performance critical
> wpf is still heavily used in industry
But is anything new being made with wpf? Because that’s why I left that area.
Look around, it’s a bloated, buggy world. Calendar apps aren’t being carefully engineered by European computer scientists.
>Electron apps tend to be poorly designed
How so, are you saying because they use Electron they’re inherently poorly designed?
It's a constant chase not worth any developers time.
They backtracked a bit on that but they'll still replace GTK4 with GTK5 at some point, probably deprecating context menus or whatever else this time. Clowns.
I haven't used qml a lot but I wonder if gtk has an equivalent to that too. What am I missing about gtk here? Like, where does GTK beat qt?
Secondly would be the license, while they're both LGPL these days, that wasn't always the case, and the current Qt company is highly hostile to open source.
I would like to know the honest answer to that question, actually.
And Java Swing was there from the beginning, still perfectly usable, and is widely used in industrial applications.
But I was unable to find information about how to set up my repo and build process with GTK vendored into the project. All tutorials said that I should just install GTK libraries with my system package manager, but that was not a satisfactory answer for me.
After some hours fiddling around stackoverflow, adding flags to my GCC invocation and being unable to solve the problem, I just gave up.
Flutter Desktop seems like a compelling alternative to GTK these days.
Sad news for ya, flutter just wraps GDK (from GTK) on Linux. It also, last time I checked, was limited to a single application window.
Qt is old, and cool.
Now that Ardour has switched are there still any DAWs using GTK?
From https://ardour.org/whatsnew.html# :
> From a project-level perspective, perhaps the most important change is that we have moved the source code of our GUI toolkit (GTK v2) into the Ardour source tree.
Reason being that the Rust bindings are fairly ergonomic regarding the GTK OO system, plus Rust has a great ecosystem.
Relm4 in special is pretty great
https://relm4.org/book/stable/
edit: here is some earlier blog post from 2016 https://blogs.gnome.org/despinosa/2016/11/01/rust-and-vala/ but I think there were others since then
I wanted my app to work well on desktop Linux and my pinephone running postmarketos and phosh.
Vala fit the bill nicely. I enjoyed it much more than python and the performance is great. I wanted something that was performant and minimized battery usage since I’d be using it on my pine phone.
Genie = 24 repos:
https://github.com/search?q=language%3AGenie%20&type=reposit...
Vala = 3.1K repos:
https://github.com/search?q=language%3AVala+&type=repositori...
Writing software for GNOME.
https://en.wikipedia.org/wiki/Vala_(programming_language)
https://en.wikipedia.org/wiki/GObject
KDE is based on Qt GUI library, and Qt is C++.
GNOME is based on GTK GUI library, and they wrote their own object system (GObject) on top of C. Then they wrote Vala, which updates plain C to be more like C# or Java, so it's easier to work with GObject than by using plain C.
I also liked the itemwise comparison with Java: https://wiki.gnome.org/Projects/Vala/ValaForJavaProgrammers
Defining a new language "just" for the GTK library will likely be responsible for it not taking off that much, even if - as is the case here - the language looks neat. The fact that it compiles to C, which is universally available, and the fact that it is not associated with corporate interests (unlike Microsoft C#/.net and Oracle Java/JVM) could be interesting, but perhaps decoupling things from GTK could have been wiser to get more reach?
I mostly develop software libraries nowadays, and the only GUIs are Webguis to interact with REST services, but for those folks that make the Linux desktop a better place, this seems a good way to be more productive than in C.
Speaking of which, the Linux desktop needs a re-think: someone should start and re-develop all apps in a much more clean and homogeneous way so that it is obvious what is done how. The existing bag of tools from different decades, inclusive apps from xfig, xlock, xv over LibreOffice/KWrite to gedit/kedit are just an inconsistent mess; even MS-DOS apps managed (at some point) to stick to standard text menus, from EDIT to TurboPascal.
https://www.theregister.com/2024/01/24/rise_and_fall_of_cua/
I have no doubt that the Java world has excellent tech behind the AOT support but the footprint is simply not comparable when you can't even construct a java.lang.String without bringing in the entire JapaneseChronology.
There is also now an option to statically link native libraries into NativeAOT binaries in .NET, and to statically link NAOT-compiled .NET libraries into existing C/C++/Rust binaries.
I wonder, does Vala have a stable ABI, or native compatibility with other higher-level languages like C++ or ObjC? These are other difficult challenges which Swift attempts to tackle (and depending on who you ask, with varying levels of success).
In any case this is an interesting language. Thanks for sharing
It's almost a clone of C#; it's tightly coupled with the GObject system instead of .Net.
I checked it ten years ago-ish, I think it transpiles into C (with GObject). Still no runtime though.
There's a great documentation website that has everything located in one place also, which makes development a breeze: https://valadoc.org/
https://wiki.gnome.org/Projects/Vala/
"Vala - Compiler Using the GObject Type System"
Vala Programming Language - https://news.ycombinator.com/item?id=32113825 - July 2022 (93 comments)
Vala Programming Language - https://news.ycombinator.com/item?id=28905761 - Oct 2021 (1 comment)
Vala Programming Langauge - https://news.ycombinator.com/item?id=26019680 - Feb 2021 (1 comment)
In the end, I think it lost due to the network effect.
Well it is massively easier to integrate C and C++ libraries in Vala compared to C# or Java - P/Invoke is bearable, but JNI is a pain to use and very hard to get right.
In 2009 I wrote a lib to auto-generate Ruby bindings for Vala code. It gave a very pleasant API to create native extensions for Ruby, if you were happy using glib.
EDIT: might be getting confused with ubuntu
Like the desktop app store, the Ubuntu installer is now written in Flutter.
[1] https://vlang.io
At this point I feel something is definitely up. How many V* languages are there floating around out there.
Although on the other hand, we have C, C++, C#, and objective C (etc). So maybe this is just something that happened every once and a while through otherwise unsuspicious causes.
How popular is it within the GNOME community?
What are its advantages over more popular garbage-collected programming languages like GoLang?
The gitg git gui is written in vala. I've used it for several years because it allows easy staging of individual lines, as well as reverting them.
I have been looking for this functionality for literally years at this point. Thank you! I will be trying this.
So the biggest difference from C# or Java is that there is no VM. It is mostly syntactic sugar over C and GObject.
At least, this was the case last I paid attention 15 years ago.
Ha! Ain't that the truth :-)
It touches on a big problem for new language development in that there are barriers to entry at getting workable in a new language, but employers don't want to use them unless they can hire for them, and they can't hire for them unless people use them, but people don't use them because they can't get hire'd to use them, rinse and repeat.
I actually first heard of Vala just a few days ago when I was looking at a C#-related PR[1] for highlight.js:
> This fails the tests as the Vala default.txt is recognized now as C#. However, Vala is very close in syntax to C#, and the default.txt also seems to be valid C# so not sure what to do about this.
https://wiki.gnome.org/Projects/Vala/ValaForJavaProgrammers
Imagine going to a link called docs and finding the first 2 links are about what you ask for :D
Maybe I'm alone, but my immediate thought when seeing a new language, with fairly familiar syntax, was "why is this different than Java". And if that's my first thought, it probably makes sense to answer that question immediately rather than talk about vague things like Productivity and Open-Source.
Any reason in particular to use vala over qt?
Downvoting coz doesn't have enuf grey matter to realize dat one can read about Vale outside of HN, and den search hn.algolia.com for vale language and find some hits, and share that info in HN.
an apps list is here
else you have : Pamac-manager is on vala Gnome-Boxes gnome-calculator
:look: