Re: Is V? what we need ?

2019-05-08 Thread Brian Goetz
> Here comes the parallel with Integer, the way we use Integer currently is, i > believe, the way we should use V*. It's fine to use V* as a type argument, > it's fine to use it in a field if you want the reference semantics or a null > value. It's not fine to use Integer as parameter of a

Re: Is V? what we need ?

2019-05-02 Thread forax
- Mail original - > De: "John Rose" > À: "Remi Forax" > Cc: "Brian Goetz" , "valhalla-spec-experts" > > Envoyé: Jeudi 2 Mai 2019 04:17:54 > Objet: Re: Is V? what we need ? > It looks like we're getting somewhere; t

Re: Is V? what we need ?

2019-05-02 Thread Maurizio Cimadamore
On 01/05/2019 20:34, Brian Goetz wrote: ne big difference between whether we convert V to V? via subsumption or via a boxing conversion is how overload selection is done.  But, if we have methods m(Object) and m(V?), and it is invoked with a v, in the subtyping case, we'll select m(Object),

Re: Is V? what we need ?

2019-05-01 Thread John Rose
It looks like we're getting somewhere; thanks for the detailed response. I have one targeted reply: On May 1, 2019, at 4:38 PM, fo...@univ-mlv.fr wrote: > > So let's call it V*. I want also make clear that there is no proposal to not > have a V*, we need it, and it's the L-version of an inline

Re: Is V? what we need ?

2019-05-01 Thread forax
- Mail original - > De: "John Rose" > À: "Brian Goetz" > Cc: "Remi Forax" , "valhalla-spec-experts" > > Envoyé: Jeudi 2 Mai 2019 00:55:19 > Objet: Re: Is V? what we need ? > On May 1, 2019, at 7:50 AM, Brian Goetz wrote: &

Re: Is V? what we need ?

