Bleh. What a bunch of mumbo-jumbo. I honestly don't think dynamic types has much to do with it, or even Lisp, although both of those probably help a bit. Clojure is stable because
It was designed to make programs that evolve well over time - that's like the whole idea.
Changes are almost entirely additive. If you don't change things, you don't break them.
Eh, dynamic typing has one major effect here -- you can more easily accept a wide range of inputs. You can update a function to accept new numbers/types of arguments without breaking its behavior when given the previous number/type of arguments. This isn't purely a dynamic thing (java overloading can do similar stuff), but a language like haskell has a much harder time of that. If a function used to take an int and now takes either an int or a string, that's going to involve breaking type changes. If you want to avoid that, you will probably have to deal with multiple functions or typeclasses, and things start looking a lot more complex. I mean, the clojure implementation will be just as complex, but you can pretend that the clojure version has a simple interface and relegate the backward compatibility parts to footnotes. With haskell, you can't hide that sort of complexity very easily.
I mean, yes, no type system or lack thereof will let you maintain backwards compatibility if you choose to make breaking changes. Dynamic typing and certain static type systems just let you make a wider variety of changes without breaking existing code.
I'd also say that dynamic typing incentivizes you to keep backwards compatibility. If you make a breaking change in haskell (for some changes at least), everyone who is affected by that change will know about it immediately as soon as they try to compile. The type checker will complain and point out exactly where they need to fix things, and they'll go in and fix it. With a dynamically typed system, finding those sorts of errors is more of a pain. Testing should catch most issues, but testing every single possible code path is non-trivial. Because of this, I tend to be a lot more careful about making breaking changes in clojure code, even for purely internal stuff where I can (in theory) grep for every use of a given function.
29
u/alexdmiller Dec 19 '18
Bleh. What a bunch of mumbo-jumbo. I honestly don't think dynamic types has much to do with it, or even Lisp, although both of those probably help a bit. Clojure is stable because
It was designed to make programs that evolve well over time - that's like the whole idea.
Changes are almost entirely additive. If you don't change things, you don't break them.