Stealing from Biologists to Compile Haskell Faster
- Programming
- Developer Tools
- Algorithms
The post takes a specific compile-time bottleneck in GHC, the Glasgow Haskell Compiler, and recasts it in terms borrowed from biology and fast matrix-style algorithms. The claim is not that Haskell compilation suddenly gets much faster in practice. It is that an “optimal path” problem inside the compiler can be pushed below cubic time in theory by using techniques related to min-plus algebra and sequence-style dynamic programming. The author’s own follow-up made the practical verdict clear: you probably would not want to ship this in GHC, because the best bound still comes with ugly constants and would drag a lot of linear algebra machinery into a compiler for little real-world gain.
Treat this as a reminder that asymptotic wins do not automatically belong in production compilers. If you work on build systems, compilers, or dependency scheduling, check whether your real bottleneck is algorithmic complexity or whether simpler graph methods already get you close enough.
- iankduncan.com
- Discuss on HN