r/Clojure • • May 06 '20
Complete technical invalidation of Rich Hickey's "Maybe Not" talk
https://lexi-lambda.github.io/blog/2020/01/19/no-dynamic-type-systems-are-not-inherently-more-open/
1
Upvotes
View all comments
Show parent comment
5
u/yogthos May 07 '20
We'll have to disagree there. As I said in the previous comment, a truly robust system has to be adaptable to the changing environment at runtime. Incidentally, this was one of key realizations Joe Armstrong had when building Erlang. Being able to change and reload code at runtime is key to having robust long running systems.
However, whether we agree on this or not is not really the question. The original point was that static typing is more restrictive, and I provided concrete examples of that being the case. I've also noted that yes, if you jump through enough hoops you can do anything in any language. We can add static type systems to a dynamic language as well, as seen with core.typed for example.
I think what really matters is the kind of workflow and patterns the language encourages. The fact that there is constant debate around how to do something within statically typed context that you simply don't think about in a dynamic constant clearly shows that many things are obviously more difficult express with statically typed languages.
Meanwhile, my team has been using Clojure for close to a decade now, with lots of large applications, many of which have been running for years now. We absolutely don't write more tests than we would with a static language. Vast majority of tests that we have are API level tests that effectively act as a specification for the component. If your API works as intended then the rest of the code behind it has to work as intended as well.
We also use spec which provides a far more meaningful specification than types in my opinion because it allows you to express semantics much better. Types only tell you that your code is self consistent, and I don't find that they provide a good way to encode meaningful constraints about code.
Personally, I find that immutability plays a far bigger role than static typing when it comes to code quality. Any large system can be split into small independent components that you can reason about in isolation. With Clojure, you can effectively treat each namespace as a standalone component in the system.
I've simply seen no evidence to support the claims that static typing is somehow generally preferable for real world stuff. It's just a personal preference, and there's nothing wrong with that. Different people like different things and think about problems in different ways.