From daniel.smith at oracle.com Tue Feb 9 22:19:04 2021 From: daniel.smith at oracle.com (Dan Smith) Date: Tue, 9 Feb 2021 22:19:04 +0000 Subject: Draft JEPs for primitive class features Message-ID: I've drafted the following JEPs to cover the initial preview of the Valhalla project's core features: --- Primitive Objects (Preview) https://bugs.openjdk.java.net/browse/JDK-8251554 Describes primitive objects and classes, and the language's use of reference and value types. --- Unify the Basic Primitives with Objects (Preview) https://bugs.openjdk.java.net/browse/JDK-8259731 Describes language and library changes to treat the basic primitives (int, double, etc.) as special primitive class types, replacing boxing/unboxing with standard reference/value conversions. --- Please look them over and make sure they reflect your understanding of the features. Most of this has been discussed previously, but these are the most comprehensive summaries of the feature set that we've put together. (And quite possibly some of it is new to you, or I left something important out!) There will be a third major component, Universal Type Variables, to cover the interaction of erased generics with primitive value types. I'm working on that one currently. My intent is to submit all three to become Candidate JEPs in the near future, and then we'll pursue the formal specification, implementation, and review processes in parallel over the coming months. These are preview features that will probably be delivered all together when they're ready, no earlier than 18. From sirinath1978m at gmail.com Wed Feb 10 06:08:20 2021 From: sirinath1978m at gmail.com (Suminda Sirinath Salpitikorala Dharmasena) Date: Wed, 10 Feb 2021 11:38:20 +0530 Subject: Draft JEPs for primitive class features In-Reply-To: References: Message-ID: Hello, Very much looking forward to the day this is in Java. When designing the primitives it would be good to have an equivalent of java.lang.Number in the type hierarchy so these can be used in generics. And possibly a marker interface to distinguish between Floating point and Integer type numbers for the benefit of generics and generalisation. - Marker Interfaces - NumberType - IntegerType <: NumberType - FloatingPoint <: NumberType In https://bugs.openjdk.java.net/browse/JDK-8251554 you mention. > Array types are also subtypes of IdentityObject. I would very much like if Arrays are both a primitive object and identity object. When it comes to small arrays it is helpful in some cases if they are primitive objects so there is no pointer referencing to get to the array. Also the current type hierarchy regarding arrays is inadequate and when different types of arrays are needed one needs to resort to use Object. To make it easier to use with generics and generalisation, please consider introducing marker interfaces. Maybe one can introduce an Array marker interface which represents all arrays. - Marker Interfaces - Array - NumberTypeArray <: Array - IntegerTypeArray <: NumberTypeArray - FloatingPointArray <: NumberTypeArray - Array Objects - IdentityObject & Array - IdentityObject & Array - PrimitiveObject & Array - PrimitiveObject & Array - IdentityObject & IntegerTypeArray // & Array & NumberTypeArray - IdentityObject & IntegerTypeArray // & Array & NumberTypeArray - PrimitiveObject & IntegerTypeArray // & Array & NumberTypeArray - PrimitiveObject & IntegerTypeArray // & Array & NumberTypeArray - IdentityObject & FloatingPointArray // & Array & NumberTypeArray - IdentityObject & FloatingPointArray // & Array & NumberTypeArray - PrimitiveObject & FloatingPointArray // & Array & NumberTypeArray - PrimitiveObject & FloatingPointArray // & Array & NumberTypeArray Covariance and contravariance is achieved w.r.t the markers. User defined value types and their respective arrays can have their own markers. Suminda On Wed, 10 Feb 2021 at 03:49, Dan Smith wrote: > I've drafted the following JEPs to cover the initial preview of the > Valhalla project's core features: > > --- > > Primitive Objects (Preview) > https://bugs.openjdk.java.net/browse/JDK-8251554 > > Describes primitive objects and classes, and the language's use of > reference and value types. > > --- > > Unify the Basic Primitives with Objects (Preview) > https://bugs.openjdk.java.net/browse/JDK-8259731 > > Describes language and library changes to treat the basic primitives (int, > double, etc.) as special primitive class types, replacing boxing/unboxing > with standard reference/value conversions. > > --- > > Please look them over and make sure they reflect your understanding of the > features. Most of this has been discussed previously, but these are the > most comprehensive summaries of the feature set that we've put together. > (And quite possibly some of it is new to you, or I left something important > out!) > > There will be a third major component, Universal Type Variables, to cover > the interaction of erased generics with primitive value types. I'm working > on that one currently. > > My intent is to submit all three to become Candidate JEPs in the near > future, and then we'll pursue the formal specification, implementation, and > review processes in parallel over the coming months. These are preview > features that will probably be delivered all together when they're ready, > no earlier than 18. > > From daniel.smith at oracle.com Wed Feb 10 07:23:01 2021 From: daniel.smith at oracle.com (Dan Smith) Date: Wed, 10 Feb 2021 07:23:01 +0000 Subject: EG meeting, 2020-02-10 Message-ID: The next EG Zoom meeting is Wednesday at 5pm UTC (9am PDT, 12pm EDT). I've sent links to JEP drafts for some of the major Valhalla components. We can discuss them. There hasn't been much lead time, but please take a couple of minutes to look them over. More detailed followups can occur over email or at the Feb 24 meeting. From sirinath1978m at gmail.com Wed Feb 10 07:25:17 2021 From: sirinath1978m at gmail.com (Suminda Sirinath Salpitikorala Dharmasena) Date: Wed, 10 Feb 2021 12:55:17 +0530 Subject: Draft JEPs for primitive class features In-Reply-To: References: Message-ID: Perhaps another marker to add is Signed <: IntegerType with a view to add unsigned later. With possibility of enhanced arrays like [] x or MyClass & MyInterface x[]. This way arrays need not have own markers. But still reference and value arrays are desirable to control layout of data. From daniel.smith at oracle.com Wed Feb 24 01:47:24 2021 From: daniel.smith at oracle.com (Dan Smith) Date: Wed, 24 Feb 2021 01:47:24 +0000 Subject: EG meeting *canceled*, 2020-02-24 Message-ID: <09176315-7BCB-4F3F-8C9D-C559E3413C7A@oracle.com> Nothing new, let's skip Wednesday's scheduled meeting.