logoalt Hacker News

Ciericyesterday at 4:15 PM2 repliesview on HN

You sounds like you have more experience than me in this space (specifically contracts). I'm curious if you have any examples right off hand that would need whole program analysis. I need more examples to throw at my toy language that's not just another lock free work stealing queue.


Replies

steveklabnikyesterday at 4:42 PM

C++ contracts are not a compile-time construct, they're a runtime construct.

Take the example from the article. The contract trips at runtime, not at compile time.

show 1 reply
bluGillyesterday at 4:30 PM

If I have more experience than you that means you have no experience at all. I've never used contracts in anything (not even a toy). I've been following contracts in hopes that they can be the next step in my quality journey, but I have no real world experience myself.

By whole program analysis I mean you need the entire call tree of a function - stopping only when you can validate that the range of values is constrained to legal values. For some functions this is really simple, while for others the whole flow can be thousands of functions.

show 1 reply