| > Given the scope of the project: you guys must be doing something that is so different that it couldn't be rolled into a library Memory safety and static checking. > A lot of things are renamed. auto->let, new->box, switch->box You get the feeling that effort was put in to make the language explicitly look different from C++ * let comes from ML and similar languages (e.g. Haskell), which are a huge inspiration of Rust (e.g. the type system). Furthermore, let is not auto, it does pattern matching, it's not just a limited form of type inference (or it'd be after the colon, where the type goes). * match is much the same, it's a pattern-matching construct not just a jump table * box is for placement box, IIRC it's similar to a universal placement new. For instance it can be used thus: // looks like it returns a basic stack-allocated value
fn foo() -> int {
3
}
let stack_allocated = foo();
let heap_allocated = box foo();
the second one has no more overhead than if the function had returned `box 3` and a ~int (~unique_ptr<int>) in the first place. This also works for structs, the caller can decide where he wants the return value allocated.
|
Clearly, some of those folks have worked on ML or Haskell implementations.