Matches closely the number of memory related security issues Firefox had in their CSS parser before the rewrite in Rust [1]
> Over the course of its lifetime, there have been 69 security bugs in Firefox’s style component. If we’d had a time machine and could have written this component in Rust from the start, 51 (73.9%) of these bugs would not have been possible
In this context I believe that the rewrite benefitted Firefox more than Rust
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 simple operation of rewriting the same software with previous knowledge of how it works usually leads to simpler code (at the cost of developers time)
Firefox is also the entity that invented Rust, so it's in their best interest to publicize it as "the final weapon" against bug, but "if we had used Rust from the beginning these bugs would not have been possible" is just wishful thinking.
Rust itself could not be there without the browser war and the pressure that contemporary web puts on software that runs it
> 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.
the 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.
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.
which ones? If they tried 2 or 3 times with C++ and the Rust one succeeded, what other information would you need to have to convince you that Rust was the differentiating factor? It seems like you just don't want to admit that Rust was the key to their success in the project, even when you have someone who was there telling you that it was.
We aren't going to get research study levels of replication on large projects like this, so I don't know what standard you're looking for here.
> what other information would you need to have to convince you that Rust was the differentiating factor?
The fact that Chrome is doing just fine without it?
> t seems like you just don't want to admit that Rust was the key to their success in the projec
It seems like you are trying a classic ad personam, I agree that Rust was one of the changing factor, I also wrote it, but just for Firefox, not in general.
Which is the original point of this sub-thread.
> We aren't going to get research study levels of replication on large projects like this
I don't think Firefox is the only large project out there. nor the largest.
Anyway I wasn't implying anything bad, just that you worked for years at Mozilla on Rust and it's like asking Anders Hejlsberg if C# enabled Microsoft to do things that have failed before with C++ or if TypeScript is better than vanilla JavScript.
Mozilla developed Rust specifically for this kind of rewrite. That was the entire point of it. (As relayed to me by one of the designers in 2011 or so.)
They didn't think just a rewrite in C would be enough, they didn't think any other existing language would be sufficient, and then they went off to design Rust. So the statement "Firefox is also the entity that invented Rust" kind of misses the point.
Some people seem to think Mozilla gets royalties every time you invoke rustc.
And that if I just took off my rose-tinted glasses, I'd realize my Rust code is buggy, unsafe, slow, and hard to maintain, and the only reason I'm using Rust is because of hype.
It was pretty hyped when I started using it, in 2015.
> And that if I just took off my rose-tinted glasses, I'd realize my Rust code is buggy, unsafe, slow, and hard to maintain
I didn't get the impression.
I understood that Firefox talks about their success in rewriting in Rust because it's their language, they control it and are the major sponsor and user.
I don't think Google or MS or any other company heavily involved in crafting programming languages for their own purposes will ever go that route for some of their core software, because they can't control the language and if they tried they would get the blame for trying.
There is a branch in the repository right now trying it out. Rust is also used in ChromeOS.
> Mozilla controls Rust because it's the largest Rust user.
Mozilla is not the largest Rust user, nor does the largest user control the language. Governance is consensus-based, and anyone is eligible to join.
> You said it yourself "the only real way to get a job working on Rust was to work at Mozilla"
I may have said that a long, long time ago, but it's not true today. The Rust team at Mozilla has been shrinking, and other companies have been letting folks work on Rust as part of their job.
And volunteers are like, 10x-25x more numerous than people who are paid to do so.
You're not even aknowledging the fact that there could be different opinions on the matter, if I was you I wouldn't play the card "you're dismissing evidence".
You work on Rust, that's a fact, I'm giving you credit for it.
Can you say it doesn't affect your judgement at all?
Rust is now an official UWP / WinUI binding, part of Project Reunion, core Windows platform, and is shipping on Visual Studio Code and Azure IoT products.
Microsoft is now a OpenJDK contributor has bought jClarity, Java has had several talks at Build and has parity with .NET on Azure SDKs, Office doesn't dictate all business lines.
And I bet you weren't reverse engineering Office to discover which ActiveX were implemented in J++ instead of VB 6.
> Java has had several talks at Build and has parity with .NET on Azure SDKs, Office doesn't dictate all business lines.
And Linux is the most installed OS on Azure...
I can buy milk from my butcher, but his core product is still meat.
you still fail to see the difference between what they offer to potential clients and what they use internally.
They are expanding the offer but are still a software house in the end.
It also means that MS is using its weight on free (as in free speech) technologies, like Google has done before with other OSS projects and we all know how it ended.
> Office doesn't dictate all business lines
Obviously, it doesn't.
It only generates 33% of the revenues and 39% of the operative margins.
The second largest segment for revenues, behind computing (mainly HW), the first for margins.
Cloud comes third - and last - for revenues and second for profits with a pretty strong growth - less than 2018 but still strong -, but keep in mind that they include the Office 365 online offer and Gaming cloud in the segment.
> And I bet you weren't reverse engineering Office to discover which ActiveX were implemented in J++ instead of VB 6.
I think Rust is pretty much a meta-rewrite. The same way you describe a team learning from an existing product (CSS parser) what needed to be addressed, they applied the same logic but one level higher: on the very tool they were using.
I think it's clever, it was risky but it seems to be paying off.
> Over the course of its lifetime, there have been 69 security bugs in Firefox’s style component. If we’d had a time machine and could have written this component in Rust from the start, 51 (73.9%) of these bugs would not have been possible
Also interesting on the topic of memory safety
https://hacks.mozilla.org/2019/01/fearless-security-memory-s...
[1] https://hacks.mozilla.org/2019/02/rewriting-a-browser-compon...