Home
Name Modified Size InfoDownloads / Week
README 2010-12-02 2.0 kB
Totals: 1 Item   2.0 kB 0
CL-JVM 0.1
Copyright (c) 2010 Sami Makinen

INTRODUCTION 

The goal of cl-jvm is to implement Java Virtual Machine in Common
Lisp.  JVM written in Common Lisp brings new possibilities to
integrate Common Lisp and Java programs.  

The initial version is implemented with SBCL (http://www.sbcl.org)
and depends on cl-binary-file (http://cl-binary-file.sf.net) and 
cl-unit-test (http://cl-unit-test.sf.net) libraries.

Common Lisp helps implementation in many ways. Garbage collection can
be handled by Common Lisp GC and CLOS gives lots of possibilities to
extend Common Lisp specific object system to a more Java
specific. Common Lisp's compiler can help on implementing JIT compiler
for the bytecode. SBCL has also thread and Unicode support so
these essential Java features can be handled with those. 

While the bytecode execution might be more or less trivial the
challenges come from whole Java language support implementation.
cl-jvm's goal is to provide Common Lisp framework for Java language
implementation so that Java classes and (native) methods can be
implemented with Common Lisp.

REQUIREMENTS

The Java Virtual Machine specification 2nd Ed.
The Java Language Specification 3rd Ed.

DESIGN

Java class loading sequence

Java class is searched from *class-path* which is a list of directory paths.

Java class file reader makes an instance of a java-class-file structure.

Java class file validator validates the java-class-file structure instance and 
makes an instance of java-class-info from a java-class-file instance.

Classloader defines a specific java class and makes a java-class
instance from java-class-info instance. The classloader registers
defined classes to *class-registry*.

Classloader calls compiler to compile methods and registers the
compiled methods to *method-registry*.
 
Classloader resolves the references of loaded class to methods, fields
and classes.  Any unloaded class is loaded with the classloader. This
can be done lazily in the future.

Find _init method and begin execution.

Source: README, updated 2010-12-02