Coffeescript Contracts

See: contracts.coffee @ GitHub.

Mozilla Research:

Contracts.coffee is a dialect of CoffeeScript with built-in support for contracts. It is inspired by the contract system found in Racket.

Contracts let you clearly—even beautifully—express how your code behaves, and free you from writing tons of boilerplate, defensive code.

Personally, I think that this update to coffeescript is actually more significant that coffeescript itself. The ability to define invariants (static constraints on data) is something badly needed for new projects.

The likeness to Coffeescript contracts and Haskell types is significant and likely to draw a lot of comparison. Haskell folks might argue that it's still not static typed -- and they'd be right -- but I think they would be missing the bigger picture that this is a huge leap forward for usage of invariants in a (somewhat) common language.