3 ms·
Maybe a stupid question but: given the massive vulnerability surface area that a browser presents, why would one choose to build it in C++ instead of something
by lordofgibbons 1y ago
Maybe a stupid question but: given the massive vulnerability surface area that a browser presents, why would one choose to build it in C++ instead of something memory and concurrency safe like Rust?
I know Rust doesn't automatically make the software safe, but it does rule out a very large % of the exploitable vulnerabilities allowed by unsafe languages like C and C++.
- npalli 1y agoWho knows, maybe they cared about shipping a working product and not spend all their time fighting the borrow checker and harassing everyone else about memory safety. See Servo for ex.
- wojtek1942 1y agoWhy build a new browser in C++ when safer and more modern languages are available? [1] > Ladybird started as a component of the SerenityOS hobby project, which only allows C++. The choice of language was not so much a technical decision, but more one of personal convenience. Andreas was most comfortable with C++ when creating SerenityOS, and now we have almost half a million lines of modern C++ to maintain. > However, now that Ladybird has forked and become its own independent project, all constraints previously imposed by SerenityOS are no longer in effect. > We have evaluated a number of alternatives, and will begin incremental adoption of Swift as a successor language, once Swift version 6 is released. [1] https://ladybird.org/#faq:~:text=Why%20build%20a%20new%20browser%20in%20C++%20when%20safer%20and%20more%20modern%20languages%20are%20available https://ladybird.org/#faq:~:text=Why%20build%20a%20new%20bro...?
- QuantumNoodle 1y agoWow! This is great news. While no language can make JS interpretation more safe, I am just happy to hear the the codebase will be in something other than C++. Having started my career with C++, I've enjoyed almost every other language more. The issue I had was I didn't _want_ to touch C++ so it is unlikely I would've contributed. But when Swift makes up more of the codebase, I might go and look around.