FTR: JVM Lang Summit presentation

Remi Forax forax at
Sat Sep 20 08:35:58 UTC 2014

On 09/20/2014 12:06 AM, Paul Sandoz wrote:
> On Sep 18, 2014, at 11:20 AM, Remi Forax <forax at> wrote:
>> as i said earlier to John, we don't really need to have one code with multiple shapes,
>> here what we want is to have type specialization but we will not have it for 9 so
>> we can use overloads as we usually do to support strawman type specialization.
> Still it's somewhat awkward. Some methods like CAS can, as you say, be overloaded but get* methods that take only receiver arguments cannot leaving some methods postfixed with a differentiating string, such as the value type name, and others not.
> Paul.

from the API point of view, you can have only one abstract method, let 
say getOrdered(), and the BSM will wrire to the right implementation,
combined with target typing you can have:
   int i = handle.getOrdered(this);
   Complex c = handle.getOrdered(this);

I'm not sure that target typing is the right solution here, it's perhaps 
better to use a cast,
   int i = (int)handle.getOrdered(this);
   Complex c = (Complex)handle.getOrdered(this);
which is i think more readable.

Given that the API target people that want to use fine grained concurrency,
I don't thing adding a cast is a big deal here.


More information about the valhalla-dev mailing list