When comparing Vala vs Rust, the Slant community recommends Rust for most people. In the question“What are the best systems programming languages?” Rust is ranked 2nd while Vala is ranked 17th. The most important reason people chose Rust is:
Since Rust is statically typed, you can catch multiple errors during compile time. This is extremely helpful with debugging, especially compared with dynamically typed languages that may fail silently during runtime.
Specs
Ranked in these QuestionsQuestion Ranking
Pros
Pro Rich GTK Support
Vala developed by Gnome Foundation.
Pro Fast
Underneath there is C. It makes some stuff easier to write than it would be with plain C code.
Pro Easy Syntax
Vala is syntactically similar to C# and includes several features such as: anonymous functions, signals, properties, generics, assisted memory management, exception handling, type inference, and foreach statements
Pro C compatible API (and ABI)
C programs can use libraries written in Vala, and vice versa.
Pro Good documentation
There is Valadoc and most of the libraries have Devhelp packages.
Pro Well-integrated with C language
Vala itself is compiled to C, therefore it can use the vast ecosystem of C language, with least effort.
Pro Stable ABI
You can write a library with ABI stability.
Pro A general purpose language
Vala is compiled to C and only requires GLib - or even nothing (posix profile)
Pro Catch errors at compile-time
Since Rust is statically typed, you can catch multiple errors during compile time. This is extremely helpful with debugging, especially compared with dynamically typed languages that may fail silently during runtime.
Pro Compiles to machine code allowing for extra efficiency
Rust uses LLVM as a backend, among other things this allows Rust code to compile down to machine languages. This allows developers to write programs that run as efficiently as possible.
Pro Threads without data races
Unique ownership system guarantees a mutable data to be owned and mutated by only one thread at a time, so there's no data race, and this guarantee is checked at compile time statically. Which means easy multi-threading.
Of course, immutable data can be shared among multiple threads freely.
Pro Generics support
You don't have to write same array and dictionary classes hundreds and thousands times for strong type check by compiler.
Pro Built-in concurrency
Rust has built-in support for concurrency.
Pro Supports cross compilation for different architectures
Since Rust 1.8 you can install additional versions of the standard library for different targets using rustup/multirust
.
For example:
$ rustup target add x86_64-unknown-linux-musl
Which then allows for:
$ cargo build --target x86_64-unknown-linux-musl
Pro Makes developers write optimal code
Rust is a modern programming language written around systems. It was designed from the ground up this way. It's language design makes developers write optimal code almost all the time, meaning you don't have to fully know and understand the compiler's source code in order to optimize your program.
Furthermore, Rust does not copy from memory unnecessarily, to give an example: all types move by default and not copy. Even references to types do not copy by default. In other words, setting a reference to another reference destroys the original one unless it's stated otherwise.
Pro Support for macros
When you identify a part of your code which gets repeated often, which you cannot abstract using functions or classes, you can use Rust's built-in Macros.
Pro Official package manager and build tool
Cargo is the official package manager for Rust. It comes with the language and downloads dependencies, compiles packages, and makes and uploads distributable packages
Pro Easy to write understandable code
While not as verbose as Java, it still is much more verbose than languages like Go and Python. This means that the code is very explicit and easy to understand.
Pro Big community
The biggest community contributing to language.
Pro Functional programming
Very easy to create functional with some additional from structure application.
Pro Excellent syntax
Pro Safety
Pro No GC
Pro Low memory usage
Pro Static compiled & statically linked single file output
Pro Extremely fast code execution
Pro Zero-cost futures or Async IO
Cons
Con Very few resources allocated to the language
Only a single person is working on Vala full time. Gnome Foundation isn't allocating sufficient resources to properly maintain Vala.
Con A very naïve approach to the real problem
Vala just adds more complexity to the game. No real benefits in using a 'programming language emulator' for UI code, you may think it adds to productivity but it's just a way to make the problem last longer, reinventing the wheel everytime and worse.
Con Very limited adoption
Vala isn't used in areas other than GTK development, and no major business has adopted the language.
Con Not a general purpose language
Can't use Vala in multiple software development areas.
Con Very limited tooling
Though using Gnome Builder, you can debug it easily.
Con Heavy reliance on GObject
Heavy reliance on GObject types, although Vala can be used without GObject. (posix profile)
Con Not well documented
It already has tons of documentation, even a book about Vala.https://leanpub.com/vala https://wiki.gnome.org/Projects/Vala/Documentation
Con No stable version
No stable version of Vala released for over a decade so far. Means that Vala isn't production ready.
Con Long compile times
Way longer to compile than other languages.
Con Low productivity
The compiler is strict, such as ownership and borrowing checkers.
Con Low readability
Harder to read and understand language.
Con Very ugly and verbose syntax
Compared to many languages. One tool needed to be productive is the language to be pleasing and effective, yet Rust friction is as high as its safety.
Con Steep learning curve
Pretty strict and hard to adapt for beginners.
Con Not as useful or productive as advertised.
If really out here wanting to use something besides C/C++, in 98% of use cases, would do just as well or be better off using something other than Rust. Will complete the project faster, would be easier, will be happier, and nearly as safe (use newer language with optional GC).
Con Rust not as safe as it pretends to be
Rust problems:
1) Massive undisclosed usage of unsafe.
2) Massive amounts of memory safety CVEs - see details.
3) Large bloated Rust binaries increase attack surface for exploits.
4) Many corporate types claiming Rust is safe, don't actually program or use it (have some quiet financial interest to push it).
Con Significant time required to understand the language fully
There's the infamous borrow checker for example.
Con Low-level programming language
This means that it encourages the programmer to be very careful in terms of how memory is allocated, etc.
Most applications can run without exceeding the capacity of the server, even with an inefficient dynamic scripting language.