3 ms·
Chrome is a bad example. It uses a tracing GC in its most performance sensitive parts explicitly to reduce the number of memory safety bugs (it's called Oilpan)
by mike_hearn 1y ago
Chrome is a bad example. It uses a tracing GC in its most performance sensitive parts explicitly to reduce the number of memory safety bugs (it's called Oilpan). And much of the rest is written in C++ simply because that's the language Chrome standardized on, they are comfortable relying on kernel sandboxes and IPC rather than switching to a more secure language.
- wffurr 1y agoChrome security is encouraging use of memory safe languages via the Rule of 2: https://chromium.googlesource.com/chromium/src/+/main/docs/security/rule-of-2.md https://chromium.googlesource.com/chromium/src/+/main/docs/s... IIRC Crubit C++/Rust Interop is from the chrome team: https://github.com/google/crubit https://github.com/google/crubit
- mike_hearn 1y agoMemory safe languages aren't allowed in the Chrome codebase. Java is only for Android, Swift only for iOS/Mac, and Rust only for third party uses. That might well change, but it's what their docs currently say.
- steveklabnik 1y ago> That might well change, but it's what their docs currently say. It's not, actually: https://source.chromium.org/chromium/chromium/src/+/main:docs/rust.md https://source.chromium.org/chromium/chromium/src/+/main:doc... > Rust can be used anywhere in the Chromium repository (not just //third_party) subject to current interop capabilities, however it is currently subject to a internal approval and FYI process. Googlers can view go/chrome-rust for details. New usages of Rust are documented at rust-fyi@chromium.org. It is true that two years ago it was only third party, but it's been growing ever since.
- johncolanduoni 1y agoThe only thing I intimated about Chrome is that if it got 2x slower, many users would in fact care. I have no doubt that they very well might not write it in C++ if they started today (well, if they decided not to start with a fork of the WebKit HTML engine). I’m not sure what Oilpan has to do with anything I said - I suspect that it would do memory operations too opaque for Fil-C’s model and V8 certainly would but I don’t see how that makes it a bad example of performance-sensitive C++ software.