“Vala is, in some sense, a new programming language. It’s syntax and structure leans heavily towards C#. As Jurg Billeter, the mastermind behind Vala, likes to put it; Vala is an amalgam of different C inspired languages, mostly C++ and C#. An though there is no mercury in this mixture, you’ll find many a gold nugget in Vala.”
It has a slight Ruby-ish feel as well, with the OO
parts of it. Anyway, looks like it would be fun to use, and by the look of it, Vala code could be easier to
maintain than C code. That’s always very useful…
Yes, it’s interesting. I think it was designed specifically to allow application development in GNOME using a “modern” syntax that generates native code. GNOME has always had this problem that using C to build applications on it is difficult, so they’ve always been looking for alternatives like C# (mono) and Python. But these higher level languages result in applications that use too much memory, take long to start up and are generally slow when compared to those written in C. So is Vala the answer to this problem? I hope it is and that it saves GNOME from having to rely on Mono and Python while making it easier for programmers to develop on it. Probably a Vala written application will never be as optimized as one written directly in C, but it still sounds like a good compromise to me.
Most virtual machines that do JIT have a very acceptable performance. Sure, there can be some overhead, but in my own experience well-written computation-intensive Java programs on modern JVMs can be nearly as fast as C++ code, or at the very least be performant enough to justify a bit of performance for comfort (I don’t know about C#/.NET, I have never used it outside some tinkering with Mono).
It is true that there is VM memory overhead, but it’s not that bad when multiple applications can use the same runtime, e.g. like .NET application domains.
VM languages provide good speed, safety, and arguably more productivity. It’s a bit premature to dismiss them with arguments that primarily apply to past revisions (e.g. pre-JIT JDKs).
They could always embrace ObjC/ObjC++, work with the GNUstep folks and really piss off the KDE crowd.
I know this question might sound a bit silly since their target is GNOME developers but is there a Win32 port of Vala that we can write some cross platform libs and programs?
P.S. I didn’t know Vala can code
Edited 2008-07-05 11:05 UTC
First hit in Google turns up:
http://www.mail-archive.com/[email protected]/msg00242.html
I am the only one to think “yet another language that almost provides the same features”? I understand the practical needs, Vala is ABI-compatible with C, and the GNOME project needs something higher-level than C that provides comparable performance. Additionally, a large contingent of people seems to dislike C++. So, Vala will probably succeed within the scope of the GNOME project.
Still, why not standardize on a widely-used language with higher-level constructs such as C++. All bickering about C++ aside, it works fine for the KDE project. Sure, Qt, allows developers to write a particular flavor of C++, but it’s a language that is taught in academic institutions, has industry support, etc.
This is not a criticism on GNOME per se. Microsoft is also cluttering the landscape with variations like C++/CLI and a couple of other languages, and Apple is pretty much an island on its own with Objective-C (it’s not particularly popular on other platforms outside the GNUstep project), and its attempts to kill Carbon.
I think this is unproductive in various ways:
– Some twists and turns are needed to bind it all together (what if that one terribly good library you need is written in C#, and you need it in your C program).
– Every relatively unpopular language community seems to aim to build its own Rails, etc. There is a lot of duplicated effort going on.
– Arguably, it degrades the quality of programs, because people will have to switch languages for jobs often. Every language has a subtly (or not so subtle) different paradigm, which takes time and practice to master. E.g. programming C++ in a Java-ish way is not going to get you far, but it happens a lot.
– Frankly, it sucks having to write something in today’s fad. Often performance is sucky, IDE support is bad, and debugging tools are subpar.
– It takes time to design a good language. Bumps are usually not gone if a language has given time to mature.
Of course, I can’t deny my curiosity, that’s why I try to learn at least one or two new languages a year. Not necessarily to use them, but there are often nice concepts or ideas to pick up.
Edited 2008-07-05 11:26 UTC
Seeing as ObjC is a superset of C there isn’t worry about ABI compatible with C in the ObjC world. It’s modern syntax options and garbage collection satsify the most anally retentive C++ bigot and Java bigot.
I’ve got nothing against C++ or Java. They are both great languages. There just seems to be a lot of people stinkin’ up the collective communities.
I use KDE every day and I’d love to see GNOME leapfrog it and have native ObjC bindings within it’s community.
It’s clear KDE is doing it’s best to avoid WebKit and those glorious KHTML/KJS developers must still be feeling the cold shoulder as the very mention of WebKit brings out such professional responses.
I disagree, WebKit is being directly used in the most visible KDE project of all, Plasma. Others are working on making it into a KPart for Konqueror to use, and I think there was a summer of code project to allow you to swap the web engine it uses at runtime with a click of a button.
It is true that some of the KHTML developers don’t particularly like it, but they aren’t the whole KDE project. And if they want to keep working on their own code, I don’t think there’s anything wrong with that.
Edited 2008-07-05 23:30 UTC
I’m amazed that nobody has asked the all too important question. Why Vala?
Just browsing through the sample code, it looks similar to C# and Java. In fact, everything I’ve seen done in Vala can be done with a similar line count in C#.
So that begs the question. Why design a new language when there isn’t anything that sufficiently differentiates it from every other programming language in existence? OK, that veering off into the realm of hyperbole. Still, the point remains.
Why?
The NIH syndrom, this time coming from the open-source planet ?
So that begs the question. Why design a new language when there isn’t anything that sufficiently differentiates it from every other programming language in existence? OK, that veering off into the realm of hyperbole. Still, the point remains.
Both Java and C# use a VM. Vala does not. Vala generates C code. Vala also is specifically geared towards the GObject system of GNOME. Vala gives you a fast, low overhead language with OO features that integrates nicely with GNOME. Neither Java nor C# does that.
It’s also worth noting that GNOME is already developed in C and switching to Vala makes a lot more sense than Java or C#.
Edited 2008-07-05 11:33 UTC
Use GCJ and remove the need for the JVM?
The first implementation of C++, C with classes did that. I find it hard to see how such a thing could be beneficial?
GObject is a hack that allows some semblance of object oriented programming in C. In a true object oriented library, it’s no different to any base class type. See Object in Java, CObject in MFC, QObject in Qt, etc. The fact is that the GTK way of doing things is starting to show its age and unless something is done about it, creating a new language is not going to solve anything.
Then again, if C compatibility is so important, theres always C++ or Objective-C.
I beg to differ. Switch to a brand new language that nobody actively uses does not seem like a sensible thing to me.
But to each his own, I guess. Having said all that, I’ll still be keeping an eye on Vala to see how it develops.
Use GCJ and remove the need for the JVM?
Vala works better with the GObject system than Java.
The first implementation of C++, C with classes did that. I find it hard to see how such a thing could be beneficial?
GObject is much better suited to language bindings than C++ and has signals built in, unlike C++.
GObject is a hack that allows some semblance of object oriented programming in C. In a true object oriented library, it’s no different to any base class type. See Object in Java, CObject in MFC, QObject in Qt, etc. The fact is that the GTK way of doing things is starting to show its age and unless something is done about it, creating a new language is not going to solve anything.
GObject works well for what it was inteded to do. The use of Vala does not mean that GObject and other GNOME technologies cannot be advanced either.
Then again, if C compatibility is so important, theres always C++ or Objective-C.
Again the crucial difference here is GObject. Whether you like it or not GNOME is built around it and only Vala makes it easy to take advantage of GObject directly.
I beg to differ. Switch to a brand new language that nobody actively uses does not seem like a sensible thing to me.
Syntax for Vala is very familiar and the politics of Java and C# pretty much preclude their use as an official GNOME language. C++ isn’t very portable and would ruin some of GNOME’s strengths.
Contrary to what you believe I think Vala makes a lot more sense when you take these things into consideration.
The most important thing about Vala (according to me) is the GObject introspection stuff. Hopefully very soon it will be possible to write a library in Vala, autogenerate the introspection data, and seamlessly use the library from Python, Java, C#, whatever. Big plus.
The thing is: there’s already some Free languages without GC similar to Vala: D for example.
I agree that Vala suffers from NIH syndrome..
C development is simply to low level for a lot of GNOME programmers and there is a general agreement that something is needed.
90% of them feel that C++ is stupid and used by that other desktop, and would be a mistake to use. 90% feel like C# is an evil MS patent trap. 90% feel like Java is an ugly slow monstrosity. 90% don’t like any other language either, for various reasons.
So if the developer base can’t agree on any existing language, their only choice was to create an entirely new one. This also gives them some advantages, because they can customize it the way they want to integrate better into the GNOME system. The downfall is that no one is going to be familiar with it, but generally to do GNOME/KDE type development you have to familiarize yourself with libraries anyway. As long as the language is familiar enough to others, that might not be a big leap.
The API seems to still need a bit of work – I mean, stdout.gets does what? – why is it even possible?
That said, it does look “cute” – but I think that gcj would have made more sense – (or whatever mono’s native code producer thingy is called, assuming it exists)
Vala is just another attempt to workaround the limitations of C in GNOME.
I think what most people are missing here is that Vala was created to create an OO language using GNOME’s GObject system. It’s much easier and better integrated to create a language specific to GObject than to rewrite GNOME entirely in C# or Java. Vala seems to be the best way forward and will not be difficult for C, C#, and Java programmers to understand and is completely compatible with C. This isn’t just another case of NIH. Looking at the alternatives Vala is the best answer.
Actually I don’t agree.
I think it’s an excellent idea to invent a new language that’s handier than c/c++, but compiles to a native code. True, D does exactly that, but D has a closed source compiler (and a GCC frontend too, but it’s always a bit behind). So why not create just a frontend that creates code in a language that has lots of well optimizing compilers? It’s clever to concentrate on just the language and let the optimizing compiler work do other people. Trying to manage both doesn’t work too well even for large projects like mono (which is a lot behind in comparison to MS.NETs performance.)
Edited 2008-07-05 20:02 UTC
By what, one or two weeks? (gdc trunk seems to follow Digital Mars D quite closely) There are more important disadvantages to using D at this moment: the 2.0 spec is not finished yet, there are two competing standard libraries, and it has virtually no industry support. Other than that, it’s a promising language .
The last release was on 7/22/2007. I don’t know if the trunk is closer to the D 2.0 development, but to me it seems as if GDC has not a lot (or enough) momentum (there are also just 2 developers on sourceforge).
…at least it’s not named after a monkey, ape, or venereal disease.
I really like the fact that vala can do nice high level gobject stuff for gnome integration, but loops, math etc are in C so no slowdown. Whatever people say about JIT, VM etc. Apps written in C or C++ (some other compiled language), are always more snappy.
So its still useful for writing algorithms, etc without the verbosity of C.
My main worry is how easy is it to debug with gdb?
As for the NIH syndrome, Maybe there is a bit of that going on, at worst this project fades away and nobody uses much. But there is value in trying these things out, Who knows? Maybe gnome can find many ways to make vala grate for writing gnome apps that would not work as well in other languages.
Edited 2008-07-08 00:16 UTC