7 ms·
Rust required to build Gecko
- westmeal 10y agoI always see Rust this and Rust that everywhere. Do people mostly think it's a trend or does it have it's merits?
- sgift 10y agoMay 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.
- fnord123 10y agoIt seems to be the platform that keeps things sticky. C has Unices, embedded systems, and kernels. Javscript has browsers as a platform. C# and VB have Windows as a platform. etc. Rust doesn't appear to have a platform to keep it sticky yet, so as you say it may have merit but only be a trend.
- oblio 10y agoAnd then there's Java, which had marketing :)
- dualogy 10y agoAt the time I think Java was a god-send, in terms of impact, if only for a short while. At least from the limited perspective of the code-bro-kiddie that I was back then, it filled a glaringly empty spot perfectly: that of transitioning from understanding Basic and Pascal, to understanding the basic principles behind most other languages that I had failed to grasp earlier, notably C/++. The "serious languages" (C, Perl) were cryptic, the "simple languages" were "toys", no Python/Ruby/etc to speak of (in my universe). Just simple choices such as calling pointers "references", omitting their funny operators, memory management, and presto, Basic/Pascal with braces and more expressive "records", I'm sure made many things click for many developers for life and allowed crossing of a certain chasm there. Also it really propelled MS to come up with a neat, clean, well-designed, robust "answer", which they did.
- pjmlp 10y agoOne thing I think Sun got wrong with Java was being religious against AOT compilation. Had that option been part of the standard toolchain, instead of only commercial JDKs, I bet there would even be more people adopting it instead of keep using C and C++ for certain classes of user space applications.
- dualogy 10y agoBlurry distinction. C has Unices but so has everything else, other than .NET-before-a-half-mature-Mono and decades-out-of-date historic win/dos-only langs/IDEs/compilers. So things like momentum/inertia, fewer-stumbling-blocks-on-the-platform, network effects, and critical-mass-tipping-points are still also in diffuse play imho..
- pjmlp 10y agoBefore UNIX became widespread in the industry, C was just yet another language looking for an audience.
- reirob 10y agoC was developed to be able to port Unix more easily. It's interesting to observe that Rust is developed to make Firefox more secure, faster and easier to maintain. Maybe there is indeed something to the platform analogy for the success programming languages?
- pjmlp 10y agoAlthough pcwalton doesn't agree with me, I believe system languages, based on history of computing, always require a platform for success. A small example, not all of them became mainstream. - Burroughs B5500, ESPOL followed by NEWP, nowadays known as Unisys ClearPath - Xerox Star, Mesa - UCSD p-System, Pascal - Constellation OS, Pascal - Lilith, Modula-2 - Ceres Workstation, Oberon - Blue Bottle OS (AOS), Active Oberon - UNIX, C - Symbian, C++ - BeOS, C++ - NeXT, C and Objective-C - Windows, C, C++ and .NET - Mac OS, Object Pascal, C, C++ - OS X, C, Objective-C, Swift - Android, Java, C++ This is just a tiny sample, I could come up with many more. This was quite relevant before the widespread of FOSS culture, because we tended to just use/buy the tools of the OS vendor, and most managers wouldn't sign an order to buy yet another expensive compiler just to make some developers happy. Also languages that aren't first tier on a platform always suffer from integration issues, regarding FFI, tooling with the underlying platform. Whereas using the OS official languages is just turn the key and go, so to speak. Rust probably already got its sweet spot with Firefox's adoption and universities that are adopting it for OS classes. Lets see.
- gcp 10y agoWhat does Java have? (Don't say Android, it was popular before that.)
- sametmax 10y agoIMO, 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.
- CJefferson 10y agoHaving not written much Rust yet, I agree from the outside. I still use C and C++ in my daily job. I tried D, which wanted to be a "better C++", but the problem was it didn't really add anything new -- it tidied up various rough edges, but didn't offer enough benefits to be worth the switch. I never took other candidates, like Go, seriously. While there are programs written in C and C++ which probably should be written in something like Go, it wasn't a serious replacement for places where C/C++ really excel. Rust seems to provide real benefits. Also (and importantly for external people like me), is being used to write real software I'm using. Firefox (obviously), and also 'rust-parallel', and 'ripgrep', which have just slotted into my daily life and work cleanly, fast and well.
- sametmax 10y agoOh, ripgrep seems nice.
- ekidd 10y agoI work for one of the one of the companies that uses Rust in production (see https://www.rust-lang.org/friends.html 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.
- jmcomets 10y agoYou're at a french company using Rust in production? Might I ask which one? ;)
- ekidd 10y agoSorry! My browser is set to French, so I pasted the wrong URL. Fixed. There's actually a surprisingly large French-speaking Rust community, which you can find on Mozilla IRC at #rust-fr. I work for Faraday in Vermont (http://www.faraday.io/ http://www.faraday.io/). We have, I think, 6 Rust applications. These include cage (http://cage.faraday.io/ http://cage.faraday.io/), which is an open source tool for developing complex, multi-"pod" Docker projects. We also use Rust for moving lots of data into and out of machine learning systems quickly, and we're going to be using for more data loading tasks soon.
- lmm 10y agoI 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.
- gcp 10y agoBut those people are such a tiny niche as to not be worth worrying about. I don't disagree with your assessment, but one reason why there's enthusiasm for Rust is that this niche hasn't had any real alternatives (save maybe D?) for years.
- TuringTest 10y agoI agree. In particular because that tiny niche is the one that builds the core infrastructure where every other userspace platform runs :-)
- TuringTest 10y ago> it's a bit unfortunate that it comes with manual memory management that 99% of programmers don't need For what I've seen, that's actually the #1 feature of Rust. A programmer who wants to use a ML-like language that doesn't need that feature should instead be using Haskell or F#; Rust is designed for systems-level programming, where being able to control every cycle of the processor is important. For that, you need manual memory management.
- fnord123 10y ago
- AndrewDucker 10y agoPrevious discussion: https://news.ycombinator.com/item?id=13191129 https://news.ycombinator.com/item?id=13191129
- k__ 10y agoI 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 10y agoThe 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.
- jgraham 10y agoTo understand the constrains we have here, a ballpark figure is that we run a million tests per commit across all platforms (this is based on counting test files, so doesn't account for the fact that some files can contain thousands of separate test functions, but also doesn't account for the fact that we don't run every test job on every push). On average we see around 10 test failures per push due to test instability. So "on average" tests fail about one time in one hundred thousand. Of course, in reality there are some tests that fail much more often than this (one time in a hundred, say) and many that ~never fail. Whilst test raciness is perhaps the most common problem, we also see intermittent failures due to race conditions in the browser code itself as well as through infrastructure instability. However it's unclear that moving to Rust will make much difference anyhow; Servo still sees intermittent tests so merely eliminating data races in safe code is insufficient to fix this problem.
- chelmertz 10y agoThis is a really interesting problem area. Tests that fails sometimes are really annoying because of the "broken windows" analogy. Are you using the most unstable tests as input of what to redesign next? Is it kind of a "deal with it" situation, where you need to retry the test suite a couple of times per commit, until it becomes green?
- the8472 10y ago(2016)
- gcp 10y agoI 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.
- mkesper 10y agoIndeed: If you're maintaining Firefox on a tier-3 platform which doesn't have good rust support, please be aware that Firefox 53 will be the last upstream release where rust is optional.
- halfdan 10y agoHere'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 https://www.youtube.com/watch?v=79PSagCD_AY
- baking 10y agoIt's a fine talk, but all he ever really says about Gecko is that it was 4.5 million lines of C++.