Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> any safety checks put into the competing language will have a runtime cost, which often is unacceptable.

Suppose you have bounds checks on array accesses, but your program is 100% correct and the panic case is never hit. Doesn't the branch predictor essentially make the bounds check free? Or very low cost at least?



If what comes after the check is a write or any other destructive operation, then the check is not so easy to mask away. I don't have actual numbers, but my gut is a strong 'no'.

That said, a lot of pedestrian code that isn't running particularly hot would probably be better off including runtime checks by default.


It is no different from QuakeC, GOAL, and a myriad of other programming languages that game studios never had as milestone to release to the wieder public, yet they were quite usefull to their owners.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: