Jump to content

Kawa (Scheme implementation): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Version 2.4 (30 April 2017): https://www.gnu.org/software/kawa/news.html and https://ftp.gnu.org/gnu/kawa/
Kchanyr (talk | contribs)
Kawa v3 released
Line 9: Line 9:
| developer = The Kawa Community
| developer = The Kawa Community
| released = {{Start date and age|1998|02|09|df=yes}}
| released = {{Start date and age|1998|02|09|df=yes}}
| latest release version = 2.4
| latest release version = 3.0
| latest release date = {{Start date and age|2017|04|30|df=yes}} (w/[[Scheme (programming language)#R7RS|R7RS]] compatibility)
| latest release date = {{Start date and age|2017|08|02|df=yes}} (w/[[Scheme (programming language)#R7RS|R7RS]] compatibility)
| typing =
| typing =
| scope =
| scope =

Revision as of 18:40, 10 October 2017

Kawa
Designed byPer Bothner
DeveloperThe Kawa Community
First appeared9 February 1998; 26 years ago (1998-02-09)
Stable release
3.0 / 2 August 2017; 7 years ago (2017-08-02) (w/R7RS compatibility)
Implementation languageJava, Scheme
PlatformJava virtual machine
OSCross-platform
LicenseMIT
Websitewww.gnu.org/software/kawa

Kawa is a language framework written in the programming language Java that implements the programming language Scheme, a dialect of Lisp, and can be used to implement other languages to run on the Java virtual machine (JVM). It is a part of the GNU Project.

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 language Scheme, Java object fields and methods can be accessed using code such as:

(invoke object 'method argument ...)

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

An object's fields can be accessed with:

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

Static (class) methods can be invoked with the function invoke-static.

Kawa can be extended with Java code (by creating scheme functions in Java), and combined 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, the -C parameter is used:

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

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

See also