top | item 13558922

Rust required to build Gecko

67 points| jandem | 9 years ago |groups.google.com | reply

61 comments

order
[+] halfdan|9 years ago|reply
Here's a good talk about the history of Rust and how it was developed by Mozilla to solve problems they had with Gecko: https://www.youtube.com/watch?v=79PSagCD_AY
[+] baking|9 years ago|reply
It's a fine talk, but all he ever really says about Gecko is that it was 4.5 million lines of C++.
[+] k__|9 years ago|reply
I talked to a guy at Mozilla once and he said they got a pretty instable build. Some tests take a few runs before you know they are really okay and don't fail because something is wrong.

Hope Rust will get this problem solved :)

[+] gcp|9 years ago|reply
The build itself is stable. The testsuites, not so much. The problem is that written testcases sometimes unwillingly rely on timing or races. When you have thousands and thousands of tests, as Firefox has, there's a reasonably likelyhood at least one of them will trigger.

The tests are mostly written in JavaScript, the language Firefox needs to run, so not much Rust can do there.

[+] tschneidereit|9 years ago|reply
Intermittently failing tests are a problem that all large code bases have, regardless of the used language. See for example this post about Google's code base[1], which is largely Java, Python, and to some extent Go and Dart, IIUC: https://testing.googleblog.com/2016/05/flaky-tests-at-google...

[1] They don't say which code base the post is about, so I'm just assuming that it's not Chromium. If it is, it'd largely be C++.

[+] westmeal|9 years ago|reply
I always see Rust this and Rust that everywhere. Do people mostly think it's a trend or does it have it's merits?
[+] sametmax|9 years ago|reply
IMO, Rust is the most promising technology of the decade.

We had C and C++ for a long time, and never managed to replace them. We created higher level languages (Haskell, Go, Java) as a mitigation but they never really succeeded in that domain.

Instead, they found they own favorite tasks, and are used for it. We now have better tools for other tasks, but C and C++ are still untouched.

Then arrived Rust. Something really low level. Something that is compatible with C, can do what C does, but better, safer, easier to write. Something with a terrific community improving the language at an amazing pace.

But what surprise me the most is the professional attitude of rust designers. They are pragmatic, but promote best practices. They don't get in the heat of the moment, but are passionate. They listen to the community and yet maintain a coherent design. They are working meticulously and are very productive.

Those are usually opposite qualities, you only see them joined in attitude of masters of some sort.

That is amazing to witness.

P.S: I think you need to know at least one very high level language, one very low, and one specialized in some task if you want to have versatility in your tool-belt.

I used to recommend Python, C, and one among Go/Erlang/JS/Java/Swift depending of your tasks.

I think it's time to recommend beginners to learn rust before C (although I recommend Python before rust). I hope that C will become to the new generation, what assembly is to us.

[+] ekidd|9 years ago|reply
I work for one of the one of the companies that uses Rust in production (see https://www.rust-lang.org/friends.html for a partial list). We're pretty happy with it.

I like Rust because it offers in an interesting combination of features:

1. Rust feels a bit like a good modern scripting language: It's doesn't segfault, the command-line tools are standard and mature, and it has excellent management of third-party libraries. You don't need to be constantly paranoid and vigilant to write correct code in Rust the way you need to be when working with C pointers, for example.

2. Rust feels a bit like C++: It's fast (when used correctly), it provides a "bare-metal" level of control, it doesn't require a GC, and it has generic types. Generic types are a mixed blessing: They're good for performance and correctness, but they can sometimes be a bit complex.

3. Rust feels a tiny bit like a functional language: Data is immutable by default, and you have a rich toolbox for building abstractions.

On the downside, Rust does have a learning curve. If you have solid experience with both C++ and a language like JavaScript or Ruby, plan on a week or two with Rust before you're comfortable. If you've never worked in any language with pointers, or if you've never worked in a language with anonymous functions, it might take longer.

Another Rust weakness is IDE support. Visual Studio Code and Emacs are both pretty reasonable, but if you're used to Java or C# IDEs with sophisticated refactoring support, that won't be mature in Rust until later this year.

I also find that with Rust, I spend a lot more time getting my code to compile, but once it does compile, it almost always works correctly on the first try. This can sometimes feel like "fighting with the compiler", but when you think about it, that's a lot better than "fighting with the debugger" or adding tons of printf statements everywhere. This "if it compiles it probably works" property also means that I can refactor aggressively and trust the results. But it still feels weird sometimes.

[+] sgift|9 years ago|reply
May I call you back in 2030?

Something can have merits and still only be a trend (I the sense that it starts to gain a bit of traction and then dies off). These things are not opposites and the ways programming languages live and die are quite complicated, sometimes the weirdest ones go on to rule the world, while other which look promising never leave their niche.

[+] lmm|9 years ago|reply
I think Rust's merits are real but mostly those of OCaml or Haskell which have been around for decades. I'm glad to see an ML-family language finally having a cultural moment - it's a bit unfortunate that it comes with manual memory management that 99% of programmers don't need, but it's still a great thing.

Rust is also giving the - to put it bluntly - idiots - who insist their application has to be written C or C++ "because it's fast" a better language without having to overcome that idiocy. I'm not sure if that's a good or a bad thing - it's beneficial in the short term, but letting idiotic attitudes towards performance persist seems like storing up trouble for the future.

For the people who genuinely need manual memory management Rust is a major breakthrough. But those people are such a tiny niche as to not be worth worrying about. People who claim to need manual memory management are overwhelmingly likely to be in the previous category.

[+] the8472|9 years ago|reply
(2016)
[+] gcp|9 years ago|reply
I believe the difference is that you can no longer build without Rust. The original post in that thread talks about requiring it being the default - those are not the same.