"Model 2" prototype status
Brian Goetz
brian.goetz at oracle.com
Tue Aug 4 20:42:51 UTC 2015
> This all sounds pretty encouraging so far to me. I feel like all my major tick boxes are being steadily, if tentatively, filled. Thanks for the update!
Thanks! Some boxes ticked, many more boxes to go...
> I suppose this must mean there is a realistic possibility that will
> /not/ in fact be meaningful, which is a surprise to me... Is this
> something that has been discussed in more depth and I missed it? If
> anyone could expand on this a little (preferably to give a little
> reassurance that I'm overreacting to the importance, or that the chances
> are low for this to end up being the case!) I'd be pretty relieved. It
> feels like it'd be a pretty huge blow, and given my (limited)
> understanding I can't see what particularly troublesome issues this even
> presents.
Martijn is exactly right; we have to be very conservative about what we
commit to, and want to wait to work through the issues. Almost nothing
is trivial; it is a frequent occurrence that something starts out
looking like "couldn't possibly be troublesome" and then surprising
trouble ensues. Often, we end up with conflicts between multiple softer
goals, so by framing them as soft goals rather than assuming they are a
done deal, we are more likely to avoid "boxing" ourselves into a corner.
We're on board with the idea that having values implement interfaces
seems desirable. So don't worry about that.
But, what does the implementation look like, and how do we balance the
various goals? As one example of the kind of thing we've yet to fully
evaluate...
One goal is that values should be dense and flat, meaning no extraneous
storage overhead (like headers). If a value has no header, as we'd like
it, what happens here:
value class Moo implements Comparable { }
Moo m = ...
Comparable c = m;
The most obvious answer is "boxing". (And such boxes have a better
chance of being eliminated via escape analysis than existing boxes, as
they can be "heisenboxes" -- tagged as being identity-hostile and
therefore freely unboxed/reboxed.) Maybe this answer is OK, but maybe
this is still too much of an attractive nuisance.
Anyway, this stuff is all swapped out right now, as we've been focusing
quite heavily on the translation aspects of wildcards and specialized
generic methods, so we'll return to this topic later. Further updates
to come....
More information about the valhalla-dev
mailing list