EnumeratedStream
ІП-24 Олександр Ротань
rotan.olexandr at gmail.com
Sun Apr 21 13:48:31 UTC 2024
I am not really familiar with goals and milestones of Valhalla project, but
what I meant by simplification is that there would not be any more need to
convert to promotove streams explicitly as Stream<primitive> would be a
thing. If that's what Valhalla is working on, then this would be just
great. Performance concerns regarding wrappers are also valid , but here
I am talking about implementation complexity.
If going little off topic, compiling many classes to achieve generic
reification in fact looks odd, but it in fact provides best developer
experience, Converting primitive arrays to collections is one of the
examples of major problems issues with it, along with some methods of
Arrays class (like sort, if I am not mistaken), just don't work with
primitives.Approach that is used in C#, while has its downsides, provides
much better user experience. However, what I am looking into right now is
some hybrid form of generic handling, where generic maybe be reified on
demand of developer (or implicitly if primitive is used). I am working on
some prototypes at the moment
вс, 21 апр. 2024 г. в 16:31, - <liangchenblue at gmail.com>:
> On Sun, Apr 21, 2024 at 5:49 AM ІП-24 Олександр Ротань <
> rotan.olexandr at gmail.com> wrote:
>
>> I have heard your proposal. Your approach indeed for sure has its
>> advantages.
>>
>> One thing I don't like referring to is Valhalla. It's not even a
>> preview and no one really knows when it will be, relying on it when
>> designing API now would be strange to say the least.
>>
> Valhalla's value classes are actually quite ready; the compatibility and
> the type system are quite fleshed out in the recent iterations, and the
> prototypes are already functional.
>
>>
>> One possible thing that could dramatically simplify implementation of my
>> approach is introduction of generic reification, which would allow
>> primitives as type params. I am currently studying the working of javac and
>> possible implementation of this is one of the topics in my research.
>> However, let's stick to what we have in jdk right now from now on.
>>
> Generic reification is part of project Valhalla too, in that it allows
> wrapper classes in generics to have the same performance as the primitives
> with generic specialization. Compiling many classes to achieve generic
> reification is an alternative, but I don't think it's feasible.
>
>>
>> I would like to hear opinions of other people regarding the design of
>> such API, especially David and Remi, since, as I understand, that's not the
>> first time they witness a discussion like this, so maybe they have
>> something to tell here.
>>
> Unfortunately you will have to wait. Most JDK engineers are employees who
> work on weekdays; only a few are enthusiasts. I think we may get more
> discussion traffic on Monday.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/core-libs-dev/attachments/20240421/9082eee0/attachment-0001.htm>
More information about the core-libs-dev
mailing list