ABCL
Armed Bear Common Lisp (aka ABCL) is a Common Lisp implementation that runs on a Java Virtual Machine; ABCL 1.3.0 was released on 2014-03-14. 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. It is now packaged with the distribution as part of ABCL-CONTRIB.

Obtaining

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

Source distribution

abcl-src-1.2.1.tar.gz

abcl-src-1.2.1.zip

Binary distribution

A pre-built JAR binary can be downloaded from
abcl-bin-1.2.1.tar.gz

abcl-bin-1.2.1.zip

It can be utilized via

java -jar abcl.jar

SVN trunk

To obtain the source tree from SVN, the command

 svn checkout http://abcl.org/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 

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

Trac

A Trac instance for ABCL issues has been created on common-lisp.net. Login is possible with an OpenID, such as a google.com account. Additional issues may be raised by posting a message to the mailing list noted below.

Mailing List

ABCL developers use the http://common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel mailing list hosted on common-lisp.net. This supersedes the mailing list associated with armedbear-j development, which is still monitored 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.