Re: [Vala] Vala++



On 04/04/17 15:38, Al Thomas wrote:

From: Alessandro Pellizzari <alex amiran it>> Sent: Tuesday, 4 April 2017, 13:47

Rust is a hard beast to learn. It took me months to have a decent grasp
of it, and I'm still missing many "rustic ways" of doing things, while
in Vala I was productive in weeks.

May be that's why Rust is still labelled a systems programming language.
So it's in the same application space as Erlang.

No. "Systems Programming Language" is the new fancy way to say "it's compiled to machine code and you can write a kernel with it". In the same category there are C, C++, D and a few others.

Erlang needs a VM, so it's not.
Vala needs GLib so it's not, unless, maybe, you link GLib statically. :)

Vala is a lot more
fun and gives people who are not systems and software engineers the
opportunity to express their ideas. Although Vala has and needs all
levels of abilities.

Vala is fun and easy but, as I said, this is not the problem. :)

But, on the other side: no memory leaks, no segmentation faults, no
concurrency mess-ups (unless you try VERY hard).

Vala is pretty good on this, but hopefully you took a little bit of
your time and reported the problem you had with Vala. Just as Rust
users do:
https://github.com/rust-lang/rust/issues/4494

The problem is not in the compiler. It's in the developers.
Take this example:

https://wiki.gnome.org/Projects/Vala/ThreadingSamples?highlight=%28%5CbVala%2FExamples%5Cb%29

(The Dining Philosophers one)

You need to remember to instantiate a Mutex, lock it, change the vars, unlock it. If you don't do it, the program will probably compile and run with unpredictable results.

In Rust you are forced to wrap the variables in a Mutex (or similar), and you are forced to lock it before accessing the variable.
If you don't, the code won't even compile.
If you forget to declare it as mutable, the code won't compile.
And you don't need to unlock it, as the compiler will determine when the scope ends and unlock the mutex by itself:

https://doc.rust-lang.org/1.2.0/book/dining-philosophers.html

Also Vala links to libraries that may cause such problems. I'm not
sure how Rust deals with that.

The programmer writing the wrapper must take care of handling the crashes. :) Basically, an external library call gets wrapped in unsafe{} blocks, and the code inside must handle all the cases.

It's growing much faster (it is not even 2 years old).

Or maybe you mean from the 1.0 release. Looks like that was 15 May 2015:
https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-100-2015-05-15
So yes, five years from first commit to 1.0 release is pretty good.

Yes, I mean 1.0.

The previous versions were completely different. They used a garbage collector and green threads, so they needed a mini-VM in the compiled binary, similarly to what Go does.

1.0 got rid of the GC, threads are now system-level threads and the syntax changed quite a lot in some places. It's a different language... :)

Bye.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]