5 ms·
There's Typed Racket [1] and for Clojure there's core.typed [2]which do pretty much that. For Clojure there's also Schema [3], which is a bit lighter weight (it
by hencq 10y ago
There's Typed Racket [1] and for Clojure there's core.typed [2]which do pretty much that. For Clojure there's also Schema [3], which is a bit lighter weight (it's not a full type system), but still gets you some of the benefits like validation and documentation.
[1] https://docs.racket-lang.org/ts-guide/ https://docs.racket-lang.org/ts-guide/
[2] https://github.com/clojure/core.typed https://github.com/clojure/core.typed
[3] https://github.com/plumatic/schema https://github.com/plumatic/schema
- hkjgkjy 10y agoNeither fit the bill though - because not every function ever written in the language is annotated. To be nice to use, it should be an all-or-nothing affair. I say this as a huge clojure fan - my clojure programs with dynamic types work great. I rely on predicates (functions ending in -?) in I/O, otherwise I'm sure things work.
- sgrove 10y agoWhy is annotation important? I agree it needs to be possible, but ultimately I want to push the majority off into inference, and only explicitly annotate when necessary or formalizing interfaces OCaml-style. Though I sure do wish I could have lisp (or clojure, specifically) syntax in OCaml-land.