News for hackers. Stuff that matters.
Re:Clojure 15th Anniversary: A Retrospective by kaba0 on Saturday October 22, 2022 @07:15AM (#33297302)
While there are some static type libs for clojure if I’m not mistaken, the standard solution is to use spec, which employs contracts. These can be used to check arbitrary things at runtime, with quite readable error messages.

Also, due to the extensive use of FP and not much side effects, you can catch most of these mistakes at test time - not the same as a good static type system, but it is an interesting tradeoff, better expressivity, but not happening at compile time.

Re:Clojure 15th Anniversary: A Retrospective by KingMob on Sunday October 23, 2022 @09:31AM (#33306848)
The standard advice with spec is to use it at the edges of the system, and not for every function and input. Probably because it incurs runtime overhead to use, and design overhead to apply. On top of which, it's still listed as "alpha" after 6+ years.

As a runtime contract, spec can check things type systems can't, but IMO it's not pervasive enough in most code bases to really satisfy.

Re:Clojure 15th Anniversary: A Retrospective by kaba0 on Sunday October 23, 2022 @03:25PM (#33309494)
Yeah, I absolutely agree.

(Though perhaps using them internally as well may be okay, just disable it at prod)