Become a fan of Slashdot on Facebook


Forgot your password?
Firefox Mozilla Programming

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."
This discussion has been archived. No new comments can be posted.

Mozilla Releases Rust 0.1

Comments Filter:
  • Re:No null pionters (Score:3, Informative)

    by warrax_666 ( 144623 ) on Tuesday January 24, 2012 @01:16PM (#38807325)

    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)

    by Samantha Wright ( 1324923 ) on Tuesday January 24, 2012 @01:46PM (#38807829) Homepage Journal
    I looked it up. Instead of using a null pointer they have an explicit "optional" type. I believe the compiler then checks to make sure you're using them correctly, like Java does with everything, instead of letting you burn yourself on the stove by trying to dereference a null. When you get down to it, it's not that exciting or surprising.
  • Re:No null pionters (Score:2, Informative)

    by Anonymous Coward on Tuesday January 24, 2012 @02:09PM (#38808147)

    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.
    if (list == list->next) // you are at the head/tail

  • Re:Implicit (Score:5, Informative)

    by anonymov ( 1768712 ) on Tuesday January 24, 2012 @02:55PM (#38808847)

    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"

  • From the Rust Project FAQ []:

    Are you going to use this to suddenly rewrite the browser and change everything? Is the Mozilla Corporation trying to force the community to use a new language?
    No. The Mozilla Corporation's involvement is at the labs level: the group concerned with doing experiments. The point is to explore ideas. There is currently no plan to incorporate any Rust-based technology into Firefox.
    What are some non-goals?
    ...To cover the complete feature-set of C++, or any other language. It should provide majority-case features.

    The absolutely brazen, bald-faced misinterpretation of what's going on here is stunning. They could not miss the point by more!

I've got a bad feeling about this.