I highly recommend this talk on Spec by Stu Halloway. Spec is a new feature coming in Clojure 1.9, and this talk goes into the pros/cons of static typing and tests and shows how there can be a better way.
https://www.youtube.com/watch?v=VNTQ-M_uSo8 On Sun, Oct 16, 2016 at 5:58 PM, Alan Thompson <clooj...@gmail.com> wrote: > Be sure to check out Plumatic Schema <https://github.com/plumatic/schema> > (previously Prismatic Schema) if you haven't already. There is also a good > Clojure > Conj video <https://www.youtube.com/watch?v=o_jtwIs2Ot8> from 2013. > Alan > > On Sat, Oct 15, 2016 at 3:14 PM, Didier <didi...@gmail.com> wrote: > >> I know a lot of people like to say how unhelpful Java like static typing >> is, and only more powerful type systems of the ML family add value, but >> I've been wondering recently if for Clojure it wouldn't make more sense to >> simply extend the type hints to enable an optional Java like static typing >> scheme. >> >> It is my understanding that ML style static typing is incredibly >> difficult to add properly and without compromise to a dynamic language. >> That doing so limits the scope of type inference, rendering the task of >> adding type info more tedious then in ML languages themselves. >> >> ML style static typing provide enhanced safety grantees, but seem to add >> too much complexity to Clojure to be practical. What about a Java like >> static typing scheme though? >> >> I haven't found in practice that the safety of Clojure was an issue, as >> the REPL workflow tend to promote quite a lot of testing. So I'm not too >> worried about needing the state of the art of provable correctness for my >> programs. What has been a biggest cause of issue to me was refactoring and >> shared code base across a team. Those last two use cases are actually >> pretty well handled by Java like static type checking. Is it a powerful >> type checker, not really, but it enables most trivial type errors to be >> caught early, and it allows easier integration points for other devs to >> follow, as well as documentation for functions, better tools support and >> easier refactoring, while also enabling performance optimizations. >> >> I have limited knowledge in typing systems, and have no idea how easy it >> is to implement them, but as a user of Clojure, I feel like I would find an >> optional Java like static typing a great addition, one that I am more >> willing to use and benefit from then Typed Clojure's more complex ML style >> type checking. >> >> What do other think? >> Can anyone with better knowledge tell me if this would be feasible or if >> adding such gradual typing system is effectively as hard as adding ML style >> type checking? >> >> -- >> You received this message because you are subscribed to the Google >> Groups "Clojure" group. >> To post to this group, send email to clojure@googlegroups.com >> Note that posts from new members are moderated - please be patient with >> your first post. >> To unsubscribe from this group, send email to >> clojure+unsubscr...@googlegroups.com >> For more options, visit this group at >> http://groups.google.com/group/clojure?hl=en >> --- >> You received this message because you are subscribed to the Google Groups >> "Clojure" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to clojure+unsubscr...@googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.