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?
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.
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.
Really? How is any of this true?
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~~.
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?
The ones that are being paid to do just that? Seriously, was this a trick question?
Bah, trolls just aren't what they used to be.
http://xkcd.com/318/
Don't know something? Look it up. Still don't know? Then ask.
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.
This bot sucks because it always posts the same xkcd.
The correct answer is http://xkcd.com/927/
get proficient in a new, complex programming language just to contribute to a project?
...as opposed to getting proficient in the incredibly easy and definitely-not-treacherous language called C++? Uhm, where do I sign in?
Ezekiel 23:20
1. Feel free to back up some or all of those claims about "constant refusal".
2. The migration to Rust will be gradual, and although it uses some new syntax and permits new paradigms, the code's not that hard to read.
I could now go on about how a developer not interested in facing new challenges, such as a change in language or project, does not have the right mindset to be a good programmer, but that may be a bit harsh.
Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
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?
There are roughly a bazillion C++ programmers in the world that they can hire. How many Rust programmers are there?
As others have said, it's just another dumb idea to add to the recent history of dumb ideas coming out of Mozilla.
How many people have learnt C# ?
A brand new complex language with no users ... seems to be a couple of people use it now ...?
Given a reason people will use a language, an it might even weed out the coding wannabees who try and contribute and get rejected time after time ...
Puteulanus fenestra mortis
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.
how many will be willing to learn and get proficient in a new, complex programming language just to contribute to a project?
Probably the same number of developers that are willing to put in months of time to learn the Mozilla code base.
Learning a new programming language is simple compared to reading millions of lines of a complex software project
Who cares? How many of those "bazillion" C++ programmers would you entrust the security of your computer to, ideally?
I am not one to hop onto a new language simply because it's there, but when the language is actually being designed by a bunch of guys to get shit done in a production environment rather than just as a lab project, that IMO seems like a good start. Maybe it's just because I've almost run out of stuff to do at work and am looking for new things to work on/with, but this seems interesting to me.
which is totally what she said
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.
"Who cares? How many of those "bazillion" C++ programmers would you entrust the security of your computer to, ideally?"
Reducing your choice of programmers to hire to those who think that writing a new language to write your application is is a good business plan... does not sound like a good business plan.
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
To paraphrase Linus Torvalds:
Quite frankly, even if the choice of Rust were to do *nothing* but keep the C++ programmers out, that in itself would be a huge reason to use Rust.
Now they just need a language that will keep the Javascript programmers out, and one that will keep away the people who want to rewrite everything in a new language all the time. I suggest COBOL for a two-in-one!
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.
Reducing your choice of programmers to hire to those who think that writing a new language to write your application is is a good business plan... does not sound like a good business plan.
It worked for ITA (Common Lisp), Fog Creek Software (Wasabi), GNU (Emacs Lisp), and I'm pretty sure there are more examples.
Ezekiel 23:20
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?
It's syntactically concise, yet relatively intuitive. The reduction in use of parentheses saves some typing. But I winced when I saw "let result = 1". It brought me back to my introduction to BASIC programming on the Commodore 64, where variables could optionally be declared with the keyword "LET". I don't think I ever used "LET", as it served no purpose whatsoever, and just annoyed me when I saw it in use. I'm telling the computer that "result" equals "1", not asking it to allow that to be true.
Just a childhood pet peeve brought back to life. Certainly not a reason to avoid the language.
C# had legions of Microsoft developers that were willing to follow MS wherever they led for their paycheck.
Mozilla doesn't have that kind of power.
C++ is horrifically complex and difficult to use safely. As a high level programmer, I'd be much more inclined to learn Rust, which is almost certainly simpler and easier to use safely.
Who cares? How many of those "bazillion" C++ programmers would you entrust the security of your computer to, ideally?
Security is not a product, it is a process. (c) Unknown.
Even the best security minded programmers might fuck it up royally - without proper testing, review and maintenance processes.
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.
Well then I, for one, am glad that a company that actually produces shit for the real world is controlled and funded by a non-profit that receives millions of dollars of free money from one of the world's largest companies is interested enough in studying the current languages to find their flaws, and then researching and developing a new language that learns from the history of current languages and makes it easier to develop complicated applications that will be used by real people, and then is so wonderful that they release their compiler as open source to grow the base of knowledgeable programmers so the whole programming world can be made a little bit more discoverable and efficient.
But, that's just me. Feel free to hate something before you have thought about the motivations and consequences of it.
And being a good programmer also means you don'tÂstop using mature and battle-tested technology for something immature without good reason. Both C and C++ have plenty of issues but they have decades of experimentation and real-world experience backing them up while Rust is nothing more than a pet project with no real-world history and unknown number of issues and potential bugs. The good programmer will stick with the tried-and-true not jump to the flavor-of-the-week language just to look hip and cool. To the cargo cult programmers this is looked down on but their toy projects are meaningless tripe.
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
Hence why it's a good idea to try to make that process easier with languages that make it harder to make common mistakes. Nothing has replaced C++ so far, but that doesn't mean that nobody should even try to develop more usable languages.
which is totally what she said
"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)
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
I agree that it's weird. Usually when people get violently upset about the confusion in semantics between assignment and equality, they go off and do something like invent := or ==. A let solution, by contrast, is a lot more verbose. Of course, it's still an expression in Rust (IIRC from this morning), not a hard-and-fast statement, so like some twisted abomination of Algol-60 (as is the case with the rest of the language) you can still stick it inside of things... that, BASIC would never let you do.
Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
I think a serious conceptual assessment needs to be made about the merits of a platform before necessarily falling back on arguments derived purely from sound engineering principles. It's true those things can't be ignored, but if no one ever went out on a limb to see what was on the other side, we'd still be using Fortran, assembly, and COBOL for systems implementation. Rust has some very clear strong points (like concurrency) which definitely have potential advantages to a project like a web browser. Conservatism in a development environment won't lead to good results if it's not tempered. I'm pretty sure that Rust still uses the normal gcc backends for compilation, so it's not as if we're losing all of that experience either.
Really and seriously, I think you're over-estimating how much can be blamed on the language. From a language specification perspective, unlike Ruby or Dart, a lot of attention has gone into giving this rigorously described semantics based on modern computer science. It removes some of the sharp edges from the C family, gives an excellent collection of safety knives, and adds a lot of useful innovations that are still a pain to implement in those more primitive environments. I would guess that the majority of errors come from stalwart C++ developers who are too used to their way of doing things to consider Rust's semantics, or seek out a potentially better approach because it's conceptually unfamiliar.
Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
Wait, clarification: the "LET" keyword is only used for declaration of local variables. In BASIC it could be used for any assignment.
Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
That sounds all well and good, but where's your real world results to show to us? Yes, one should always attempt to improve the state of things but dumping mature technology for untested and unproven solutions is asinine. Get back to us when some nontrivial software that can prove the claims of the designers has been written. Until then, no thanks. I have real work to do with no time to waste on something that as of right now is a toy language.
In Rust, "let" doesn't distinguish assignment from equality, it distinguishes local variable declaration from assignment.
Well, it's a good thing nobody speaks about dumping C++ for rust-0.1 then! Seems like they're putting it out for enthusiasts to play with, provide feedback and assess it.
But isn't it a nice Catch 22: "To get a language accepted by serious project, show us a serious project written in this language". Good thing not everyone is so busy and serious as you, or we'd still be writing in assembler.
I noticed already. :)
Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
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"
You sound like you have a serious axe to grind. Care to share what's really under your skin?
Bio questions? Ask me to start a Q&A journal. Computer analogies available for most topics!
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.
C++ is horrifically complex and difficult to use safely. As a high level programmer, I'd be much more inclined to learn Rust, which is almost certainly simpler and easier to use safely.
So is Visual Basic.
Best of luck,
Cheers!
There are millions of qualified ditch-diggers in the world. What do you need bulldozers for?
Really? Tom's Hardware Guide does comprehensive browser comparisons every few months, and Firefox won the last two of them after years of being outdone by most of the competition. Have a look: http://www.tomshardware.com/reviews/macbook-air-chrome-16-firefox-9-benchmark,3108.html and http://www.tomshardware.com/reviews/firefox-7-web-browser,3037.html Firefox still has more extensions than any other browser and in April they're planning to switch to the Chrome deployment model of auto-updating in the background without prompting the user to apply updates and bug fixes every few days.
I'd say their usability, performance, security, and innovation are top notch.
Hear hear. If you don't like Rust, don't use it. The free software developers who don't feel like learning Rust don't have to contribute to Firefox. Big deal - it looks like it's close enough to C++ that the learning curve will be a matter of days for any good C++ developer. Someone unwilling to do that isn't worth having on your team anyway.
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?