Finding the spirit of L-World

2019-01-07 Thread Brian Goetz
design — which is a model I think users can love, but requires us to go a little farther in what the VM does to support it. # Finding the Spirit of L-world L-World is, at heart, an attempt to unify reference objects and values; they're unified under a common top type (`Object`), a common

Re: Finding the spirit of L-World

2019-01-08 Thread Remi Forax
- Mail original - > De: "Brian Goetz" > À: "valhalla-spec-experts" > Envoyé: Lundi 7 Janvier 2019 18:21:26 > Objet: Finding the spirit of L-World > I’ve been processing the discussions at the Burlington meeting. While I think > we made a lot o

Re: Finding the spirit of L-World

2019-01-08 Thread Remi Forax
that a field typed as a L-type is not in fact a Q-type (or an array of L-type is not in fact an array of Q-type). Rémi - Mail original - > De: "Brian Goetz" > À: "valhalla-spec-experts" > Envoyé: Lundi 7 Janvier 2019 18:21:26 > Objet: Finding the spir

Re: Finding the spirit of L-World

2019-01-08 Thread Brian Goetz
Introducing a ValObject as super or having the ACC_VALUE bit are two representation of the same thing for the VM. In both case, we need to load the class to know if it's a value type or not, and in Java, the class loading is delayed which works well for reference type but not well for value

Re: Finding the spirit of L-World

2019-01-08 Thread forax
- Mail original - > De: "Brian Goetz" > À: "Remi Forax" > Cc: "valhalla-spec-experts" > Envoyé: Mardi 8 Janvier 2019 14:03:18 > Objet: Re: Finding the spirit of L-World >> Introducing a ValObject as super or having the ACC_VALUE bit

Re: Finding the spirit of L-World

2019-01-08 Thread Brian Goetz
On 1/8/2019 11:20 AM, fo...@univ-mlv.fr wrote: Right.  And I'm saying, we can't sell that.  Values should work like an int; you can compare ints with ==.   I think the "Currently" story doesn't wash. You can not use the "work like an int" argument here, a value type can contain references, so

Re: Finding the spirit of L-World

2019-01-08 Thread forax
> De: "Brian Goetz" > À: "Remi Forax" > Cc: "valhalla-spec-experts" > Envoyé: Mardi 8 Janvier 2019 18:44:11 > Objet: Re: Finding the spirit of L-World > On 1/8/2019 11:20 AM, [ mailto:fo...@univ-mlv.fr | fo...@univ-mlv.fr ] wrote: >>> R

Re: Finding the spirit of L-World

2019-01-23 Thread Daniel Heidinga
Thanks for writing this up Brian.  It clearly lists a number of the problematic areas that were identified as potentially needing re-validation.   The key questions are around the mental model of what we're trying to accomplish and how to make it easy (easier?) for users to migrate to use value typ

Re: Finding the spirit of L-World

2019-01-23 Thread Brian Goetz
> The key questions are around the mental model of what we're trying to > accomplish and how to make it easy (easier?) for users to migrate to use > value types or handle when their pre-value code is passed a valuetype. > There's a cost for some group of users regardless of how we address each

Re: Finding the spirit of L-World

2019-02-21 Thread Brian Goetz
More on substitutibility and why this it is desirable... Equality Now we need to define equality. The terminology is messy, as so many of the terms we might want to use (object, value, instance) already have associations. For now, we'll describe a _substitutability_ predicate on two insta

Re: Finding the spirit of L-World

2019-02-22 Thread Brian Goetz
Thanks for bringing up .equals, and the possibility to ban == on values, both of which have been touched on in the past but we've not really focused much on these.  It also helped me clarify why I think there's really only one answer here. As to equals(), having == be a substitutability test d

Re: Finding the spirit of L-World

2019-02-22 Thread Brian Goetz
Forgot to comment on this: And that means that equals() has become the substitutability test that people WANT. I agree with this completely.  But, where I think I disagree (and this is often the place where you and I reach for different tools) is that I don't want to use the language spec t

Re: Finding the spirit of L-World

