by willtim · 10y ago · 0 comments
Uncontrolled side-effects destroy the ability to reason about software and when one can no longer reason effectively, bugs will happen. This is obvious to anyone who has worked on large systems. Whether it matters or not, depends on the domain. In finance, it is absolutely critical that we can reproduce a calculation and that for example, the current date is not read from the system deep inside the code somewhere. Having the compiler guarantee this for us is a huge win.
> Absolutely, and you can get automatic memory management for a fraction of the cost. > You get static types for a fraction of the cost, too.
What do you actually know about the cost of Haskell adoption? If you want to accuse me of making unsubstantiated claims, your position would be more tenable without making them yourself!
I have worked on systems comprising 10MLOCs over a career of ~20 years, both as a developer and as a manager, and this isn't obvious to me at all. But I separate mutation from side-effects, because mutation is better defined, and what side-effects mean varies by language. Global mutation is important to control, but there are lots of ways to do that. Other side-effects (and especially IO)? Not so much.
> Having the compiler guarantee this for us is a huge win.
It is almost as trivial to guarantee that in Java, although maybe not during compilation.
> What do you actually know about the cost of Haskell adoption? If you want to accuse me of making unsubstantiated claims, your position would be more tenable without making them yourself!
Oh, while I haven't written much more than Hello, World programs in Haskell (but I have programmed in SML a bit years ago, and a fair bit in Scheme and Clojure), I am no stranger to the theory of pure-FP (simply typed LC w/ polymorphism, functional semantics, monadic composition etc; I'm less familiar with call-by-value semantics, though). It is pretty radically different from most other styles of programming, including imperative-functional, both in terms of coding as well as tools such as debuggers and profilers.
While I could probably stomach giving up purity in a small project, you'd only be able to take away sum types and pattern matching from my cold dead hands.
[1]: This isn't even about a particular language (although different languages do have different cost of adoption). Any language that doesn't have excellent interop with existing libraries and legacy code has a very high cost of adoption (and yeah, we've tried Scala years ago, and the experience was far from good).