Java Cup
Inside Java

News and views from members of the Java team at Oracle

Growing the Java Language #JVMLS

(Recorded at JVMLS 2025 - for more, check our JVMLS 2025 playlist.)

How can Java language features give user-defined types the same opportunities as built-in types? Building on Guy Steele’s ideas about growing a language, Brian Goetz examines the successes and limits of extensibility through interfaces. Numeric conversions, arithmetic operators, collection expressions, and default instances motivate a more general way to describe behavior associated with types.

The proposed approach uses type classes and witness objects, building on familiar interfaces, fields, and methods. Goetz explores witness discovery, predictable resolution, and optimization, then applies the mechanism to those motivating examples. These are exploratory designs rather than promised features; richer generic libraries would also need to address the limitations of erasure.

Additional Resources