8 ms·
The Vala Programming Language
- qalmakka 3y agoVala is a lovely yet criminally underused language. It does a lot of things right IMHO, and it massively simplifies writing GLib/GObject and GTK applications. It's nice to see more awareness around it, honestly.
- freedomben 3y agoI agree. I have wondered for many years why this is so. I think because Vala was developed so specifically for use with gnome, that its maturation was mainly limited to problems in that domain. I don't think it offered anything that wasn't already mostly available between Java and C#, so it never took off for web. It also wouldn't have fit well as a GUI building language for other native platforms, so it didn't take off there. It's not a good scripting language, so it didn't take off there. In the end, I think it lost due to the network effect.
- qalmakka 3y ago> I don't think it offered anything that wasn't already mostly available between Java and C# 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.
- rco8786 3y agoA "Vala vs Java" and/or "Vala vs C#" would be helpful
- lnxg33k1 3y agohttps://wiki.gnome.org/Projects/Vala/ValaForCSharpProgrammers https://wiki.gnome.org/Projects/Vala/ValaForCSharpProgrammer... https://wiki.gnome.org/Projects/Vala/ValaForJavaProgrammers 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
- rco8786 3y agoYea I guess I should have been more specific - I was looking for this directly on the main landing site. 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.
- sandyarmstrong 3y agoHistorically, it was designed to resemble C#, yet transpile to GNOME-like GObject-based C code, to provide an alternative way for GNOME developers to get higher level language syntax without having to depend on Mono/C# (which was very controversial at the time). 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.
- nlawalker 3y ago> it was designed to resemble C# 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. [1] https://github.com/highlightjs/highlight.js/pull/3906 https://github.com/highlightjs/highlight.js/pull/3906
- lnxg33k1 3y agoI think I got in a rabbit-hole with it around 2010 for the same reason of liking C# but not liking who backs C#, but I already had enough not marketable languages
- freedomben 3y ago> but I already had enough not marketable languages 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.
- throwaway894345 3y agoWhen I tried it many years ago it was a really leaky abstraction over GObject and C. If you didn't understand exactly how it worked under the hood, stuff would segfault on you pretty regularly. But I suppose that's par for the course in the GObject universe.
- deleted 3y ago[deleted]
- skywal_l 3y agoNot to be confused with Vale[0]. [0] https://vale.dev/ https://vale.dev/
- khaledh 3y agoOr Val[0], now called Hylo (for a good reason), or V[1]. [0] https://www.hylo-lang.org https://www.hylo-lang.org [1] https://vlang.io https://vlang.io
- Verdex 3y agoYeah. I clicked the link thinking, isn't it called hylo now? And then became momentarily confused. 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.
- hoseja 3y agoThe actually interesting one, with the generational references.
- cpersona 3y ago"Why choose Vala" would be helpful.
- lnxg33k1 3y agohttps://imgur.com/a/8aEmtDy https://imgur.com/a/8aEmtDy ?
- deleted 3y ago[deleted]
- beanjuiceII 3y agovala been around quite a long time too, would be nice if their app showcase showed some more mature apps
- lnxg33k1 3y agoYeah it would be nice if there was a list with screenshots of applications written in Vala, on the vala homepage, with links to the applications websites :look:
- beanjuiceII 3y agoI am aware of the list, but all these apps are very basic. I was looking for something a but more involved
- hydral 3y agohttps://vala.dev/ https://vala.dev/ an apps list is here else you have : Pamac-manager is on vala Gnome-Boxes gnome-calculator
- donadigo 3y agoThere's also a lot of apps written in Vala for elementary OS's AppCenter with screenshots & links to GitHub: https://appcenter.elementary.io/ https://appcenter.elementary.io/ (not all, but most). I published two apps there and using Vala has been a great experience for creating Gtk/Linux desktop apps.
- remon 3y agoWhat 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#.
- jakjak123 3y agoAre there any good gtk bindings for C# or Java?
- aidenn0 3y agoI've had good experiences with GTKSharp.
- novagameco 3y agoIt's only available with Mono?
- neonsunset 3y agohttps://github.com/gircore/gir.core https://github.com/gircore/gir.core
- saagarjha 3y agoGTK+
- sampo 3y ago> 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/Vala_(programming_language) https://en.wikipedia.org/wiki/GObject 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.
- 3y ago
- maxloh 3y agoHeard the language a few years ago, but haven't seen any apps built with it yet. How popular is it within the GNOME community? What are its advantages over more popular garbage-collected programming languages like GoLang?
- rogerbinns 3y ago> but haven't seen any apps built with it yet. 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. https://github.com/GNOME/gitg/tree/master/gitg https://github.com/GNOME/gitg/tree/master/gitg
- all2 3y ago> because it allows easy staging of individual lines I have been looking for this functionality for literally years at this point. Thank you! I will be trying this.
- calvinmorrison 3y agogit add -p
- rogerbinns 3y agoNot a gui, and rather painstaking. With gitg you single click on lines in changes (green added, red removed) which selects them. You can separately click on as many disjoint ones across as many hunks as you want. There is a 'Discard Selection' button which removes the highlighted lines from the code, and a 'Stage Selection' to add those lines to the index. While git add -p is in theory doing something similar, it is a lot more painful to use, and you are still working a hunk at a time instead of just scrolling through changes. I often use this functionality when I've made a number of changes during development and everything is now coherent, especially on a multi-language project. It is then easy to go in and discard lines that were added to debug, and stage lines across multiple commits so they are logically grouped.
- deleted 3y ago[deleted]
- amaccuish 3y agoIIRC most "native" apps in elementaryOS are written in Vala.
- ainar-g 3y agoWhy the quotation marks? If I recall correctly, Vala compiles (by way of C) into native code.
- iso8859-1 3y agoGNOME uses a lot of JavaScript nowadays, so large parts of an application can be interpreted. Here are the GJS docs, it gives you an idea of how much JavaScript there is: https://gjs-docs.gnome.org/ https://gjs-docs.gnome.org/
- treyd 3y agoHaven't they gradually been moving away from gjs though?
- nozzlegear 3y agoDoes Elementary use Gnome? I thought it was something else. It's been years since I've been on Elementary, but it didn't feel like it was just a Gnome skin iirc.
- amaccuish 3y agoSorry, meant native as in made by the elementaryOS team (it's an Ubuntu-based distro).
- flafla2 3y agoSuperficially this language appears to be very similar to Swift. Beyond the syntax, it also has first class refcounting, C language binding, and no external runtime (compiles straight to binary). 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
- gwbas1c 3y ago> Superficially this language appears to be very similar to Swift It's almost a clone of C#; it's tightly coupled with the GObject system instead of .Net.
- flafla2 3y agoOh got it. So like c# but compiles to native a la Swift?
- bru 3y agoThere's more languages than Swift...
- zamalek 3y agoDidn't you watch the latest WWDC? Apple invented programming languages.
- neonsunset 3y agoWhat does .NET JIT emit? What does NativeAOT compile .NET applications to? :)
- flafla2 3y agoOh neat I’ve never heard of NativeAOT. I’ve only used Unity’s AOT compiler “Burst” for C# (I assume that is something different?). Cool stuff. edit: Actually I meant to say Unity’s IL2CPP, which transpiles IR to C++. Burst is a different tool with similar goals—it compiles IR straight down to native via LLVM.
- rpncreator 3y agoLast time I heard about Vala was the Yorba Foundation's (RIP) work with Geary and Shotwell, many many years ago.
- sn41 3y agoI was very fond of Geary, and looked into Vala because of it. Found it to be an elegant language, and good to get practical programs working in GNOME. I haven't looked at it in the past 7 years. Is Vala still actively adopted?
- ndiddy 3y agoHas Vala seen much activity recently? The last time I remember hearing about it was reading a blog post from one of the main GNOME developers (https://www.bassi.io/articles/2017/02/13/on-vala/ https://www.bassi.io/articles/2017/02/13/on-vala/) saying that Vala was basically being maintained by a single developer and he didn't recommend using it for new development.
- pipeline_peak 3y agoTo be fair, how many developers are even writing GTK applications anymore? How many GUI apps are even using these native GUI frameworks? 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.
- rob74 3y agoYeah... why fiddle with GTK_Window_Context_Handler_Ptr if you can fiddle with the intricacies of CSS layouts instead?
- pipeline_peak 3y agoWell, if you want to make things look pretty, which product owners and users expect, you’ll have to fiddle with cosmetic intricacies regardless.
- xyst 3y agoI have tried many boutique programming languages. I think I’ll pass on this one, especially higher level (object oriented) programming languages. I usually end up going back to Java/Scala/C#/python/rust/go.
- account-5 3y agoI'm sure I read somewhere gnome was moving to flutter, I definitely might be wrong. EDIT: might be getting confused with ubuntu
- popey 3y agoNo, the Ubuntu community is pushing Flutter, not upstream GNOME. Like the desktop app store, the Ubuntu installer is now written in Flutter.
- pharrington 3y agoFor everyone (including myself) asking "why?", the Gnome wiki has the programmer friendly answer https://wiki.gnome.org/Projects/Vala/ https://wiki.gnome.org/Projects/Vala/ "Vala - Compiler Using the GObject Type System"
- ip_addr 3y agoUsing Rust for GNOME development seems to be becoming more popular. https://gtk-rs.org/ https://gtk-rs.org/
- deleted 3y ago[deleted]
- jll29 3y agoRust, as wonderful as it is, may be less suitable for GUI programming since it has no classes/inheritance (which is why Andreas Kling is creating the Jakt language for his SerenityOS project, after coming to the same conclusion after exploring whether to replace C++ by Rust).
- skeuomorphism 3y agoI did a project presentation at university back in 2014/2015 on vala. I remember liking it, but i wasnt yet competent enough to make a verdict. Cool to hear it's still kicking!
- l72 3y agoI recently wrote an app with vala. It was a pleasant experience. 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.
- zem 3y agoI used vala back when I had a Nokia n900 - it really was the perfect thing to write small apps for my own use, and there was a nice cross-compilation toolchain. in all the years of owning an android I have never done that.
- buzzert 3y agoMy favorite thing about Vala personally is the wide range of native libraries you have access to because of its compatibility with GObjects. There's a great documentation website that has everything located in one place also, which makes development a breeze: https://valadoc.org/ https://valadoc.org/
- pizlonator 3y agoIs it only pleasant when the library already exposes itself via gobject, or also pleasant if the library is just a C API?
- buzzert 3y agoThat's true, but as it turns out there's a lot of examples out there!
- EasyMark 3y agoFor some app examples: https://github.com/vala-lang/awesome-vala https://github.com/vala-lang/awesome-vala
- jcmontx 3y agoLooks like java
- fuzztester 3y agoI saw another one called Vale just today. There are a few HN threads about it.
- fuzztester 3y agoSome HN monkeyboy jerking off and messing his chaddi again, in a knee-jerk reaction to a comment he can barely parse logically. 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.
- pacifika 3y agoEvery now and then there’s the “what to use for developing cross platform desktop gui apps”. Well here it is.
- DaSHacka 3y agoNot qt? In my experience most native linux applications opt for qt over GTK, let alone cross-platform ones. Any reason in particular to use vala over qt?
- vaylian 3y agoVala has a sibling language called Genie[1]. Both languages are basically the same, but Vala uses a C#-like syntax while Genie uses significant whitespace like Python. They are both compiled by the same compiler (valac). [1] https://wiki.gnome.org/Projects/Genie https://wiki.gnome.org/Projects/Genie
- nu11ptr 3y agoYep, unfortunately it is a dead language and I believe has been for a while now. Genie = 24 repos: https://github.com/search?q=language%3AGenie%20&type=repositories https://github.com/search?q=language%3AGenie%20&type=reposit... Vala = 3.1K repos: https://github.com/search?q=language%3AVala+&type=repositories https://github.com/search?q=language%3AVala+&type=repositori...
- megapoliss 3y agoGenie is deprecated https://gitlab.gnome.org/GNOME/vala/-/issues/1473 https://gitlab.gnome.org/GNOME/vala/-/issues/1473
- novagameco 3y agoI want a flexible native UI framework without it requiring me to use a custom programming language
- wiseowise 3y agoVery sleek website, like it.
- colinkiama 3y agoThanks!
- dang 3y agoRelated: Vala Programming Language - https://news.ycombinator.com/item?id=32113825 https://news.ycombinator.com/item?id=32113825 - July 2022 (93 comments) Vala Programming Language - https://news.ycombinator.com/item?id=28905761 https://news.ycombinator.com/item?id=28905761 - Oct 2021 (1 comment) Vala Programming Langauge - https://news.ycombinator.com/item?id=26019680 https://news.ycombinator.com/item?id=26019680 - Feb 2021 (1 comment)
- Koshkin 3y agoThe Vala Programming Language - https://news.ycombinator.com/item?id=39528496 https://news.ycombinator.com/item?id=39528496 - Feb 2024 (no comments :)
- zetalemur 3y agoInteresting default rendering choice for `()` in their demo pretty printer. It renders a space before each opening parenthesis.
- swayvil 3y agoI'm always looking for a simple minimal oop language. Thanks.
- lucraft 3y agoAhh takes me back! 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. https://github.com/danlucraft/valar https://github.com/danlucraft/valar