The type is not the proof, it is the statement to be proven by a program. In any case, expressing all necessary behaviors as types is impractical; but as tests is trivial.
-
-
Replying to @unclebobmartin @sebastiangood and
Further, using types appropriately, has the same practical outcome as writing infinity tests, but with zero effort and zero hindrance. Where is that trade-off exactly?
2 replies 0 retweets 10 likes -
Replying to @dibblego @sebastiangood and
No, not even close. I can completely replace static types with tests. I cannot completely replace tests with static types.
2 replies 1 retweet 5 likes -
Replying to @unclebobmartin @sebastiangood and
That's definitively not true. Want me to write the code for which you will never be able to write tests?
2 replies 1 retweet 6 likes -
Replying to @dibblego @sebastiangood and
I’ve seen lots of code for which writing tests is nearly impossible. We call that legacy code. There are also behaviors that are not practically testable. E.g. fully testing the multiply operator.
2 replies 0 retweets 1 like -
Replying to @unclebobmartin @sebastiangood and
Yes, you can practically fully test the multiplication operator. It's called a proof. It's exactly what types do.
2 replies 1 retweet 4 likes -
Replying to @dibblego @sebastiangood and
We can begin with that. I’d like to see that proof.
1 reply 0 retweets 1 like -
Replying to @unclebobmartin @sebastiangood and
Well, I could write and show you the proof, but that itself won't be very helpful. Want to write a trivial proof ourselves first?
1 reply 0 retweets 2 likes -
-
Replying to @unclebobmartin @dibblego and
This thread is like watching a Bold and the Beautiful episode. It goes on forever. Will someone finally show that proof we're all waiting for! Thanks
1 reply 0 retweets 1 like
There is the socratic method, and then there is bombarding you with all sorts of proofs. Here is a proof of OS kernel correctness and security. https://github.com/seL4/seL4 That doesn't help. I will find a suitable starting point.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.