Date: Wed, 4 Oct 2000 18:54:57 -0400 (EDT) From: Chris BeHanna <behanna@zbzoom.net> To: Jay Sachs <jay@avacet.com> Cc: Greg Lewis <glewis@trc.adelaide.edu.au>, FreeBSD-Java <java@FreeBSD.ORG> Subject: Re: Sun Keynote at JavaCon2000 - C++ templates Message-ID: <Pine.BSF.4.21.0010041851030.46992-100000@topperwein.dyndns.org> In-Reply-To: <39DBA3DF.427E0BF0@avacet.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 4 Oct 2000, Jay Sachs wrote:
> Greg Lewis wrote:
> >
> > Chris BeHanna wrote:
> > > On Wed, 4 Oct 2000, Rob Furphy wrote:
> > >
> > > > I'm curious, what is it about C++ style templates that you feel will
> > > > be good for java?
> > > > (Anyone?)
> > >
> > > Type-safe collections, allowing compile-time type-checking. In
> > > large C++ systems, huge numbers of potential errors are caught this
> > > way. Better 100 compile-time errors than a single run-time
> > > error--*especially* if that error is discovered after deployment!
> > >
> > > There are other uses; e.g., generic algorithms implemented in
> > > template classes that again offer compile-time type checking, thereby
> > > reducing the number of run-time type errors that you'd have to track
> > > down.
> >
> > What he said :). Yay! I have definitely missed this feature in Java.
> >
> > Not only do you get the much improved compile time type safety Chris has
> > mentioned above, there are also potential performance benefits.
>
> Unfortunately, these performance benefits won't be realized because of
> the need to maintain compatibility at the JVM level. If you look at GJ
> (nee Pizza I think), the GJ compiler still needs to insert all sorts of
> casts that it knows will succeed.
GJ is a prototype proof-of-concept, not a product-quality
offering.
JVM compatibility is explicitly *NOT* a requirement listed in the
JSR, precisely for this reason. At least, that is to say that .class
files made with an earlier javac are not required to run on a
template-enabled JVM. Source-code backward compatibility is a requirement,
however.
Hearken back:
In the beginning, there was cfront, and yea, verily, it had its
limitations. Time passed, and very good "real" C++ compilers evolved.
I would not expect anything different from GJ and javac.
--
Chris BeHanna
Software Engineer (at yourfit.com)
behanna@zbzoom.net
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0010041851030.46992-100000>
