This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: librep's indirect threaded bytecode interpretter


Jost Boekemeier <jostobfe@calvados.zrz.TU-Berlin.DE> writes:

> Per Bothner <per@bothner.com> writes:
> 
> > Java bytecodes are admittedly far from optimal for Scheme.  The point
> > about using Java bytecodes is to benefit from all the engineering and
> > research that people are putting into *fast* interpreters, such as
> > Just-in-Time compilers, as well as all the other Java-related tools
> > and engineering.
> 
> I think this is a very important point.  But do we have any *free*
> Java bytecode interpreters?  And if so, how fast are they (how fast is
> the byte code that Kawa produces?); what about memory consumption,
> "startup time" (time the VM needs to initialize) etc.

There are many free bytecode interpreters, at least two of which
incorprate Just-in-Time compilers (Kaffe and Jikes), some
ahead-of-time compilers (gcj), etc.

Writing a simple compact interpreter is straight-forward.

Using a pre-compiler like gcj to pre-compile the standard classes
(including the standard Scheme functions) produces fast start-up.

The point is that there are a number of choices, with different
characteristics.

> Hmm, "Guile" is an "extension language" for programs written in C.  I
> don't think this is possible with Kawa, is it?---Yes, I know that
> there are "bridging technologies" like Corba, but still Kawa and Guile
> belong to two different domains.

The more relevant briding technlogy is JNI - Java Native Interface,
which is a "foreign function call" standard for writing Java
methods in C or C++.  (Gcj has in addition gcj, an alternative
interface that is more convenient and efficient but less
portable than JNI.)  JNI has an "invocation interface" which
lets you start up a Java environment in an existing C thread.

So I don't think there is any particular reason why you can't
put a modest-sized Java environment into a library which you
can link into C applications.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]