C++ and Java CNI: Check Java references

Per Bothner per@bothner.com
Mon Apr 23 23:21:00 GMT 2001

Fergus Henderson <fjh@cs.mu.oz.au> writes:

> This could be a dumb question -- I've barely glanced at the libjava code --
> but what's the rationale for writing large chunks of it in C++ rather than
> Java?

Well, most of it is written in Java.  But we use C++ for two main reasons:
access to low-level APIs, and performance.  Sometimes C++ allows you to do
things you cannot conveniently or efficiently do in Java.  CLasspath had
the goal of trying to do as much as possible in Java rather than native code;
the use of CNI makes it convenient to use C++ when appropriate.
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

More information about the Java mailing list