Growing the Java Language
summary
Proposes adding Haskell‑style type classes to Java by treating ordinary interfaces as type‑level “type classes” and declaring witness fields and methods that the compiler uses in a compile‑time proof search to assemble required behavior. Prototype exists and reifies proof trees into constants via constantdynamic reification, so the VM can inline/intrinsify. Concrete targets: exact primitive widening, value‑type operator overloading, collection literals, and default creation expressions; resolution is deliberately local to named types to keep results well‑defined.
AI-written summary · about
chapters (29)
- 0:00Introduction
- 1:26User and language space
- 4:03Guy Steele's call to action
- 6:13Past examples of growability
- 8:40Planning for future growth
- 10:58Conversions for new types
- 13:14Operator overloading
- 14:39Collection literals
- 17:05Type system limitations
- 18:29Limitations of interfaces
- 22:02Type classes as a solution
- 27:12Comparator and witnesses
- 30:19Adding indirection
- 33:32Type class mechanics
- 37:53Well-defined resolution
- 42:25Witness resolution details
- 45:59Benefits of type classes
- 48:20Generics and type classes
- 50:29Implementing growth opportunities
- 53:45Operator overloading details
- 57:08Performance and JIT
- 58:31Creational expressions
- 1:02:06Conclusion and summary
- 1:04:33Q&A: JVM languages
- 1:10:48Q&A: Babylon project
- 1:11:08Q&A: Resolution details
- 1:12:47Q&A: Implicit conversions
- 1:15:59Q&A: API evolution
- 1:19:29Q&A: Interfaces vs classes
related talks
16mThe past, present and future of the Java type system
42mOperator Overloading with Type Classes
01h 00mJava Language Futures - All Aboard Project Amber
01h 02mHaskell for Java Programmers
08mInterview
48mValhalla: To the Hell and Back
46mWhere is the Java language going?
36mJava Language Futures - Mid 2020 Edition
