4 ms·
> At Firefox they already knew the problem they were trying to solve using Rust, they already wrote that software, already discovered many of the overlooked com
by steveklabnik 6y ago
> At Firefox they already knew the problem they were trying to solve using Rust, they already wrote that software, already discovered many of the overlooked complications involved in writing a modern browser, so, in conclusion, even a rewrite in plain C would have solved many of the bugs.
The Rust re-write was the third attempt; the first two were in C++ and failed.
- amlxy 6y agoNonsense, the first rewrite was famously as success (because anyone claimed it could not be done). Have you contributed any code?
- steveklabnik 6y agoHere is is straight from the devs: https://youtu.be/Y6SSTRr2mFU?t=360 https://youtu.be/Y6SSTRr2mFU?t=360
- lostjohnny 6y agoEverybody knows that the third time is the right one! I think the point stands even more, if they tried a rewrite before, they had gathered a lot of knowledge around rewriting a browser as well Joe Armstrong, creator of Erlang, explained that his process to writing software worked like this: - write it - re-write it - rewrite it again, but this time make it right Nobody can tell what could have happened if the third attempt was done in Pascal or Lisp or Lua I too agree that Firefox being the company behind Rust, and practically the only one writing large software with it, it's not the most unbiased source to ask if Rust is good or not In Italy we have a say "Non chiedere all'oste se il vino è buono" which literally translates to "don't bother asking the innkeeper if the wine is good" which probably in english is the equivalent of "Never ask a barber if you need a haircut."
- chinesempire 6y ago> The Rust re-write was the third attempt; the first two were in C++ and failed. AFAIK most of Firefox is still written in C++, JavaScript and C [1] The JavaScript interpreter, which is particularly important to users perceived speed, is entirely written in C++ [1] https://4e6.github.io/firefox-lang-stats/ https://4e6.github.io/firefox-lang-stats/
- steveklabnik 6y agoI am talking specifically about the style engine, which is the topic of this sub-thread.
- chinesempire 6y agothe posts linked in the beginning of the thread talk about 51 memory safety bugs over the course of many years, from 2002 to 2018. Stylo has been the default CSS parser starting from the beginning of 2018. It's good that Rust could have avoided them, but is it a fair comparison? I think that when at Firefox they started to think about a new architecture to better enable parallelism they began improving considerably, Rust is only a part of that.
- steveklabnik 6y agoIf you watch the talk I linked below, you’ll see more details. They were, and tried with C++, and failed. Rust was key to the success.
- chinesempire 6y ago> If you watch the talk I linked below I've watched it several times over the past 2 years And I've read the posts about writing and HTML engine in Rust when they first came out in 2014 https://limpet.net/mbrubeck/2014/08/08/toy-layout-engine-1.html https://limpet.net/mbrubeck/2014/08/08/toy-layout-engine-1.h... and ported them to Elixir and still use them in my programming lessons > Rust was key to the success. For them It's important to specify that Rust, built by Firefox, lead to a Firefox success. Just like Dart, created by Google, is the language of choice for Flutter, also created by Google. I know you've been working at Mozilla to work on Rust and I believe Rust is very good, but I also think Mozilla could have used other languages, there were a few that could led them to success, but they understood this are times where the "means of production" aren't the machines but engineers tools, and creating a programming language is the best way to control part of that world.