3 ms·
Right now, pretty much 100% of all browser code is "unsafe", because they can't (for a pragmatic definition of "can't") be written in C#/Go/Java and have to be
by Rusky 12y ago
Right now, pretty much 100% of all browser code is "unsafe", because they can't (for a pragmatic definition of "can't") be written in C#/Go/Java and have to be written in either C++ (or something equally unsafe), or something else with more static analysis. That's why dogmatically going with safety drives those projects back to C++.
The implementations of C#/Go/Java are also 100% unsafe, as they're in the same boat.
Getting that 100% down to 10%, where the 10% is clearly marked and sequestered behind safe interfaces that are well-tested and well-audited, is a much better solution than giving up on one or the other of performance or safety entirely.
- pjmlp 12y ago> The implementations of C#/Go/Java are also 100% unsafe, as they're in the same boat. No, because there are(will be in Go's case) meta-circular implementations available. C and C++ aren't the only way to implement compilers.
- Rusky 12y agoThat's the exact principle I'm talking about- meta-circular implementations shrink the amount of unsafe code and confine it to specific places where it can be better tested and checked. Rust's unsafe-with-safe-interfaces style is just another way to do that, which honestly is a lot more straightforward.
- pjmlp 12y agoThat is how meta-circular implementations work anyway. You need to have some intrinsics for the really unsafe parts, or get them in Assembly. Sorry for not getting your point fully.