From owner-freebsd-java Wed Oct 4 15:55:14 2000 Delivered-To: freebsd-java@freebsd.org Received: from topperwein.dyndns.org (acs-24-154-28-99.zoominternet.net [24.154.28.99]) by hub.freebsd.org (Postfix) with ESMTP id 1955537B503 for ; Wed, 4 Oct 2000 15:55:11 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by topperwein.dyndns.org (8.11.0/8.11.0) with ESMTP id e94Msvk47005; Wed, 4 Oct 2000 18:54:57 -0400 (EDT) (envelope-from behanna@zbzoom.net) Date: Wed, 4 Oct 2000 18:54:57 -0400 (EDT) From: Chris BeHanna Reply-To: behanna@zbzoom.net To: Jay Sachs Cc: Greg Lewis , FreeBSD-Java Subject: Re: Sun Keynote at JavaCon2000 - C++ templates In-Reply-To: <39DBA3DF.427E0BF0@avacet.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-java@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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