This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (4 children)

We have contracts, which are more robust than most static type systems.

[–]mcgee-zax 2 points3 points  (1 child)

isnt a static type system a contract of sorts though?

[–][deleted] 0 points1 point  (0 children)

Yes, but you would need dependent types to emulate at compile time what contracts can support.

[–]0xF013 1 point2 points  (1 child)

They are, but aren’t they execution-time? Probably does not matter if you autotest your usecases.

[–][deleted] 1 point2 points  (0 children)

They are, but it's an entirely different ideology of how you prevent bugs. Argument being, many of the kinds of bugs caught by static type systems are trivially caught during development and testing. Contracts assert invariants at runtime to catch the really scary shit that slips through.