logoalt Hacker News

hanneshdctoday at 11:57 AM1 replyview on HN

> The problem is that C have practically no checks, so any safety checks put into the competing language will have a runtime cost, which often is unacceptable.

This problem is overstated. There's no safety/performance tradeoff here. Rust has shown that extensive safety checks can be applied at compile time with zero runtime overhead.

For a concrete example, checking that an array access is in bounds at runtime does come with a performance penalty. However it's also possible to prove at compile time that an array index can never escape it's array bounds. And, if it's not possible to prove this statically - you should be heavily questioning the security of that code.


Replies

6P58r3MXJSLitoday at 11:59 AM

> Rust has shown that extensive safety checks can be applied at compile time with zero runtime overhead.

at the cost of developing time and workarounds overhead.

> And, if it's not possible to prove this statically - you should be heavily questioning the security of that code.

or that's exactly the compromise that allows you to develop that software

there is no 100% safety with zero overhead

it is not possible

show 1 reply