logoalt Hacker News

aw1621107 • yesterday at 11:22 PM • 0 replies • view on HN

Contracts as originally designed by the committee were explicitly not meant to enforce memory safety in that way. You were not supposed to be able to rely on the existence of any particular contract check at runtime. This recent change was something that the committee had rejected earlier, and probably begrudgingly accepted this time around as a compromise to try to ensure the NB vote passes

The two features you list don't have to depend on contracts, and in fact didn't do so at first. The dependency was only added later, and there were efforts to undo such a change right to the end.

Furthermore, IIRC hardening only relies on the contracts system to report precondition violations. The actual checks are intentionally not contract assertions and are intentionally not controlled via the same system as other contract assertions (i.e., hardened checks remain even if you use "ignore" as your contract evaluation semantic).