Quantifying and Explaining Immutability in Scala
summary
Empirical study analyzes medium-to-large Scala projects with a Scala 2.11 compiler plugin and outputs per-template immutability stats; scala-immutability-plugin runs over sources and reports shallow, deep and conditional deep immutability. Key findings: about one third of templates are deep immutability, less than half are mutable overall, case classes are far more immutable (≈25% mutable vs ≈50% for plain classes), and Akka actor <20% mutable while many singletons are immutable.
AI-written summary · about
chapters (17)
- 0:00Introduction
- 0:50Why is immutability important
- 5:22What is referential transparency
- 10:47Immutability in Scala
- 12:55Examples
- 15:12Constraints
- 16:41Issues
- 18:01Limitations
- 19:50Types of immutability
- 24:55Questions
- 32:00Results
- 39:40Summary
- 40:40Declarations
- 42:23mutable templates
- 43:28shallow immutability
- 44:22more details
- 44:54conclusion








