More Powerful Multimethods
summary
Methodical provides CLOS-style multimethods with auxiliary before/after/around hooks, a next-method style flow and utilities to inspect the dispatch hierarchy; benchmarks show performance about the same as Clojure multimethods but not as fast as protocols. It ships in Metabase and is adopted slowly across a ~100,000-line codebase to handle cases like dispatching on both database type and column type; caching and protocol-style caches for class dispatch are planned and a more performant Faster-Multimethods-inspired cache is under consideration.
AI-written summary · about
chapters (13)
- 0:00Introduction
- 1:49Performance comparison
- 3:36Debugging complex hierarchies
- 6:03CLOS inspiration time
- 8:12Common Lisp Object System
- 11:00Adoption at Metabase
- 14:32Stealing from Common Lisp
- 19:08Faster multimethods library
- 21:16Optimizing dispatch caching
- 24:06Better stack traces
- 25:55Nested dispatch values
- 27:59Extending Methodical
- 28:26Closing remarks








