Mozilla Releases Rust 0.1
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."
From the article: "null pointers are not allowed". So what better type is there to represent what amounts to a tagged union between a reference to an object and a value representing the lack of an object?
http://xkcd.com/865/
Use a language with no existing user-base.
WTF are these people thinking!?!
Get rid of bit rot and get Rust instead? ;)
Ezekiel 23:20
The other guy ALWAYS has the better gun.
With their constant refusal to keep up to the usability, performance, security, and innovation of other browsers it seemed to me that Firefox developers didn't care much about getting new users (they lost quite a lot in fact). Now, it seems they don't need developers either, because how many will be willing to learn and get proficient in a new, complex programming language just to contribute to a project?
I don't think they will re-write a software as big as firefox in another language... I'm remember a post on slashdot that the build was so big it could not compile on some compiler/environment.
It will be a huge time waiste and will just put firefox way behind the line against the other browser (IE, Chrome, Safari, Opera) that will be spend time on feature rather and re-write the code.
When people say "ultimately as fast as C++" they always mean "for the idiom/paradigm we wish to carry forward". There's no language out there "as fast as C++" across the board for everything you can write in C++.
The implied retort: Well of course not, nobody would invent such a stupid language from scratch, combining such a disgusting mishmash of paradigms.
C++ syntactic morass: tired
underlying C++ conceptual model: pretty good, accounting for dog years
Racial purity: MIA
Survival's Ick Factor
At the end of the day, C++ keeps us united.
~~Rust never sleeps~~.
So, Mozilla has kindly given the Open Source community yet another language to read about, learn, try out and (after some time) eventually master. And this just to handle a web browser? Sweet Moses.. What's the fuss all about? Can't Mozilla just give us the real favor and stick to a robust industry standard (C++) which has loads of talented and skilled contributors?
There are 2 types of people in the world - those who understand decimal and those who don't.
Yet another solution in search of a problem.
So what's the difference between a tag labeled "end" and a null? Or what's the difference between a type that can hold either an element reference or a tag labeled "end" on the one hand and a type that can hold either a reference or a null on the other hand?
One of the goals set out in the Rust is to eventually be as fast as C++. Many have tried such. How much space and time overhead would such a union type incur compared to the maybe type that is the C++ pointer?
Because every time I see someone abbreviate "Function" as "Fn" I read it as "effing"
Basically looks like it is to c++ what scala is to java, with a load of Haskell thrown in too.
Now we will have 1000002 different programming languages (final 2 so that Slashdotters understand it's not binary). And an obligatory XKCD reference.
The Firefox codebase definitely has some huge issues, but does anyone remember the big Netscape rewrite for version 6? Joel does. http://www.joelonsoftware.com/articles/fog0000000069.html
C# is a high level language you have no direct access to memory (or even the machine), and you work with objects not memory, this means you lose some power being one step away from the machine, but you gain security in that the system will stop you doing most stupid things ...
But even C# allows reference variables to be set to null. The type of a C# reference variable is just as much of a maybe as the type of a C++ pointer variable. Null-reference exceptions are just a special case of wrong-type exceptions from a tagged union.
Oh great - just what we need - yet another programming language. Never mind that there ain't enough people to teach kids and adults the languages we already have. Instead of training people to hone their skills in C, C++, Obj-C, Obj-C++, Java, Python, et al, what better than to come up w/ a new language that one would have to learn from scratch, and whose only contribution would be 'hey, GCC supports this as well!'. That too w/ such an inspiring name as 'Rust'. And 0.1, meaning it's currently unusable. Why not wait until 1.0 is ready before announcing it?
Presumably, the whole point of Rust's C++ compatibility is that you don't need to do a big rewrite if you have an existing C++ codebase, you do module-by-module rewrites as is convenient.
A special tag is not type-compatible with every other single value in the language.
HAND.
They are handling this the same way that many other languages which "don't allow null" do.
By default, references are not allowed to hold null pointers, and the compiler enforces this by ensuring that a valid object is assigned when the variable is created. This is nice for the majority of references which should never be null.
When a reference can be null, it has to be defined using special syntax (like adding a question mark to the type). In this case, the compiler forces to always check for null before dereferencing the variable. Which is also nice.
Those who look at the language as it's grammar will say they have been removed. But those who look at the language as what you can do with in realizes the concept still exists, just with different syntax. Either way the language strictly limits the way you use them to eliminate nearly all of their problems.
So 5 years for 0.1 I look forward to version 1.0 being released 2062 ;)
Okay, I'm lost in this one. If the goal of the new language is "to be as fast as C + +", so why not just use C + +?
And worse, to supposedly "protect" the programmer from himself (pointers are evil, GAHHHHH)? If the developer does not know how to make a good program in one language, it will still not know how to do in any other language.
Religion: The greatest weapon of mass destruction of all time
Firefox is so very famous for nom nom noming all your memory over time.
I have to restart it every day because it sits on a whole GB of RAM.
They're using their grammar skills there.
Null inhabits every single (non-primitive) type in the C# language.
HAND.
Null inhabits every single (non-primitive) type in the C# language.
What's the difference between null inhabiting a type and the type being an implicit tagged union?
If you have never used either of the two editors with supported syntax highlighting then just use Emacs as it has always clearly better than Vim.
newbie to programming here. I'm waiting for the binary packages for Windows XP 32bit.
These installation instructions won't work on Microsoft Windows anyways:
$ wget http://dl.rust-lang.org/dist/rust-0.1.tar.gz ./configure
$ tar -xzf rust-0.1.tar.gz
$ cd rust-0.1
$
$ make && make install
"If the developer does not know how to make a good program in one language, it will still not know how to do in any other language."
That statement is not true, not close to being true, and it ignores a great deal of nuance. In fact, if you pick a random language X, most good programmers don't know how to create a good program in that language. For example, I have heard that John Resig, who created jQuery, does not know how to write a good program in Visual FoxPro.
Also, just because it possible to program in one language doesn't mean that another language be more productive, or easier to make error free code in. For example, if you created a language that relied on goto statements, it would less productive and result in more buggy code than C++. Just like Goto, it has been found that explicit pointers make buggier code than languages that make it possible to completely eliminate the use of explicit pointers.
Democracy Now! - your daily, uncensored, corporate-free
It's interesting. The language has a lot of features I've suggested for years, such as language support for single-ownership and reference-counted pointers. One of the two basic problems with C is that programming requires obsessing over who owns what, and the language provides zero help in dealing with that problem. (C++ papers the problem over with collection classes, but the mold always seeps through the wallpaper when a raw pointer is needed.)
The immutable-by-default concept and local scoping with "let" is a win. It moves the language in the direction of single-assignment programming, which has most of the advantages of functional programming without the heavy nesting.
The declaration syntax is better. With name : type the syntax can be context-independent, which means you can reliably parse program text without reading include files to get the names of all types first. You can't parse C or C++ reliably without knowing what's a type name, which requires reading all the include files. This makes it much easier to write tools which take in source code and do useful analysis or cleanup.
Downsides include the typical negatives of the open source world - the name "Rust" is lame, and the Windows version has to be built by the end user.
First, an actual link to the language's site.
Second, isn't it time we stop reinventing the same language over and over again, each time in a slightly different form? I recommend one of the best lectures on the subject: Are We There Yet?.
They should get rid of the braces and semicolons. Any new language should borrow from more efficient (syntax wise) languages like Python or CoffeeScript (which is the most efficient language I have worked with). Using tabs / indentations for blocks works absolutely fine and using one command / expression per line without a closing semicolon makes coding a lot faster.
I'm not of the belief that the best computer language that will ever be invented has been invented.
So, onward, I say. Fail if you will, and we'll hopefully learn things from that failure. Succeed if you can, but the odds are against you, so you better be pretty sure you're learning from those who have failed before you.
My God, it's Full of Source!
OUTSIDE_IP=$(dig +short my.ip @outsideip.net)
0.1? No thanks, I'll wait for 11.0 next month
Does the designer of the language have facial hair? No point in learning it if he doesn't. (And if it's a woman and she's not the bearded lady, forget it.) http://blogs.microsoft.co.il/blogs/tamir/archive/2008/04/28/computer-languages-and-facial-hair-take-two.aspx
From the Rust Project FAQ:
The absolutely brazen, bald-faced misinterpretation of what's going on here is stunning. They could not miss the point by more!
YABL
Unless you've got a dedicated hardware modding crew, it is essentially impossible to test some classes of software that are designed to deal with hardware faults.
For instance...how would you trigger an uncorrectable ECC fault on your server's memory? You can register for such notifications, but can't actually test it unless you happen to have a faulty DRAM module hanging around.
Ada for the next generation.
Domestic spying is now "Benign Information Gathering"
For all those people commenting asking about why we need a new language, Rob Pike, one of the developers of Go, gave a talk a couple years back that included some of the reasoning behind why the Go developers felt that a new language was needed, rather than just a new library. The rationale was mostly intended for Go, but Rust fills a very similar niche, so the rationale works for it as well. The video is here for those interested.
Pointer variables in C++ and reference variables in Java are in essence a nullable/option/maybe reference to an object of a given type. This is conceptually the same as a tagged union between a reference to the given type and the global sentinel object called NULL. In fact, others have explained to me that Rust allows such option types as a language feature. I was just worried that messing around with a tagged union might hurt the goal of being "as fast as C". Perhaps my point is that "no null pointers" should have been written "no implicit null pointers": each variable can be marked with type T or option<T> depending on whether the program ever expects to store a reference to the null object in this variable, and static analysis will keep a reference to the null object from being stored in a variable of type T.
All is human-translatable to C language that's the most popular, but who doesn't use lambda calculus?
JCPM
The whole point of an optional type, is that you must deunionize them before you can use it.
Deunionize? Does this mean programs written in languages that distinguish variables of type T not null from option<T> have a right to work?