Mozilla is Developing a Language Called "Rust"
Along with web language champions such as Dave Herman and Brendan Eich, Mozilla's Graydon Hoare is developing a new programming language with an interesting mix of features. The language is called "Rust", and although it's still in preliminary stages, it has an exciting list of features such as control over memory layout, structural typing, massive concurrency, and the ability to define complex invariants that hold over data structures.
It's difficult to make too many pre-judgements about the language at this stage. The developers "really really don't want to be spending time on syntax discussions presently." However, to placate the masses, the developers have posted a small sample testing tuple-outputs on iterators
So here is a brief overview of the features:
Safety oriented:
Concurrency and efficiency oriented:
Practicality oriented:
The Mozilla developers have done a good job of answering many of the questions from interested developers and programming language researchers. Here are a few of the many questions that the Mozilla developers answer in an FAQ:
You can see the discussion on Rust over at Lambda the Ultimate, where Dave Herman and Brendan Eich answer some questions and debate with commenters.
It's difficult to make too many pre-judgements about the language at this stage. The developers "really really don't want to be spending time on syntax discussions presently." However, to placate the masses, the developers have posted a small sample testing tuple-outputs on iterators
iter pairs() -> tup(int,int) {
let int i = 0;
let int j = 0;
while (i < 10) {
put tup(i, j);
i += 1;
j += i;
}
}
fn main() {
let int i = 10;
let int j = 0;
for each (tup(int,int) p in pairs()) {
log p._0;
log p._1;
check (p._0 + 10 == i);
i += 1;
j = p._1;
}
check(j == 45);
}So here is a brief overview of the features:
Safety oriented:
- Memory safe. No null pointers, wild pointers, etc. Automatic storage management.
- Mutability control. Immutable by default. No shared mutable state across tasks.
- Dynamic execution safety: task failure / unwinding, trapping, logging. RAII / dtors.
- Typestate system: ability to define complex invariants that hold over data structures.
Concurrency and efficiency oriented:
- Explicit memory control. Layout and allocation control. Interior / value types.
- Very lightweight tasks (coroutines). Cheap to spawn thousands-to-millions.
- Stack iterators (effectively lambda-blocks w/o heap allocation).
- Static, native compilation. Emits ELF / PE / Mach-o files.
- Direct and simple interface to C code (switch stacks and call, ~8 insns).
Practicality oriented:
- Multi-paradigm. pure-functional, concurrent-actor, imperative-procedural, OO.
- First class functions with bindings.
- Structurally-typed objects (no nominal types or type hierarchy).
- Multi-platform. Developed on Windows, Linux, OSX.
- UTF8 strings, assortment of machine-level types.
- Works with existing native toolchains. GDB / Valgrind / Shark / etc.
- Practical rule-breaking: can break safety rules, if explicit about where and how.
The Mozilla developers have done a good job of answering many of the questions from interested developers and programming language researchers. Here are a few of the many questions that the Mozilla developers answer in an FAQ:
- How do you get away with “no null pointers”?
- Why is failure unwinding non-recoverable within a task? Why not try to “catch exceptions”?
- Why don’t local functions or objects capture their dynamic environment? What’s with bind?
- Why aren’t modules and values type-parametric?
- Why aren’t channels synchronous?
- Can Rust code call C code? Or vice versa?
- How do Rust’s task stacks work?
- Why can’t stateful objects have destructors? Why only immutable ones?
You can see the discussion on Rust over at Lambda the Ultimate, where Dave Herman and Brendan Eich answer some questions and debate with commenters.






Comments
Endre Varga replied on Mon, 2010/11/29 - 3:50am
Thai Dang Vu replied on Mon, 2010/11/29 - 9:54am
Mark Haniford replied on Mon, 2010/11/29 - 11:26am
in response to:
Thai Dang Vu
Mike P(Okidoky) replied on Mon, 2010/11/29 - 12:40pm
I thought "Vala" is an interesting promising language. I don't know if this pair example works well in Vala, but perhaps the two could learn from each other, perhaps converging their efforts together. Too many parallel experiments that aren't solidifying....
Endre Varga replied on Mon, 2010/11/29 - 3:21pm
in response to:
Thai Dang Vu
Mike P(Okidoky) replied on Mon, 2010/11/29 - 3:28pm
in response to:
Endre Varga
C++? Vala?
Endre Varga replied on Tue, 2010/11/30 - 5:45am
in response to:
Mike P(Okidoky)
Philippe Lhoste replied on Wed, 2010/12/01 - 8:13am
Interesting. Looks readable, although a bit too much on the terse side ("tup" instead of "tuple"? little gain for increased obfuscation). Perhaps showing its C roots?
I appreciate the specs, looks interesting. Yes, that's yet another programming language, but somehow I find it more interesting (on paper, at a glance) than Go which never convinced me.
The native code generation (JVM is nice, but I also appreciate lightweight programs), the interface to C code and the ability to use existing toolchains is a plus, opening all the numerous high quality C libraries, making it a real world language instead of an academic one.
Something a language like Nimrod (to add one to the discussion above) understood too: generating native C code, leaving the task to generate binary to good existing tools like GCC, interfacing easily to C and providing a good set of language libraries. But this one doesn't have Google or Mozilla behind it, so it remains unknown...
Anyway, I think I will take a look at this Rust. We can expect fast development, because as we know, "Rust Never Sleeps" (someone had to make it...).
Carla Brian replied on Sun, 2012/07/01 - 5:55pm
Jaffa Wify replied on Thu, 2012/07/05 - 6:20am
Jaffa Wify replied on Sat, 2012/07/21 - 1:46am
Jaffa Wify replied on Sat, 2012/11/17 - 12:35am
in response to:
Jaffa Wify
Apply for places to study translation. Translation is usually taught as an Master of Arts-level subject, and candidates require a degree in languages or a background that demonstrates considerable linguistic ability. You may also need to take a translation test. Thanks a lot.