~/talk

Operator Overloading with Type Classes

Talkat JavaOne 2026 · 2026-03-17..03-19· [java]
name:Joe Darcy
github:jddarcy
slides:none on file

Project Valhalla prototypes add limited operator overloading for value classes using a invoke dynamic prototype that maps operator tokens to static methods via a witness field mapping. JDK 28 EA already contains value-type previews; type classes require value classes (BigInteger is excluded because it’s nonfinal). The design bundles operators (add/sub/mul/div, comparisons) and plans automatic conversions next. Runtime uses JVM inlining and JIT to remove indirection so performance approaches primitive speed despite bytecode opcode limits.

AI-written summary · about

  1. 0:00Intro
  2. 1:25What is a Number?
  3. 5:10Type Classes
  4. 9:37Groups and Other Math
  5. 13:14Floating Point Numbers
  6. 16:35Type Class Mechanics & Performance
  7. 26:07Lumping vs Splitting Operations
  8. 33:28Neutral Elements
  9. 35:54Next Steps
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.