Kawa
Encyclopedia
Kawa is a language framework
Software framework
In computer programming, a software framework is an abstraction in which software providing generic functionality can be selectively changed by user code, thus providing application specific software...

 written in Java that implements the programming language Scheme, and can be used to implement other languages. It is a part of the GNU Project
GNU Project
The GNU Project is a free software, mass collaboration project, announced on September 27, 1983, by Richard Stallman at MIT. It initiated GNU operating system development in January, 1984...

.

The name "Kawa" comes from the Polish word for coffee – a play on words, since Java is another familiar name for coffee.

Integration with Java

Besides using the scheme programming language, you can access Java object fields and methods, using code like this:

(invoke object 'method argument ...)

This will invoke a Java method, and does the same thing as object.method(argument, ...) in Java.

You can access an object's fields with:

object:field-name
or
(invoke object 'field)

You can also invoke static (class) methods with the function "invoke-static".

You can extend Kawa with Java code (creating scheme functions in Java), as well as combine Kawa with other JVM implementations.

How to use

To run kawa on GNU/Linux:

export CLASSPATH=$CLASSPATH:/path/to/kawa/kawa-1.10.jar
java kawa.repl

To compile a scheme file to a class file, use the -C parameter:

java kawa.repl --main -C file.scm

This will produce "file.class", which you can run by typing "java file.class". You can also create an applet or servlet (to compile a servlet you must also put "servlet-xxx.jar" in the CLASSPATH variable).

See also

  • Scheme
  • Java
    Java (programming language)
    Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities...

  • List of JVM languages
  • List of open-source programming languages
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK