▲ | vlovich123 7 months ago | ||||||||||||||||||||||
It’s worrying to me that Carbon separates data races and memory safety as two distinct things when data races can easily cause both spatial and temporal memory safety issues. Similarly, type safety, can also cause spatial issues (e.g. many kernel exploits in Darwin were a result of causing type confusion for the SLAB allocator resulting in an exploitable memory safety issue). The entire philosophy errs too much in the direction of “being reasonable” and “pragmatic” while getting fundamental things wrong. > Over time, safety should evolve using a hybrid compile-time and runtime safety approach to eventually provide a similar level of safety to a language that puts more emphasis on guaranteed safety, such as Rust. However, while Carbon may encourage developers to modify code in support of more efficient safety checks, it will remain important to improve the safety of code for developers who cannot invest into safety-specific code modifications. That’s really just paying lip service to Rust without recognizing that the key insight is that optional memory safety isn’t memory safety. It is kind of neat just how much Rust has managed to disrupt the C++ ecosystem and dislodge its position. | |||||||||||||||||||||||
▲ | gpderetta 7 months ago | parent [-] | ||||||||||||||||||||||
In principle data races can cause memory safety issues, but they are usually very hard to exploit. Java guarantees VM integrity in the face of data races, while for example many races are UB in theory and in practice in Go. Both are considered safe languages. Sometimes pragmatism is in fact a valid goal. edit: from a practical point of view I don't know how realistic is to retrofit memory safety to a language that lacks it. | |||||||||||||||||||||||
|