Re:Clojure vs. The Static Typing World
by kochthesecond on Friday October 27, 2017 @11:05AM
(#15569071)
My sentiment as well.
Local segments with dynamic typing could be nice, but especially along api borders I want static typing. In most cases static type inference would be enough, I generally don't feel the need for dynamic typing then.
[ Parent
| on HN ]
I've been writing Clojure for several years with ^:always-validate'd Schemas at the API boundaries in for library boundaries and compojure-api enforcing the Schemas for input passed in via http or queues (via constructing a ring map out of an input queue and turning a ring response map into a response on a different queue). My tooling (emacs/Spacemacs) has good support for introspection/autocompletion/automatic doc popups/testing and I also get cheap to free generative testing via test.check.
The water is nice, you should jump on in.
My sweet spot is local type inference (inside functions, methods) and explicit type annotations (for types, parameters, etc), and a way to have a dynamic type with low ceremony, like just sugar over a hasmap....