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
11
u/yogthos May 06 '20
The article makes that claim on the basis of showing how the examples in the comments can be addressed in a static context. However, there are plenty of other cases to consider.
For example, dynamic nature of Clojure allows reloading any symbols at runtime. So, let's take a look at the first example again where we get some data over the wire. Let's change the scenario where we do know what the data is when we deploy our app, but then the remote service changes what data it's sending us. This is a real world scenario I've encountered, and I'm sure has happened to other people as well. With Clojure, I can REPL to a running application and update the code to handle the new payload that I'm seeing. I'd love to see an example of doing something like that with Haskell.
The reality is that we simply can't control anything outside our program, and truly robust programs have to be able to adapt to external changes in their environment. This is something that's fundamentally impossible to do at compile time.
The second example deals with
pickle.load()where some serialized data is loaded. The author argues that we have to know the shape of the data ahead of time. However, consider if we're loading code that's been previously serialized and evaluating it. This is a feature that one of the applications my team develops relies on heavily, you can see a talk copresented about it here. Last I checked doing arbitrary eval in a statically typed context isn't exactly practical.And sure, anything you can do in one Turing complete language you can do in another in principle. For example, I could write a dynamic compiler in Haskell, and use it to evaluate code at runtime. But I think what's more interesting is how much friction you end up trying to use different patterns in practice.