2019-02-22 Thread John Rose
On Feb 22, 2019, at 2:04 PM, Brian Goetz wrote: > I want to have the language spec assign it a clear, precise, sound, > principled meaning +100 > most of these LIFE instances should, eventually, be replaced by plain old > `x.equals(y)`. FWIW, in some cases where y is a constant, the compar

Re: Finding the spirit of L-World

2019-02-22 Thread John Rose
On Feb 22, 2019, at 11:42 AM, Kevin Bourrillion wrote: > > I think we should make users write `equals` to test value types. If they > write `==`, they are indicating a special situation where they need identity > semantics, which don't make sense for value types, and that should be an > error.

Re: Finding the spirit of L-World

2019-02-22 Thread John Rose
On Feb 22, 2019, at 6:57 PM, John Rose wrote: > > On Feb 22, 2019, at 11:42 AM, Kevin Bourrillion wrote: >> >> I think we should make users write `equals` to test value types. If they >> write `==`, they are indicating a special situation where they need identity >> semantics, which don't mak

Re: Finding the spirit of L-World

2019-02-22 Thread John Rose
On Jan 23, 2019, at 9:51 AM, Brian Goetz wrote: > >> Because values have no identity, in LW1 `System::identityHashCode` >> throws `UnsupportedOperationException`. However, this is >> unnecessarily harsh; for values, `identityHashCode` could simply >> return `hashCode`. This would enable classes

Re: Finding the spirit of L-World

2019-02-23 Thread Remi Forax
- Mail original - > De: "John Rose" > À: "Kevin Bourrillion" > Cc: "valhalla-spec-experts" > Envoyé: Samedi 23 Février 2019 03:57:56 > Objet: Re: Finding the spirit of L-World > On Feb 22, 2019, at 11:42 AM, Kevin Bourrillion wrote: &

Re: Finding the spirit of L-World

2019-02-23 Thread Remi Forax
- Mail original - > De: "John Rose" > À: "Kevin Bourrillion" > Cc: "valhalla-spec-experts" > Envoyé: Samedi 23 Février 2019 04:02:15 > Objet: Re: Finding the spirit of L-World > On Feb 22, 2019, at 6:57 PM, John Rose wrote: >&g

Re: Finding the spirit of L-World

2019-02-23 Thread John Rose
On Feb 23, 2019, at 3:25 AM, Remi Forax wrote: > > This remember me another issue, we are discussing a lot about Java the > language but that's not the only language that run on the JVM, by making acmp > be an equivalent of substituableEquals() we are making a choice of semantics > that may be

Re: Finding the spirit of L-World

2019-02-28 Thread Brian Goetz
> class Object { ... } > class RefObject extends Object { ... } > class ValObject extends Object { ... } Let’s talk about this one some more. There are some obvious practical benefits of bringing these key concepts into the type system. The first is that talking about ref vs value can be done

Re: Finding the spirit of L-World

2019-02-28 Thread Remi Forax
> De: "Brian Goetz" > À: "valhalla-spec-experts" > Envoyé: Jeudi 28 Février 2019 18:17:43 > Objet: Re: Finding the spirit of L-World >> class Object { ... } >> class RefObject extends Object { ... } >> class ValObject extends Object { ... } >

Re: Finding the spirit of L-World

2019-02-28 Thread Brian Goetz
> the example from John, > Object o = new Object(); > o instanceof RefObject One way to fix this is: have `new Object` instantiate not an Object, but a RefObject. (This sort of recognizes that Object is half interface, half class.) The weird part is that then “new Object().getClass() != Obj

Re: Finding the spirit of L-World

2019-02-28 Thread John Rose
On Feb 28, 2019, at 10:13 AM, Brian Goetz wrote: > >> the example from John, >> Object o = new Object(); >> o instanceof RefObject > > One way to fix this is: have `new Object` instantiate not an Object, but a > RefObject. (This sort of recognizes that Object is half interface, half > cla

Re: Finding the spirit of L-World

2019-02-28 Thread Brian Goetz
One way to fix that and other reflective artifacts, is to piggy-back on specialized generics and their refined type system. In the spirit of brainstorming, let's pull on that string a bit. We could declare that `RefObject` is a *species* of `Object`, not a subclass. Then, `Object` is reveale