Is the modeling of types via the “sealed” keyword really a “sum type”? (I don't know much about this, but I think it's very different from the rust implementation, and the c# draft implementation feels much closer.)
Yes, it is proper algebraic data types. One half is product types (records), and the other half is sealed classes and interfaces.
They have a long history going back to at least the ML language (like 2 or so decades before rust), and the name comes from the fact that sum types behave in a way that for each "variant" type, the total number of instances that resulting type can have is their sum, while it is a product in case of records.
166
u/NotABot1235 Mar 18 '25 edited Mar 18 '25
New features include the following:
404: Generational Shenandoah (Experimental)
450: Compact Object Headers (Experimental)
472: Prepare to Restrict the Use of JNI
475: Late Barrier Expansion for G1
478: Key Derivation Function API (Preview)
479: Remove the Windows 32-bit x86 Port
483: Ahead-of-Time Class Loading & Linking
484: Class-File API
485: Stream Gatherers
486: Permanently Disable the Security Manager
487: Scoped Values (Fourth Preview)
488: Primitive Types in Patterns, instanceof, and switch (Second Preview)
489: Vector API (Ninth Incubator)
490: ZGC: Remove the Non-Generational Mode
491: Synchronize Virtual Threads without Pinning
492: Flexible Constructor Bodies (Third Preview)
493: Linking Run-Time Images without JMODs
494: Module Import Declarations (Second Preview)
495: Simple Source Files and Instance Main Methods (Fourth Preview)
496: Quantum-Resistant Module-Lattice-Based Key Encapsulation Mechanism
497: Quantum-Resistant Module-Lattice-Based Digital Signature Algorithm
498: Warn upon Use of Memory-Access Methods in sun.misc.Unsafe
499: Structured Concurrency (Fourth Preview)
501: Deprecate the 32-bit x86 Port for Removal
https://jdk.java.net/24/
JDK 25 will be the next LTS and release in 6 months.