How dangerous is Clojure's immutability assumption?
dons: In 10 years I've had maybe 5 bugs in Haskell caused by foreign language code mutating objects under the hood, and that breaking referential transparency guarantees in the Haskell code.I would not consider this "dangerous". It's a side condition you'll need to check. The language can make this more or less easy to establish.Typically it looks like your value is changing under the hood. It's relatively easy to debug -- since the result is so unexpected.It's rare in Haskell. I imagine it is a bit more common in Clojure, where they rely more on Java code than Haskell does on C code.I don't believe Clojure is an optimizing compiler -- it's not doing any optimizations based on static guarantees of referential transparency -- so that simplifies the issue. If the compiler can't guarantee purity, there's less it can do with to your code to take advantage of that, so less unusual semantics.