[Vala] State of the Vala union (was: Starting with Vala)
- From: "Matthias Berndt" <Matthias_Berndt gmx de>
- To: "Sascha Manns" <Sascha Manns mailbox org>
- Cc: vala-list <vala-list gnome org>
- Subject: [Vala] State of the Vala union (was: Starting with Vala)
- Date: Wed, 5 Apr 2017 00:42:46 +0200
TL;DR
– The design of the language is outdated
– The implementation is buggy and not production ready
– There's generally little momentum (tools, mindshare etc.)
– It won't be fixed because there are almost no maintainers
and none will join at this point
Frankly I would recommend you to use some other language. Vala suffers from a
number of problems:
– the compiler is basically not production ready. I dug into the source code
just a bit and found trivial ways to break type checking. I fixed some of them
(e. g. Bugzilla bug 641418, 615830 and several more), but I soon realized those
were just the tip of the iceberg.
– C code generation is also broken, reports about invalid C code being generated
appear all the time, not to mention the C compiler warnings…
– Some type system bugs are essentially unfixable, e. g. covariant generics. That
means that for some generic type Gen, Gen<T> is a subtype of Gen<U> whenever
T is a subtype of U. This is broken by design, it allows type-unsafe code to
pass and disallows code that is perfectly safe.
There are solutions to this problem (see e. g. Scala's variance annotations),
but it's basically impossible to retrofit them as they tend to affect the way
applications and libraries must be written and thus break huge amounts of
user code.
– Obvious features are missing, like type bounds for generics (the possibility
to specify that a type parameter must be a subtype or supertype of some other
type)
– the compiler maintainers are not very active. Luca Bruno left entirely and Jürg
Billeter is quite hard to get a hold of. The problem isn't even that they're
not maintaining/improving the compiler but that they also don't appear to be
very keen to find new, more active maintainers. Yet every patch needs to go
through them. As an example, see this bug:
https://bugzilla.gnome.org/show_bug.cgi?id=772209
(incidentally this is also a C code generation bug)
I'd like to fix it, but if nobody wants to merge or even review the patch, it's
impossible to get anything fixed. I would have expected to be offered commit
access after fixing ~half a dozen bugs, but that didn't happen.
– compiling to C is a bad idea. Among other things, it means that when you want
to use a debugger, you have to step through the generated C code rather than
the Vala code you actually wrote. The fix? Write a real (e. g. LLVM-based) code
generator, it's just a small matter of programming ;-)
– autotools. In 2017.
– Generally poor tooling. I couldn't even find a decent editor that supports
basic features like jump to definition, find symbol usages, code completion
etc.. And I've tried quite a few like Anjuta, Gnome Builder and more. None
worked properly
– No momentum. Emmanuele Bassi's blog post should be well-known at this point,
but just in case:
https://www.bassi.io/articles/2017/02/13/on-vala/
– Worst of all, while hacking on the compiler, I realised that programming in Vala
is simply not a lot of fun as it is fundamentally an outdated design. I use
Scala in my day job which certainly shapes my expectations, but boy, is
programming Vala a pain. The collections are useless as they lack basic methods
like map, filter, flatMap etc. (or Select, Where and SelectMany as C# likes to
call them). Immutable model classes are super inconvenient because there's just
so much boilerplate required for them. Compare
Scala:
case class Foo(bar: Bar, baz: Baz)
to Vala:
class Foo {
public Bar bar { get; }
public Baz baz { get; }
public Foo(Bar bar, Baz baz) {
this.bar = bar;
this.baz = baz;
}
}
And this isn't even complete as Scala also gives you a method to create modified
copies of an object – a feature one would probably emulate with the builder
pattern in Vala, resulting in tons of more boilerplate. And again, this
is just the tip of the iceberg…
Note that I'm not trying to bash the Vala designers here, after all junk like
Java and C# is what is being taught in Universities, so I can't blame them for
coming up with such a design.
So yeah, I agree with Emmanuele: it's time to let it go, and it's certainly not
the language to start your next project with. That's my take on it, anyway.
All the best,
Matthias
Gesendet: Montag, 03. April 2017 um 17:01 Uhr
Von: "Sascha Manns" <Sascha Manns mailbox org>
An: vala-list <vala-list gnome org>
Betreff: [Vala] Starting with Vala
Hello list,
i would like to learn Vala and plan to port a Mono-GNOME-App to Vala. I
already seen the documentation.
Maybe you know some small Vala apps where i can see the code in action?
Greetings
Sascha
--
Sascha Manns
Maifeldstraße 10
56727 Mayen
P: +49-2651-4014045
W: http://saigkill.tuxfamily.org
_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]