ABCL

Armed Bear Common Lisp (aka ABCL) is a Common Lisp implementation that runs on a Java Virtual Machine. It includes a compiler to Java bytecodes, and allows access to Java libraries from Common Lisp.

Armed Bear Common Lisp is distributed under the GNU GPL with Classpath exception. It was originally created as a component of the Armed Bear J editor, where it serves as an extension language (rather like Emacs Lisp for Emacs). It is now maintained as a standalone implementation.

ABCL runs quite well with SLIME, which allows you to run ABCL from within Emacs.

Portability

Armed Bear Common Lisp requires Java 1.5 or later. It runs much better with a JVM that features a JIT, such as (for Linux/x86) the IBM or Sun virtual machines. It also runs, though very slowly, with the GNU gij virtual machine, as of version 3.3, and (with some exceptions) with SableVM as of version 1.0.9. It is also possible to use recent versions of the GNU Java compiler gcj to produce a standalone native executable.

Accessing Java from ABCL

ABCL gives you access to all those methods in the Java runtime environment. This is implemented using the Java Reflection API. To call a static method, use the jstatic function:

(jstatic "gc" "java.lang.System")
(jstatic "getProperty" "java.lang.System" "user.dir")

To obtain a reference to a Java method, call jmethod with the class name, method name, and parameter types:

(jmethod "java.lang.Runtime" "availableProcessors")

To invoke a (non-static) Java method, use jcall with the reference to the method, a reference to the invoked object, and the method arguments:

(jcall (jmethod "java.lang.Runtime" "availableProcessors") (jstatic "getRuntime" "java.lang.Runtime"))

To invoke a constructor, use jconstructor and jnew in place of jmethod and jcall.

(jnew (jconstructor "java.lang.Object"))

There are a fair number of (poorly) documented Java specific Lisp extensions in the JAVA package. Currently, reading the source to 'java.lisp' while experimenting with the REPL is probably the best way to come to an understanding of what is available.

Of common interest is the JAVA:JIMPLEMENTATION-INTERFACE function, which allows one to implement a Java interface in Common Lisp.

Extensions

Alan Ruttenberg's JSS provides a more convenient syntax for calling Java.

Obtaining

This project is now hosted at common-lisp.net http://common-lisp.net/project/armedbear/.

Source distribution

abcl-src-0.20.0.tar.gz

abcl-src-0.20.0.zip

Binary distribution

A pre-built JAR binary can be downloaded from

abcl-bin-0.20.0.tar.gz

abcl-bin-0.20.0.zip

It can be utilized via

java -jar abcl.jar

SVN trunk

To obtain the source tree from SVN, the command

 svn checkout svn://common-lisp.net/project/armedbear/svn/trunk/abcl
will create a directory named 'abcl' with the source tree.

The easiest way to build the source is to use the Java build tool Ant

 cmd$ cd abcl; ant abcl.wrapper

this will compile ABCL, then creates an executable ('abcl.bat' under win32, 'abcl' otherwise) which then can be used to invoke the Bear.

Trac

A Trac instance for ABCL issues has been created on common-lisp.net. Unfortunately, it is read-only to non-members of common-lisp.net. TO submit issues, please post a message to the mailing list noted below.

Mailing List

ABCL developmers use the http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel mailing list hosted on common-lisp.net. This supercedes the mailing list associated with armedbear-j development, which is still monitered for contributions.

A more convenient manner to read the mailing list from a web browser without subscribing can be found via the gmane.org NNTP interface for the 'gmane.editors.j.devel' group. You have to be subscribed to the list to post messages.


This page is linked from: araneida   asdf   Common Lisp implementation   Distributed   features   Gentoo   jss   Linux   MacOS X   Marko Kocic   mel-base   Peter Graves   Solaris   trivial-sockets   USOCKET   win32   XCL  

CLiki pages can be edited by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively