The Road to Immutability
maddi is a whole-program static analyzer that computes immutability, modification and independence for Java and Kotlin. The Road to Immutability is the book that explains what those words mean — the concepts and the definitions, worked through from final fields to the link system.
It stands on its own. You do not need to run the analyzer, or install anything, to read it.
Start reading → Download the PDF
What it covers
The book builds one idea at a time, and each chapter depends on the ones before it.
- Final fields — the weakest useful guarantee, and why it is not enough on its own.
- Modification — what it means for a method to modify its parameters, its fields, or nothing.
- Containers — types that do not modify what you hand them.
- Linking and dependence — how two variables come to share the same mutable thing.
- Immutability — the levels, the confinement guard, and the stratum boundary.
- Eventual immutability — builders, the mark, and what “before the mark” buys you.
- Hidden content — the part of a type’s state that its own API never exposes.
- The link system and convergence — the two technical chapters, on how the analyzer actually computes all of the above by iterating to a fixed point.
Where the tool lives
The analyzer, the build plugins and the command-line distributions are on GitHub at CodeLaser/maddi.