Mozilla Releases Rust 0.1 232
MrSeb writes "After more than five years in the pipeline, Mozilla Labs and the Rust community have released the first alpha of the Rust programming language compiler. The Rust language emphasizes concurrency and memory safety, and — if everything goes to plan — is ultimately being groomed to replace C++ as Mozilla's compiled language of choice, with Firefox (or parts of it) eventually being re-written in Rust."
Re:No null pionters (Score:3, Informative)
type Maybe a = Just a
| Nothing
Simple and doesn't infect every fucking variable access with the possibility of null.
Re:No null pionters (Score:5, Informative)
Re:No null pionters (Score:2, Informative)
I guess none of you have ever heard of sentinels? The list itself is a valid node that is used a both the head and tail of the list. // you are at the head/tail
if (list == list->next)
Re:Implicit (Score:5, Informative)
Proper tagged union has to be explicitly "de-unionized" before trying to do something with it - that's when you can catch stray nulls/Nones/Nothings.
Basically, proper type system _forces_ you to go from Option[Sometype]/Maybe Sometype to Sometype before you can do anything with it, null, on the other hand, pretends to be a part of Sometype - when type union "Sometype + null" should be a separate type, so compiler doesn't know if you properly checked for it or not.
There is type systems with explicit "nullable" type attribute, this is closer to Option type.
And with proper optimization "Option[Type]" should yield approximately same code as "nullable Type"
could the summary be less accurate? (Score:5, Informative)
From the Rust Project FAQ [github.com]:
The absolutely brazen, bald-faced misinterpretation of what's going on here is stunning. They could not miss the point by more!