Kava for GCJ?

C. van Reeuwijk C.vanReeuwijk@its.tudelft.nl
Fri Jul 4 20:09:00 GMT 2003


> If we come up with and implement a design, we should perhaps
> propose it as a JSR. (I've suggested something similar to some
> Sun people last year, and they agree with the concept.)

You may be interested in a paper I wrote on a related approach:
 C. van Reeuwijk and H.J. Sips, Adding Tuples to Java: a Study in
 Lightweight Data Structures, in: Proc. of the Java Grande/ISCOPE
 2002 Conference, pp. 185-191, Seattle, USA, November 2002.
It can be downloaded from my publications webpage:
 <http://www.pds.twi.tudelft.nl/~reeuwijk/publications/index.html>
It discusses a lot of related work, including David Bacon's approach,
a proposal made by James Gosling himself, and of course my own approach:
using tuples as by-value containers.
You may also be interested in the benchmark results: at least for the
benchmarks I've run, by-value classes (and tuples) can significantly
reduce execution times and garbage.
However, if minimal intrusiveness is the goal, why not do fully automatic
unboxing? Instead of annotating a class as 'by value', and placing
restrictions on it, why not let the compiler itself discover classes
with these restrictions? Your annotation has only two advantages: (a)
it allows the user to weed out candidate classes for which unboxing
is not profitable, and (b) it allows the compiler to complain about
annotated classes that violate the necessary restrictions.
Item (b) is useful, but of course only if the compiler generates the
warnings. I suspect (a) is not a big advantage, since the compiler may
well able to decide on its own.
-- 
Kees van Reeuwijk, Delft University of Technology
http://www.pds.twi.tudelft.nl/~reeuwijk


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /