Rust Programming Language Reaches 1.0 Alpha
c0d3g33k writes: Rust, a new a systems programming language with a focus on safety, performance and concurrency, has released the 1.0 alpha version of the language. This means that the language and core libraries are feature-complete for the 1.0 release. In practical terms, this means that the rate of change experienced by early adopters will slow down dramatically and major breaking changes should be very rare (during the alpha cycle some major changes may still occur if considered necessary). The language will stabilize further when the beta stage is reached (planned for six weeks from now).
Rust is a modern systems programming language focusing on safety and speed. It accomplishes these goals by being memory safe without using garbage collection.
ok, sounds like a great goal. How do they do that? If you read their tutorial, you won't find out for a while, they distract you with a discussion of their build system, versioning system, and package manager (that's a warning right there: a package manager should not be integrated into the language. Also, do we really need yet another package manager? And if you're actually looking for stability, avoid a language that is so focused on versioning: it's a sign they're not going to be stable).
The way it ensures memory safety is by assigning 'ownership' of an object. If two pointers point to the same thing, only one of them is allowed to change it. This is an interesting idea, and is probably especially useful when working with threads. Memory management is mainly done with smartpointers, like C++. (I also kind of like how they separate macros from generics).
Overall to me the language looks primarily based on C++, an attempt to smooth out the rough spots of C++, with a bit of Erlang thrown in (pattern matching). You might say that 'D' language was an attempt to improve on C++98, and Rust is an attempt to improve on C++11. It's like D for the new era.
To me, it's not a clear improvement over C++. For example, here is some code to read a line from input. Each of those function calls return a different object, you can't just type io::stdin().read_line(); The constant switching between return values is a bit mind-numbing for me, not only do you have to remember what functions to call, you have to remember what they all return. Kind of painful.
let input = io::stdin().read_line().ok().expect("Failed to read line");
"First they came for the slanderers and i said nothing."
I'm not completely sold on the syntax, but I find the design and runtime interesting. I'd like to find an excuse to build something with it, to see if it can live up to its potential.
I started thinking about how I would design a language recently, then I came across rust, and I saw quite a lot of the same conclusions I came to myself. Abstract classes, multiple inheritance, Interfaces with versioning, combining 3rd party libraries... With rust, you define the layout of memory without inheritance, and the implementation of interfaces for types without defining the layout of memory. Neatly side-stepping some of the issues faced by other languages.
All resources and object lifetimes are managed, avoiding .NET's IDisposable. You can combine structures together, which can exist exclusively on the stack, avoiding the "everything is an object on the heap" problem that Java seems to fall into.
Since there's no NULL, there's no NullPointerException. There's no unchecked exceptions, or any exceptions at all for that matter. Though, I might prefer to have them. Sure, there's the try! macro. But that's just syntactic sugar for checking the return code of every function.
09F91102 no, 455FE104 nope, F190A1E8 uh-uh, 7A5F8A09 that's not it, C87294CE no. Ah! 452F6E403CDF10714E41DFAA257D313F.
This Rust language is yet another flashy thing that will not get anywhere.
That remains to be seen. I've heard the same thing said about email, the internet, Linux, Java, the iPhone, tablets and many other things over the years. The truth is that in a viable and vibrant marketplace of ideas, many things fail but some survive, and predicting which is hard. Give it a chance to fail or succeed on its own rather than condemning it in the womb, and be glad you live in a time where people have the enthusiasm and energy to try new things. Your attitude leads to stagnation.