Hacker News new | past | comments | ask | show | jobs | submit login

What problem/niche is this language a solution/fit for? I've been clicking around for 30 minutes now and have yet to find a defining feature that makes it (significantly) more productive and/or robust than Java or C#.



> What problem/niche is this language a solution/fit for?

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.


Thanks for formulating that context so well - you should ask the Vala people to start their Web page with your 4 sentences, as most who visit the page will ask themselves.

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/


Ah! That's the bit of context I was lacking. Thanks


Probably some caveats not shown by using GObject over C++ libs for qt


About 10 years ago my team was using Vala for a production embedded system because it would transpile to C and cross compile to target the ARM platform. It was a lot easier to write a couple hundred lines of Vala than implement a bunch of high level language features in C. The Vala became a few thousand lines of hard to grok C as I recall.


I guess it solves for tiny community centered around a clean language, which it has, as well as Linux Distributions and Desktop Environments mostly written in Vala, like ElementaryOS and Pantheon. Related HN post: https://news.ycombinator.com/item?id=32787251


I always assumed that vala was a main reason why elementaryos was so slick. As in freeing people from accidental complexity to spend their neurons on new ideas and optimizations.


Vala compiles to native code, no VM or runtime required other than GTK+.


Java and C# also support AOT now, and the linker should only link code that is actually used.


There is a big difference between what Java calls AOT and this. Statically linked hello world in Vala which uses some basic standard library functions is less than a megabyte (most of it taken up by glibc as I couldn't get it to compile with musl). If you assume dynamic linking for core libraries then it is just 15KB.

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.


"Now" being the operative word. Vala's quite old; when it came out C# barely existed on Linux. I think these days C# is almost definitely the better choice for whatever you might have used Vala for in the past.


C# on Linux still has some warts, the runtime is massive and most distro-packaged software pulls that in its entirety. (And for extra fun, sometimes multiple versions.) All that overhead sits between your code and GTK, and something like Vala completely sidesteps that hassle.

That said, it only really shines for the "gtk based linux desktop" usecase, for everything else the situation flips around, as you now need to bring your own GTK. Occasionally still worth it embedded, but not much else.


There were a couple of Linux/Un_x desktop applications written in C# back in the day - Tomboy, F-Spot, Banshee, Beagle come to mind. They were pretty good at what they did.

But the GNU/Linux camp was rather hesitant to adopt .Net for fear of Microsoft suing people over patent issues. At least that is my memory of it. People wrote replacements for those apps Tomboy -> gNote, F-Spot -> Shotwell, Banshee -> ???, using Vala.

Now that Microsoft has made .Net open source, the lawsuit threat seems to be gone (at least for the foreseeable future), but I think the ship has sailed.


A bit of a shame really. Gnome development could be nicer with a language with some basic memory safety features and GC, but still generates fast code. Like C#.


> Banshee -> ???

Pretty much everyone reverted back to Rhythmbox, which to this day still feels less polished somehow.


I switched to Amarok, then Clementine (Amarok 1.x fork), lately Strawberry (Clementine fork). It's really nice (IMHO).


There's still/again some C# apps for Linux desktops, like Pinta, but the dotnet sdk experience with it so far has been a lot rockier than with mono back in the days. Performance is great, ergonomics for end users not so much.


EDIT: gNote is written in C++, not Vala. My bad.


There are quite a few issues that make any JVM language difficult to use in scenarios like this one, in particular, lack of high quality and low overhead interop and certain low level features like C structs.

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.


Being to gnome what swift is to macOS


Are there any good gtk bindings for C# or Java?



I've had good experiences with GTKSharp.


It's only available with Mono?


GTK+




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: