rds :: graphikos

[ home | photos | gallery | scheme | notes | blog | facebook | twitter | youtube | last.fm | myspace | del.icio.us | EverythingHerePlus ]

Kawa Scheme System on Macintosh OSX

Also on This Site
Kawa and Kawa-Mac Resources
Kawa Scheme System on Macintosh OS X Current
Kawa Scheme System on Macintosh OS X 10.1
Kawa Scheme System on Macintosh OS Classic
Kawa Notes, Downloads, Caveats
Running Kawa in Emacs

Mac OS X Instructions

Per Bothner's Kawa Scheme: a Scheme interpreter written in the Java with bindings to the Java language. The system allows compilation of Scheme code directly to Java Bytecodes. Since Mac OS X is essentially a Unix-like system, this document will not duplicate the instructions in the Kawa Manual.

Contents
Software Requirements
Building, Installation and Runtime
Runtime Thread Local Eden
Jar Bundler
Emacs
References

Software Requirements

All versions listed are current of this sections's last revision on 11/28/2003.

Apple Java software
Mac OS X with the BSD Subsystem installed.
Mac OS X Developer Tools from CDROM or join the free ADC Online program to download.
Kawa Java software
See Getting Kawa page for instructions on getting Kawa, and the various distribution methods.

Building, Installation and Runtime

Configure and Make

To see a listing of all the flags available at configure, type ./configure --help | less at the prompt. If you are using the binary distribution see the instructions Installing and using the binary distribution. The Kawa Manual sections Building and installing Kawa contains full instructions. Here are some examples:

./configure --with-swing
	# base kawa with swing, recommended and needed for GUI use
./configure --with-swing --with-java-collections
	# another example, type ./configure --help to see a full list of configure options
./configure --prefix=/Users/Shared --with-swing --with-java-collections --enable-xml --enable-servlet
	# includes servlet supports see Including Servlet Support for information. Prefix is for alternate installation paths.

Type make at the prompt to make.

Installation

If you are using the binary distribution see the instructions Installing and using the binary distribution. After make finishes, it is strongly recommended that you run the testsuite (cd testsuite; make check). Kawa uses an elegant installation scheme in the /usr/local/ path. You must be root or a 'sudoer' to evoke make install, if this is not feasible (ie. user account), then use the Installing and using the binary distribution instructions, substituting the appropriate kawa-x.x.xx.jar file name from the kawa build directory into the CLASSPATH. Another work around is to use alternate installation paths, and supply the correct path for --prefix at configure.

Runtime

See the instructions How to start up and run Kawa. Mac OS X 10.3 and later include both Java 1.3.1 and 1.4.1, the later being the default and preferred. You can change this if necessary, type java -help at the prompt for information.

Kawa can take a wide variety of command line flags. Here are two quick examples (with kawa default installation in /usr/local/):

rds% kawa -e "(display (scheme-implementation-version))(newline)"
1.7.90
	# print kawa version on the terminal
 rds% kawa -w &
	# Running a Command Interpreter in a new Window

Runtime Thread Local Eden

Apple's thread local eden maps Java threads to native Mach threads. In theory this should make things faster. Since it requires Java to be called with the option, the standard 'kawa' script will not do. This might be solved with setting JAVAOPTS, but I call it directly. Here is an example session with the local paths I use with an example of calling native Apple classes.
rds% java -XX:+UseTLE -jar /Users/Shared/share/java/kawa.jar --full-tailcalls
#|kawa:1|# (define-namespace afm "class:com.apple.eio.FileManager")
#|kawa:2|# (afm:openURL "http://www.apple.com") ; opens URI in default W3 client
#|kawa:3|# (exit)

Jar Bundler

Jar Bundler comes with the Mac OS X 10.2 and later Developer Tools is well documented in both its online help and Apple's site. It is useful for creating stand alone application versions of Kawa.

Emacs

Emacs provides another way to interact with Kawa under Unix-like systems. This is documented at Running Kawa Scheme under Emacs.

References

Kawa, the Java-based Scheme system