more background to List<int> specializing List<Any>

Stephen Colebourne scolebourne at joda.org
Sun Jan 4 23:00:33 UTC 2015


The specialization document include the phrase "If we were concerned
only about primitive instantiations, we could consider some sort of
"tagged fixnum" approach. However, this approach essentially reverts
to boxing for arbitrary value types, so it does not get us to our
goal."

Should we take that to indicate that if value types were taken out of
the picture, and the only goal was to handle the existing 8 primitive
types, that there might be a potentially simpler solution - one where
List<int> could be a sub-type of List<Integer> without boxing?

Stephen


On 4 January 2015 at 18:40, Brian Goetz <brian.goetz at oracle.com> wrote:
>> I know our focus in this current phase is on "Layers", but would like to
>> educate myself further about the general background of issues with Any.
>
>
> Let me correct slightly.  We're investigating "layers" or "conditional
> methods" not because this is the feature we went looking for, but because it
> is a possible and believed-practical answer to the more general question of
> "what generic type system can provide us the gradual migration compatibility
> we are looking for."
>
> This is not unlike what happened in 8; we didn't do default methods because
> we wanted multiple inheritance of behavior; we did it because we needed
> *interface evolution*, and of the dozen or so possible ways to get there
> that we evaluated, this one had the best combination of characteristics.
>
> So far we've gotten feedback that people don't like the balance of "user
> model weight" and "general utility" for layers (feedback received loud and
> clear, no need to reopen this.)
>
>
> More generally, I think there's a lot of tendency to assume here that these
> writeups constitute *decisions*, which they do not.  These writeups are
> snapshots of where our head is at this week, which we provide so people can
> get a peek about what we're thinking about.  But we're a long way from the
> end of this road.
>


More information about the valhalla-dev mailing list