Per Bothner
Cygnus Solutions
1325 Chesapeake Terrace
Sunnyvale CA 94089, USA
<bothner@cygnus.com>
Kawa is a set of Java classes useful for implementing dynamic languages, such as those in the Lisp family. Kawa is also an implementation of near-R5RS Scheme using these classes, and which compiles Scheme to the bytecode instructions of the Java Virtual Machine. This paper discusses the various issues involved in implementing Scheme using an abstract machine designed for a very different language. and how Kawa solves these problems.
The Kawa home page is http://www.cygnus.com/~bothner/kawa.html.
An earlier version of this paper was presented at Usenix in June 1998.
While Java is a decent programming language, the reason for the “Java explosion” is largely due to the Java Virtual Machine. The JVM allows programs to be distributed easily and efficiently in the form of portable bytecodes, which can run on a wide variety of architectures and in web browsers. These advantages are largely independent of the Java language, which is why there have been a number of efforts to run other languages on the JVM, even though the JVM is very clearly designed and optimized for Java. Kawa is both a toolkit for compiling other languages into Java bytecodes, and an implementation of the Scheme language implemented in Java.
The benefits of this hybrid Scheme/Java environment include:
Provides a higher-level, more dynamic programming interface than Java, with support for “scripting” and interactive read-eval-print loops.
Extends the Java benefits of "write once run anywhere" to Scheme programs, including portable bytecode distribution and web applets, though the use of standard Java bytecodes.
Full integration between Java and Scheme: Scheme programs can call Java methods, and Java methods can all Scheme procedures.
Scheme programs benefit from the extensive efforts in improved Java implementations, optimizations, environments, and tools.
Scheme programs get access to the large library of standard Java classes.
Kawa is intended to be a multi-langauge implementation toolkit. While only Scheme is currently supported, an implementation of ECMAScript (JavaScript) is coming along. Emacs Lisp is also planned.
(Note that Kawa is also the name of an unrelated commercial Java development environment.)
| Next | ||
| History |