Rust 1.0 Released
TopSpin writes: Rust 1.0 has arrived, and release parties in Paris, LA and San Francisco are taking place today. From the Rust Programming Language blog: "The current Rust language is the result of a lot of iteration and experimentation. The process has worked out well for us: Rust today is both simpler and more powerful than we originally thought would be possible. But all that experimentation also made it difficult to maintain projects written in Rust, since the language and standard library were constantly changing. The 1.0 release marks the end of that churn. This release is the official beginning of our commitment to stability, and as such it offers a firm foundation for building applications and libraries. From this point forward, breaking changes are largely out of scope (some minor caveats apply, such as compiler bugs)." You can read about specific changes in the changelog.
So why should I use Rust instead of the languages I'm currently using (Ada and Racket)?
Rust would have been useful 5 years ago. But now there is no reason to use it. Go, C++14, Ada 2012, OCaml, D, Scala, and even C# (now that core .NET code has been opened sourced and ported to non-Windows systems) offer everything Rust does, plus more. Somebody will probably claim that Rust "isn't competing with those languages", but in reality it is, and it's way behind them. Rust could have been a game changer, but like Perl 6 its developers just couldn't get a stable major release out on a reasonable schedule. Too many years went by and the alternatives became better options.
They could have made the same simple concepts without going C++ style. This is obviously just aesthetics, but I don't think the language looks nice compared to lots of newer languages (Swift, Ruby, Kotlin, and even D).
The :: scope operator is ugly and redundant.
This match syntax is just ugly and hard to type:
match header[0] {
1 => Ok(Version::Version1),
2 => Ok(Version::Version2),
_ => Err(ParseError::InvalidVersion)
}
The following is ugly and is not obvious:
use std::sync::{Arc, Mutex};
use std::thread;
use std::sync::mpsc;
fn main() {
let data = Arc::new(Mutex::new(0u32));
let (tx, rx) = mpsc::channel();
for _ in 0..10 {
let (data, tx) = (data.clone(), tx.clone());
thread::spawn(move || {
let mut data = data.lock().unwrap();
*data += 1;
tx.send(());
});
}
for _ in 0..10 {
rx.recv();
}
}
A simple printf function has to be a macro, because the techniques it uses are unsafe which is a main feature of the language.
OK a lot of these gripes are trivial; I guess I'm getting at the fact that they went an academic route about how to deal with pointers and memory allocation safely, and then built everything around that. It was so academic and engineering-like and they didn't think or try very hard about the design and aesthetics.
Just because the U.S. is a republic does not mean it is not a democracy. Democracy/republic are not mutually exclusive.