Adventures on the Road to Valhalla
summary
Prototype implements generics over primitives by keeping erased class files plus a specializer that uses a bytecode-mapping attribute and name-mangled specializer to emit specialized classes and i/load i/return replacements; generic methods use invokeDynamic and unsafe.defineAnonymousClass for installation. It proves compatibility and ports Streams with ~70% less code, but is brittle (bytecode-index dependent) and yields poor code sharing between instantiations. Proposed fixes: synthetic box$any interface, array-any abstraction, and constant-pool or universal-bytecode designs to let the VM manage sharing.
AI-written summary · about
chapters (23)
- 0:00Intro
- 1:16Why do we need better generics?
- 2:45What's the problem with generics?
- 4:10Many paths to parametric polymorphism
- 5:51The Prime Directive
- 7:23Generic class specialization
- 8:43Specialization example
- 9:33Specialization metadata
- 15:37Generic methods
- 20:35Summary - Act 1
- 22:51What about Foo
- 24:41Rescuing wildcards
- 26:33Translation with wildcards
- 28:29More translation examples
- 29:13Wildcard challenge - accessibility
- 31:13Wildcard challenge - arrays
- 34:05Summary - Act 2
- 39:13overly typed bytecodes
- 42:04erasure
- 43:36describing specializations
- 44:47method signatures
- 46:34What's the point?
- 48:12Summary - Act 3








