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?
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.
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.
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!
They're thinking that any good programmer can pick up a new language within a week or two, so this has a two fold benifit: one - getting rid of the crap programmers who can't think in more than one way; and two - helping their good programmers to write better code.
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.
Because every time I see someone abbreviate "Function" as "Fn" I read it as "effing"
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
I remember reading this back in the day, but this article has not aged well. Joel is a smart guy, but this advice is frankly ludicrous.
In Joel's world, Apple would have never scrapped Mac OS Classic and launched OS X. And Microsoft would have never scrapped the old DOS underpinnings and started over with the NT kernel.
Starting over happens all the time in software projects, and I'll admit that in many cases it's a waste of time. But quite often, it's an excellent idea. The world changes, and despite what Joel thinks, software really does age.
In the case of Netscape, I would say that their rewrite worked out pretty well. Mozilla was a big jump forward in browser technology, and then Firefox (which itself was a rewrite of Mozilla) has become a truly successful browser.
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.
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
So in other words, once they optimize the [expletive] out of their maybe types, they'll be back where they started.
the big issue with rewrites is that people doing the rewrite often think they can do a better job that their predecessors,and invariably find that their predecessors weren't as crappy as they thought they were.
It also beats me why they thought a new language is the solution (looking for a problem perhaps) instead of a solid class library to do all the stuff they need help doing. The existing C++ community might get something out of it too then.
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?
then why aren't they thinking that codifying their common code problems in the existing language won't help? A refactoring using C++ would fix all their problems as surely as a rewrite, only it'll be a lot quicker and wouldn't introduce so many new bugs. It might also give rise to some nice libraries that can be used too.
A rewrite in Rust helps no-one, just you see. They might as well rewrite in node.js
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.
So in other words, once they optimize the [expletive] out of their maybe types, they'll be back where they started.
That's pretty much it, except that they will have statically proven that null pointer exceptions can't be thrown in their code, which is probably the purpose of the whole thing.
Ezekiel 23:20
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.
Given that this is Mozilla, this should have been version 1. A bug fix they issue next week should rev it up to version 2, and so on
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?.
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!
Aaaaand here we go from general case to an unrelated corner case.
"How would you trigger a run-away truck breaking through your datacenter? What, catching NPEs ain't helping you now, buddy?"
We were discussing software and catching exceptions, and here you go with hardware and catching faults.
Anyways, if you're testing software detecting and reacting to ECC faults, you do it on a test rig with ECC error injection, no need to keep broken DRAM around. Don't you notice the oxymoron in "Untested fault-tolerant software"?
But as we were not talking about software detection of hardware faults, your argument is invalid.
In Joel's world, Apple would have never scrapped Mac OS Classic and launched OS X. And Microsoft would have never scrapped the old DOS underpinnings and started over with the NT kernel.
OS X is a hack on NeXT's OS, which is a hack on Mach, which is a CMU hack on BSD, which is a hack on UNIX 32V (AT&T's VAX UNIX), which is a hack on UNIX System 7 for the PDP-11.
There are original, new operating systems, but they're rare, IBM VM, QNX, AT&T Plan 9, and PenPoint come to mind. Windows NT really was a fresh start, but it wasn't backwards compatible with the DOS/Windows 3/Windows 95 sequence. Those were merged, painfully, in Windows NT 4, 2000 and XP. I can't think of any recent, successful examples.