News for hackers. Stuff that matters.
Re:Cross-platform Rust rewrite of the GNU coreutils by Alupis on Tuesday March 22, 2016 @01:45PM (#11338374)
> I don't see why we shouldn't be moving to languages like Rust given the chance, as C makes it far more difficult to write safe and correct code

I agree in principal, however the timing is wrong.

Rust is a very new language (less than 6 years old), and is undeniably totally unproven. It is the latest "buzz" language, and may not be around long term... nobody knows.

What-more, a full-fledged re-write of CoreUtils in Rust is unlikely to be used by any production environment, because this new CoreUtils will also be undeniably totally unproven. This is the same growing pains LibreSSL have been experiencing, lots of gung-ho fans, but very few actual users (outside of OpenBSD/FreeBSD) - and their undertaking is arguably a lot easier, since they're just cleaning a codebase, not starting from scratch.

Average users who just consume distro's are not going to switch to a new unproven CoreUtils (even if they knew how), and distro maintainers are not going to switch until it's proven either. It will take a huge company with a huge install-base switching and testing it in production for many years before others start to feel comfortable... however this is also an enormous burden on said mega-corporation, for little-to-zero perceived benefits.

Yes, in principal, it's "safer" code, but to a mega-corp with thousands of installs, the risk is too great. New bugs, language pitfalls, behavior potentially changing, etc. Perhaps Rust dies, perhaps it's replaced with an even better alternative. It will take a LOT of time to work all this out.

Flatly, re-writing a several decade's old, matured codebase in today's flavor-of-the-week language is not a good idea. It's a waste of time and effort.

Let the languages mature more, do more systems work that doesn't involve replacing the foundation we all stand on... and maybe, in 5-10 additional years, we'll see where Rust goes.

Re:Cross-platform Rust rewrite of the GNU coreutils by pcwalton on Tuesday March 22, 2016 @03:34PM (#11339326)
> Flatly, re-writing a several decade's old, matured codebase in today's flavor-of-the-week language is not a good idea.

It's odd that so many in the computing industry are unwilling to move on from a language from 1978. We think of ourselves as one of the most fast-moving industries, but we have this odd reverence for early C and Unix that makes us stubborn and resistant to change. The fact is: we didn't know how to do some things properly in 1978. We know more about programming language design now. (Even Rob Pike would presumably agree—that's why he created Go!)

To be sure, we shouldn't just rewrite things in new languages for no reason. I think many segments of our industry are too fad driven. But to me the right thing is simple: Let's evaluate new technologies on their merits. Rust may well be worse than C! But if it is, let's figure out why, and say so explicitly.

Re:Cross-platform Rust rewrite of the GNU coreutils by pjmlp on Tuesday March 22, 2016 @04:19PM (#11339684)
> The fact is: we didn't know how to do some things properly in 1978.

Actually we did know how to make it properly, as Extended Algol in Burroughs B5000 in 1961 was being used, just to cite one example from many others that were ignored by the UNIX authors, because they didn't want to spend too much effort designing a proper compiler.

Re:Cross-platform Rust rewrite of the GNU coreutils by Alupis on Tuesday March 22, 2016 @03:55PM (#11339501)
> We think of ourselves as one of the most fast-moving industries

We're fast-moving because our foundation is solid and not changing (ie. CoreUtils and gang). It's an assumption that these things "just work" with zero fuss and weirdness between systems.

We build on-top of these systems, so changing them out from underneath us all is a dramatic shift.

Perhaps Rust is the key to making these things better. I never claimed Rust is bad. I've only claimed that Rust may or may not be the right choice here, and since it's so young and unproven, we should wait before trying to re-write "all the things" in Rust. Today, Rust is a pet language... tomorrow, maybe not.

Remember, it took C many years to "catch on", and even longer to become the de facto standard for systems work. We can't rush this sort of thing... especially given the sheer magnitude of things depending on this code.

We should also be careful who actually does the re-write when the time comes. New CS grads who cannot understand the old C code and therefore feel [insert-new-hip-language-here] is better... are not the best ones to tackle this sort of endeavor. This requires deep, deep understanding of the entire package, how all the components interact, legacy behavior and the reasons behind design decisions, etc...

Re:Cross-platform Rust rewrite of the GNU coreutils by pcwalton on Tuesday March 22, 2016 @03:58PM (#11339522)
> We're fast-moving because our foundation is solid and not changing (ie. CoreUtils and gang).

That isn't a definition of "fast moving" that I would use. It sounds like slow moving.

Why is innovation in the core layers of the system less legitimate than innovation in social media apps? Boeing has no problem upgrading their engines every few years for better fuel efficiency. Why can they do that, whereas can't we do the same with things like GNU coreutils?

> Remember, it took C many years to "catch on", and even longer to become the de facto standard for systems work. We can't rush this sort of thing... especially given the sheer magnitude of things depending on this code.

Actually, Bell Labs had no problems with building their entire system front to back in their new unproven language C instead of using Fortran. I'm glad they went the way they did.

Re:Cross-platform Rust rewrite of the GNU coreutils by Alupis on Tuesday March 22, 2016 @04:08PM (#11339599)
> That isn't a definition of "fast moving" that I would use. It sounds like slow moving.

Perhaps I didn't word it correctly.

When you want to write the next WhatsApp, you don't have to start from scratch. The OS has been taken care of for you, and you can expect it to "just work".

This solid foundation allows innovation to build on-top, at a rapid pace. If your foundation was constantly changing, you'd have to account for all sorts of weird intricacies, non-portable code, etc (like the old days).

A rapidly changing OS isn't really what you want for a production environment. In fact, you want it to be as constant as possible, so that you are free to do your work.

> Actually, Bell Labs had no problems with building their entire system front to back in their new unproven language C instead of using Fortran

You're right. But do remember it took a long time for it to propagate. Today, there's still systems not written in C (although they are in the minority). At the time, a lot of systems were written in pure assembler, and it took a long time to convince those guys that C was ready as a replacement for most tasks (and C changed dramatically in that time period).

I'm glad they went the way they did at the time -- but today with all these things built on top (financial markets, governments, big mega-corps, small ma n' pa shops, etc...), we need slower changes in order to keep the stability.

Re:Cross-platform Rust rewrite of the GNU coreutils by pcwalton on Tuesday March 22, 2016 @04:12PM (#11339628)
> At the time, a lot of systems were written in pure assembler, and it took a long time to convince those guys that C was ready as a replacement for most tasks (and C changed dramatically in that time period).

And they were wrong to resist C. They should have switched over sooner.

> today with all these things built on top (financial markets, governments, big mega-corps, small ma n' pa shops, etc...), we need slower changes in order to keep the stability.

Stuart Feldman, on why Makefiles insist on tabs:

"After getting myself snarled up with my first stab at Lex, I just did something simple with the pattern newline-tab. It worked, it stayed. And then a few weeks later I had a user population of about a dozen, most of them friends, and I didn't want to screw up my embedded base. The rest, sadly, is history…"

Stability is important, but eventually you do have to go back and fix things that are wrong for us to move forward.

Re:Cross-platform Rust rewrite of the GNU coreutils by pjmlp on Tuesday March 22, 2016 @04:26PM (#11339725)
> At the time, a lot of systems were written in pure assembler, and it took a long time to convince those guys that C was ready as a replacement for most tasks (and C changed dramatically in that time period).

Operating systems written in higher level languages go back all the way to the 60's, like Burroughs written in Extended Algol in 1961.

There were multiple other OSes written in variants of Algol and PL/I, before C was even an idea on its designers.

Only home micros were fully written in Assembly by the time C was getting used outside AT&T.

It is an urban myth spread by AT&T fanboys that C is the first system programming language.

Anyone that bothers to research the history of mainframes and operating systems will easily find documents of those systems, most of them written in higher level languages with more memory safe features than C has ever had.

Re:Cross-platform Rust rewrite of the GNU coreutils by ploxiln on Wednesday March 23, 2016 @12:14AM (#11342108)
Boeing's engines for passenger jets are not substantially different than they were 20 years ago, are they? coreutils also got some feature additions, fixes, and optimizations over the years.

Aircraft technology may not have been the best comparison for your argument. Have you seen http://idlewords.com/talks/web_design_first_100_years.htm

Re:Cross-platform Rust rewrite of the GNU coreutils by usefulcat on Tuesday March 22, 2016 @02:09PM (#11338572)
I think you're missing the point; this project looks to me more like a learning exercise, which is just fine.
Re:Cross-platform Rust rewrite of the GNU coreutils by Santosh83 on Tuesday March 22, 2016 @02:06PM (#11338558)
Alupis wrote: "Average users who just consume distro's are not going to switch to a new unproven CoreUtils (even if they knew how), and distro maintainers are not going to switch until it's proven either. It will take a huge company with a huge install-base switching and testing it in production for many years before others start to feel comfortable... however this is also an enormous burden on said mega-corporation, for little-to-zero perceived benefits."

Seems like this is a good opportunity for Mozilla to demonstrate the resilience of Rust and its ecosystem by adopting Rust as the language of choice, where possible, and deploying in-house a custom Linux system in which Rust-written components are plugged-in, as and when they are written and ready, with perhaps a full-fledged switch to Redox sometime in the future. If Rust and software written in it are pushed to their limits within Mozilla, then its not an unreasonable recommendation for it to be deployed on an even wider scale.

Re:Cross-platform Rust rewrite of the GNU coreutils by Manishearth on Tuesday March 22, 2016 @07:34PM (#11340832)
> deploying in-house a custom Linux system in which Rust-written components are plugged-in

I don't see Mozilla doing this, really. There's no direct benefit, and there's a nebulous future benefit for Rust.

Mozilla is using Rust components in Firefox though (as well as Servo being mostly Rust). "Adopting Rust as the language of choice" seems to be happening already -- I've heard a lot of folks enthusiastic about (re)writing in Rust. This stuff takes time, though.

Re:Cross-platform Rust rewrite of the GNU coreutils by vpkaihla on Tuesday March 22, 2016 @05:22PM (#11340052)
>Flatly, re-writing a several decade's old, matured codebase in today's flavor-of-the-week language is not a good idea. It's a waste of time and effort.

That's the sort of thinking we'd benefit from having less. Legacy is a terrible burden.