by riskable · 2y ago · 0 comments
The past 20 years of seemingly endless browser vulnerabilities due to memory management issues has left me... Skeptical. We're still seeing vulnerabilities based on memory management bugs in Chrome and the non-Rust parts of Firefox!
The sooner we stop making stuff like browsers in unsafe languages the better.
One of the issues preventing them from adopting a language like Rust or Swift was the large number of 3rd party dependencies they would bring with them, this went against the "we build everything from scratch" ethos of SerenityOS. Now that Ladybird is forked from Serenity I hope they can revisit this decision.
It wouldn't surprise me if they adopt Swift. Andreas really liked it and in the time since it was last evaluated Swift's C++ interop has improved a lot.
Stuff like nullptr has been in the spec for a while, unique_pointer and other stuff has worked its way in too.
And Rust has plenty of ways to turn memory into Swiss cheese. Anyone who does not actively acknowledge unsafe and the fact you can embed C into rust is delusional.
It's becoming harder if you understand those features and use them correctly, on top of your knowledge of unsafe C++. Even then those are opt in, and it still takes a tremendous effort. I don't trust anyone using C++ correctly. It's just hubris at this point. You can use unsafe and call C but that's a smaller surface area to audit. Most big companies are transitioning to Rust for a reason. Some big companies were trying to replace C++ even before Rust was a thing.
Why make a C++ browser now? What's the point?