Faster Validation Through Immutability

1 · David Nolen · Jan. 10, 2015, midnight
Continuing the line of the thought from the previous post let's see how immutability can help us reduce the cost of validation at runtime. While :pre condition elision is nice we would prefer that the runtime behavior of our program during development not be so divergent from our production builds. Immutable data coupled with innocuous mutation can give us what we want. All Clojure and ClojureScript data structures already adopt innocuous mutation in the form of hash code caching. By using the s...