2019-05-01 Thread John Rose
I buy your argument, Brian, for shedding boxes from the center of the user model for V and V?. Given that V and V? have different contracts (per my previous note), so that they can have different physical representations in the JVM, it turns out that this statement: V is a subtype of V? (for

Re: Is V? what we need ?

2019-05-01 Thread John Rose
On May 1, 2019, at 7:50 AM, Brian Goetz wrote: > >> I fully agree, it's like getting ride of Integer, it's a fantasy, but not >> having a lot of API taking a N? as parameter type make that fantasy actually >> possible for the libraries you care. > > We can’t get rid of Integer, but maybe we

Re: Is V? what we need ?

2019-05-01 Thread John Rose
On May 1, 2019, at 6:28 AM, Brian Goetz wrote: > > Also, we’re conflating two separate questions here. > > 1. What does V? mean. In the proposed world, it is the union type of V and > Null, nothing more (alternately: V adjoined with null.). > > 2. What is the relationship between V and

Re: Is V? what we need ?

2019-05-01 Thread Brian Goetz
However, I think my more general point remains - the fact that the VM has the flexibility to treat V and V? as, fundamentally, the same thing shouldn't necessarily drive the conclusion that, _at the language level_ there should be a subtyping relationship between V and V?. From a

Re: Is V? what we need ?

2019-05-01 Thread Maurizio Cimadamore
between the two, which means it would work on assignment context and method calls (albeit with lower priority w.r.t true subtypes, which is what we want anyway). Maurizio On 01/05/2019 13:57, Remi Forax wrote: Brian ask me to make it its own thread. so is V? what we need, because i believe we have

Re: Is V? what we need ?

2019-05-01 Thread Remi Forax
- Mail original - > De: "Brian Goetz" > À: "Doug Lea" > Cc: "valhalla-spec-experts" > Envoyé: Mercredi 1 Mai 2019 16:39:59 > Objet: Re: Is V? what we need ? > This is the point I’ve been failing to get across to Remi as well. Suppose

Re: Is V? what we need ?

2019-05-01 Thread Remi Forax
ec-experts" > Envoyé: Mercredi 1 Mai 2019 16:32:18 > Objet: Re: Is V? what we need ? > On 5/1/19 10:12 AM, Brian Goetz wrote: >> >> You’re assuming the utility of V? after reification is zero, but >> that’s not the case. For example, suppose ArrayList is

Re: Is V? what we need ?

2019-05-01 Thread Brian Goetz
> > I fully agree, it's like getting ride of Integer, it's a fantasy, but not > having a lot of API taking a N? as parameter type make that fantasy actually > possible for the libraries you care. We can’t get rid of Integer, but maybe we can make it 10x less important. That would be winning.

Re: Is V? what we need ?

2019-05-01 Thread forax
- Mail original - > De: "Brian Goetz" > À: "Remi Forax" > Cc: "Maurizio Cimadamore" , > "valhalla-spec-experts" > > Envoyé: Mercredi 1 Mai 2019 16:12:05 > Objet: Re: Is V? what we need ? >>> Boxes are not a good

Re: Is V? what we need ?

2019-05-01 Thread Brian Goetz
This is the point I’ve been failing to get across to Remi as well. Suppose you have a big value, and you want a sparse ArrayList of that value? You need a way to say “Arraylist of BigValue, but not flattened.” And that’s a use-site concern. ArrayList gives you that. Which is to say: the

Re: Is V? what we need ?

2019-05-01 Thread Doug Lea
On 5/1/19 10:12 AM, Brian Goetz wrote: > > You’re assuming the utility of V? after reification is zero, but > that’s not the case. For example, suppose ArrayList is reified. Then > the user gets the choice of erasure or reification by selecting > ArrayList or ArrayList. Erasure has a bad rap,

Re: Is V? what we need ?

2019-05-01 Thread forax
> De: "Brian Goetz" > À: "Remi Forax" > Cc: "valhalla-spec-experts" > Envoyé: Mercredi 1 Mai 2019 15:24:42 > Objet: Re: Is V? what we need ? >> a box is a necessary evil, everybody want to write an ArrayList but we >> are >>

Re: Is V? what we need ?

2019-05-01 Thread Brian Goetz
>> Boxes are not a good thing; they were a necessarily evil that arises from the >> fact that primitives are not objects. But they create many problems of their >> own. I don’t see how “more boxes” is the answer here. > > More boxes is a temporary answer until we have fully reified generics

Re: Is V? what we need ?

2019-05-01 Thread forax
- Mail original - > De: "Brian Goetz" > À: "Maurizio Cimadamore" > Cc: "Remi Forax" , "valhalla-spec-experts" > > Envoyé: Mercredi 1 Mai 2019 15:13:06 > Objet: Re: Is V? what we need ? > But, this is Q-world thinking. In

Re: Is V? what we need ?

2019-05-01 Thread Brian Goetz
Also, we’re conflating two separate questions here. 1. What does V? mean. In the proposed world, it is the union type of V and Null, nothing more (alternately: V adjoined with null.). 2. What is the relationship between V and V? — is it sub typing, or conversion? I think Remi is more

Re: Is V? what we need ?

2019-05-01 Thread Brian Goetz
> > a box is a necessary evil, everybody want to write an ArrayList but we > are not there yet, so we provide just the right abstraction to deal with > value type in generics, not more. I think this is where we part ways. In Java 1.0, with respect to primitives, a box was a necessary evil,

Re: Is V? what we need ?

2019-05-01 Thread forax
- Mail original - > De: "Brian Goetz" > À: "Remi Forax" > Cc: "valhalla-spec-experts" > Envoyé: Mercredi 1 Mai 2019 15:03:42 > Objet: Re: Is V? what we need ? >> we need V? >> - to represent the L variation of a Q

Re: Is V? what we need ?

2019-05-01 Thread Brian Goetz
ity w.r.t true subtypes, which is what we want anyway). > > Maurizio > > On 01/05/2019 13:57, Remi Forax wrote: >> Brian ask me to make it its own thread. >> so is V? what we need, because i believe we have been a little over our own >> head on this and loose the sigh

Re: Is V? what we need ?

2019-05-01 Thread Maurizio Cimadamore
(albeit with lower priority w.r.t  true subtypes, which is what we want anyway). Maurizio On 01/05/2019 13:57, Remi Forax wrote: Brian ask me to make it its own thread. so is V? what we need, because i believe we have been a little over our own head on this and loose the sight of what we need

Re: Is V? what we need ?

2019-05-01 Thread Brian Goetz
> we need V? > - to represent the L variation of a Q type. > - to interact with generics that are not reified. These are the proximate causes, but I think this undersells it. > V? does that but does far more, V? is a super type of V which is dangerous, > because people will use it as

Is V? what we need ?

2019-05-01 Thread Remi Forax
Brian ask me to make it its own thread. so is V? what we need, because i believe we have been a little over our own head on this and loose the sight of what we need for V?. we need V? - to represent the L variation of a Q type. - to interact with generics that are not reified. V? does