<div dir="ltr">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.<div><br></div><div>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</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">вс, 21 апр. 2024 г. в 16:31, - <<a href="mailto:liangchenblue@gmail.com">liangchenblue@gmail.com</a>>:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"></div><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Apr 21, 2024 at 5:49 AM ІП-24 Олександр Ротань <<a href="mailto:rotan.olexandr@gmail.com" target="_blank">rotan.olexandr@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I have heard your proposal. Your approach indeed for sure has its advantages.<div><br></div><div>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.</div></div></blockquote><div>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.</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>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.</div></div></blockquote><div>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. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><br></div><div>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.</div></div></blockquote><div>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. </div></div></div>
</blockquote></div>