Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
pml1
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
pml1
6y ago
> When you write C/C++, 100% of that codebase is unsafe. Don't you think that statement is a bit over-the-top ? Large parts of C/C++ codebases are just as safe as the equivalent Rust code, as it doesn't do any pointer
2.
▲
by
pml1
6y ago
> Writing C, you're constantly at risk of making these mistakes. Writing Rust, you can keep the vast majority of your code safe and more closely examine the smaller unsafe area for memory errors. I think this is a fallacy...The majo
3.
▲
by
pml1
6y ago
It won't be rare in driver code.
4.
▲
by
pml1
6y ago
>So there will of course be some unsafe. In a well implemented driver it will also be very limited in scope and relatively easy to check. I'm sure that is what the C developer thought as well...I'm not trying to be snarky, but
5.
▲
by
pml1
6y ago
So the same argument that is made against the "mythical C programmer that never makes memory corruption mistakes" is also valid for the mythical Rust developer that never makes mistakes in unsafe code... It's two sides of the
6.
▲
by
pml1
6y ago
really ? You've checked all the code in question and you are a 100% sure that you would have required _zero_ unsafe code ? Drivers by their very nature require a lot of unsafe pointer passing...Having worked on a lot of embedded Linux