Hacker News new | ask | show | jobs
by yawaramin 3450 days ago
> ... you have to prove to the compiler that your code is self-consistent. Proving something is often much harder than stating it.

Not really. When you learn the properties of your type system, you can 'prove' your way through most day-to-day programming tasks fairly easily. And when you can't prove something to the compiler, you can just fall back to telling it using its 'dynamic' escape hatch. You're certainly no worse off than you are with pure dynamic typing.

> ... Clojure Spec ... focuses on ensuring semantic correctness.

Nothing in a static type system precludes something like Clojure Spec, or at least something very much like it. You can still fall back to runtime tests that your function works according to spec. In fact that's what Haskell's QuickCheck and related generative testing systems are all about.