Primitives in Generics
Doug Lea
dl at cs.oswego.edu
Sat Jul 10 11:34:12 PDT 2010
On 07/09/10 15:38, Brian Goetz wrote:
>> My take is that you have three choices:
>> A) Support function types covering primitives
>> B) Support primitives in generics
>> C) Do something that doesn't restrict your options to reconsider
>> (A) or (B) in Java8 in response to all the complaints about
>> sucky parallel performance.
>
> Indeed so. We believe we have chosen (C). If we have not, please say something!
>
On only a little thought, I don't know the answer. If someone could
provide a rough sketch for how either of these (presumably only (B)?)
could be done in Java8 given the Java7 plans, it would be a big comfort.
For one example of a generics system that accommodates both A and B
see the X10 specs:
http://dist.codehaus.org/x10/documentation/languagespec/x10-latest.pdf
Scala also comes close with upcoming "specialize" directives. See
http://www.scala-lang.org/sites/default/files/sids/dragos/Mon,%202009-11-16,%2017:34/sid-spec.pdf
or maybe some more recent docs?
(Also, to some extent, C#.)
I worry a bit because (1) the base generic type systems for
both are fairly different than Javas and (2) both implementations
are still in pre-release mode running on JVMs.
-Doug
More information about the lambda-dev
mailing list