I know Mozilla played a big part w.r.t Rust, but it's strange to see this on the front page... we had this 2 days ago https://foundation.rust-lang.org/posts/2021-02-08-hello-worl... , and now we have a low-effort blog post front-paging that is welcoming the foundation.
Indeed there were also announcements from Microsoft[0], Amazon[1] and Google[2], all of which were posted on the main thread. Are we going to have a new thread for each of them? [0]: https://cloudblogs.microsoft.com/opensource/2021/02/08/micro... [1]: https://aws.amazon.com/blogs/opensource/congratulations-rust... [2]: https://opensource.googleblog.com/2021/02/google-joins-rust-...
Mozilla Welcomes the Rust Foundation
121–130 of 184 posts
Re: Mozilla Welcomes the Rust Foundation
#122> Mozilla used Rust to build Stylo, the CSS engine in Firefox (replacing approximately 160,000 lines of C++ with 85,000 lines of Rust). I would have loved to see two competing teams rewrite it, one in C++ and the other in Rust. Saying that the rewrite is better does nothing to say WHY it's better. Refactored code is almost always radically better, even when it's in the same language, for reasons that might be insulti…
Making two teams compete like that is a horrible idea. Both teams know that no matter how hard they work, their work may be thrown away. I've heard horror stories like this in a post mortem about the development of Sonic 3D for Saturn back then for example. There were two teams tasked with making a sequel, and only the better one would be released. Management's idea was that it was supposed to be a flagship title and…
The only thing fair is to give one team 6 months (ideally with a couple contractors who are experts to teach them best practices) to try the new thing. Less than 6 months and they are not far enough along the learning curve to make any useful statements. If you want a work done comparison you need to give half your teams (minimum 20 teams, ask a statistician for more details if you want to go lower or could go higher) that 6 months, and then after that give them a year to use the new one in real work, and compare that final year.
Re: Mozilla Welcomes the Rust Foundation
#123Earlier quoted context omitted.
This blog from Mozilla [1] explains why rendering CSS is such a complex process. [1] https://hacks.mozilla.org/2017/08/inside-a-super-fast-css-en...
Thanks for sharing, even though it's from 2017 it was an interesting read.
Re: Mozilla Welcomes the Rust Foundation
#124Earlier quoted context omitted.
> setting up the foundation first, so that the Rust developers could transition to it I don't think the Foundation ever plans to employ so many people to work on the language. Most of the people who left Mozilla now continue to work on Rust at Amazon, Microsoft and Facebook. By no means am I defending Mozilla here, just saying that the Foundation wasn't the solution to employ 10+ engineers working full time on the la…
Yeah, of course a Big Tech company would rather employ a developer and allow them to contribute to Rust (and influence its development in the direction of the company they work for) than donate money to the foundation so that it can pay developers. Silly me...
The developers who have newly joined these companies have years of contributing to the Rust project. I'm 1000% confident that they wouldn't land anything that wouldn't be welcome by all users. For example, one engineer at Amazon is working on making it easier for Amazon engineers to learn the language by improving the error messages. Those improved error messages benefit everyone.
Re: Mozilla Welcomes the Rust Foundation
#125Earlier quoted context omitted.
It's entirely a myth that unsafe is needed to get speed boosts in Rust. Usually, the standard library, as well as other crates, offer optimal performance without resorting to unsafe code. (If we go pedantic, Vec and other primitives do rely on unsafe, but the point is as an application developer you don't have to write unsafe code yourself.)
Unsafe rust exists for a reason. There are cases where perfectly safe code cannot be expressed according to Rust's ownership rules, and an escape hash is needed. Of course the "average" developer probably should not resort to unsafe as a rule of thumb. Also regarding the standard library, as far as I understand it's not entirely true that it never resorts to unsafe rust. For example, I understand that the standard li…
I just looked at the code of a pretty heavily optimized program I've been working on for a few months, I have exactly one instance of unsafe in the code:
pub const GPIO_ID: StreamId = StreamId(unsafe { NonZeroU16::new_unchecked(0xf610) });
I need the unsafe because at the moment the language is not smart enough to understand that 0xf610 is obviously non-zero and that I can build a NonZeroU16 from it without fail (at least I don't know how to express this in static expression at the moment). This has no performance implications whatsoever.Re: Mozilla Welcomes the Rust Foundation
#126Earlier quoted context omitted.
> C++ simply wasn't usable for writing a parallel CSS engine. I think it can be said that Mozilla was able to use Rust to achieve what they failed to with achieve with C++. It's not justified to claim that C++ is/was not suitable for this purpose. C++ offers direct, low-level control over memory, and C++ can be used to implement anything which can be implemented in Rust. Maybe Rust has certain advantages which made t…
> C++ offers direct, low-level control over memory, and C++ can be used to implement anything which can be implemented in Rust. Maybe Rust has certain advantages which made this problem a lot easier to solve for Mozilla, and I'm certainly happy to have Rust in the language landscape, but another team with other processes may have been able to use C++ to achieve similar goals. You could say the same thing about assemb…
I think this a reduction of the argument to the point of absurdity. C++ and Rust are certainly much more similar in terms of form and capability than C++ and brainfuck.
> Claims about this or that language being unsuitable for a problem aren't really about stuff like Turing completeness, it's more about practical software engineering problems (e.g. does the language provide the right kind of support to the developers allow them to implement the required functionality in a reasonable amount of time with a reasonably small amount of bugs with the budget available).
I agree. C++ may very well have been unsuitable for Mozilla at the time they adopted Rust. What I take issue with is the general claim that C++ is not suitable for a parallel CSS engine at all. This is a very strong claim, and I do not believe one team coming to this conclusion for them is enough evidence to conclude this in general.
Re: Mozilla Welcomes the Rust Foundation
#127Earlier quoted context omitted.
> C++ simply wasn't usable for writing a parallel CSS engine. I think it can be said that Mozilla was able to use Rust to achieve what they failed to with achieve with C++. It's not justified to claim that C++ is/was not suitable for this purpose. C++ offers direct, low-level control over memory, and C++ can be used to implement anything which can be implemented in Rust. Maybe Rust has certain advantages which made t…
You mean Mozilla, the organization that has maintained a 6 million LOC[1] C++ codebase continuously for nearly 20 years? If they can't pull it off with C++, I don't care who can, C++ is not the right tool for the job and you can file writing such a thing in it as an esoteric programming challenge, together with template Tetris. 1. https://www.openhub.net/p/firefox/analyses/latest/languages_...
Re: Mozilla Welcomes the Rust Foundation
#128Earlier quoted context omitted.
> C++ simply wasn't usable for writing a parallel CSS engine. I think it can be said that Mozilla was able to use Rust to achieve what they failed to with achieve with C++. It's not justified to claim that C++ is/was not suitable for this purpose. C++ offers direct, low-level control over memory, and C++ can be used to implement anything which can be implemented in Rust. Maybe Rust has certain advantages which made t…
> C++ offers direct, low-level control over memory, and C++ can be used to implement anything which can be implemented in Rust. By this measure, anything that is higher level than manually flipping bits in a binary is an inferior language.
Re: Mozilla Welcomes the Rust Foundation
#129> Mozilla used Rust to build Stylo, the CSS engine in Firefox (replacing approximately 160,000 lines of C++ with 85,000 lines of Rust). I would have loved to see two competing teams rewrite it, one in C++ and the other in Rust. Saying that the rewrite is better does nothing to say WHY it's better. Refactored code is almost always radically better, even when it's in the same language, for reasons that might be insulti…
They don't explicitly state that the rewrite is better? They just mention that they reduced the amount of code from 160,000 to 85,000 lines. Using competing teams for this purpose seems like a waste of money to me.
That's not how it was done.
Re: Mozilla Welcomes the Rust Foundation
#130Earlier quoted context omitted.
> C++ simply wasn't usable for writing a parallel CSS engine. I think it can be said that Mozilla was able to use Rust to achieve what they failed to with achieve with C++. It's not justified to claim that C++ is/was not suitable for this purpose. C++ offers direct, low-level control over memory, and C++ can be used to implement anything which can be implemented in Rust. Maybe Rust has certain advantages which made t…
> C++ offers direct, low-level control over memory, and C++ can be used to implement anything which can be implemented in Rust. By this measure, anything that is higher level than manually flipping bits in a binary is an inferior language.