Dynamic Dispatch and Type Inference in Fortress
summary
Implements multi-argument overloaded dispatch plus generic type inference for Fortress, producing statically checked but dynamically inferred calls; dispatch orders overloads by partial order topological sort and tests applicability by pattern matching plus constraint propagation that instantiates type parameters. Achieves specialization via a compile-time partially evaluated match routine and runtime applicative cache with volatile root on the JVM, but requires language restrictions: selfless traits singly inherited, no contravariance, finite supertype paths and declared minimum instantiations; the system works but needed those tradeoffs and JVM workarounds.
AI-written summary · about
chapters (11)
- 0:00Intro
- 1:42Java vs. Fortress dispatch
- 2:25Generic overloading uses
- 3:57Quick type system
- 5:05Self-less generic types trait CMPable[+] comprises i
- 8:03Test applicability?
- 14:02Propagate constraints Least Single Upper Bound
- 16:54Worked example
- 19:38Run-time type operations
- 20:19Longest Erased Path to Any
- 21:47JVM issues . Current implementation makes heavy use of applicative caches (declared volatile, CAS for update, no-lock reads).
related talks
22mRevisiting Dynamic Dispatch for Modern Architectures
29mPredicate Dispatch
16mContextual Dispatch for Function Specialization
21mPolymorphic Type Inference for Dynamic Languages
01h 00mDynamic Polymorphism with Metaclasses and Code Injection
15mThe Simple Essence of Overloading: Making ad-hoc polymorphism more algebraic with(…)
21mSeamless Scope-Safe Metaprogramming Through Polymorphic Subtype Inference (Short Paper)
01h 07mDynamic Polymorphism With Code Injection and Metaclasses
