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: Guile API's (Re: About modules)


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

> How does the evaluator look like in Kawa?  I guess that all scheme
> types are modelled as java classes,

Not quite, but close enough for this discussion.

> and every class object has the knowledge
> how to evaluate itself, yes?

No.  Kawa is compiler-based.  The first thing is does with a Scheme
<expression> is to translate it to a Java Expression type.  This stage
does macro expansion, and handles lexical scoping.  For example (if
...) and (cond ...) are both translated to instances of IfExp, which
inherits from Expression.  Every Expression class has an eval method
that evaluates itself.  However, evaluating an expresion is only supported
for "simple" expressions, such as procedure application; others signal
an error.  More complex Expressions are handled by the compiler, for
consistency.  So the real truth is that all Expressions know how to
compile themselves into sequences of Java bytecode instructions.

See the first paper mentioned at http://sourceware.cygnus.com/kawa/papers/ .
It is slightly out of date, mainly in how procedures are
represented, and doesn't mention some newer features, but gives a
decent overview of how Kawa works.
-- 
	--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]