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

“A serious take on a contract-based language“

Not ambitious enough. We already have dependent type systems and what I will call “property based types” since I forget the proper name e.g. https://ucsd-progsys.github.io/liquidhaskell-blog/.

The compiler can check anything from silly out of bounds conditions to more complex assertions.

Even without that, a good type system will allow you to alias types but have a constructor do a check. Once you use the Percentage0_100 type you know that it must be in that range, and the method doesn’t need to check it again.

In think Haskell is “too much” for a lot of teams, but sprinkling in some compile time assertions and making that ergonomic with linting and so on would be a boon on par with async/await.

“Unit test?” no need, I have a proof!



Even better: Dependent Types combined with Refinement Types. See F* (F-star).


Refinement Types… thats the phrase I was looking for. Thanks!




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

Search: