| |
Kawa Scripting Languages | License: | GNU General Public License (GPL) | URL: | http://www.gnu.org/software/kawa | Description: | Kawa is a Scheme environment, written in Java, and that compiles Scheme code into Java byte-codes. |
Package Name | Comment | gnu.brl | | gnu.bytecode |
The gnu.bytecode package
Contains classes to generate, read,
write, and print Java bytecode (.class ) files.
It is used by
Kawa
to compile Scheme into bytecodes; it should be useful
for other languages that need to be compiled into Java bytecodes.
(An interesting exercise would be an interactive Java expression evaluator.)
The classes here are relatively low-level. If you want to use them
to generate bytecode from a high-level language, it is better to
use the gnu.expr package, which works
at the expression level, and handles all the code-generation for you.
Javadoc generated
documentation
of the class is available online.
The most important class is ClassType .
This contains information
about a single class. Note that the difference between ClassType
and java.lang.Class is that the latter only represents existing
classes that have been loaded into the Java VM; in contrast,
ClassType can be used to build new classes
incrementally and on the fly.
A ClassType has a list of Field objects;
new ones can be added using
the various addField methods. A ClassType
manages a ConstantPool .
A ClassType also has a list of Method objects;
new ones can be created by the various addMethod objects.
A Method contains many methods you can use to generate bytecode.
See Kawa for examples.
Once you have finished generating a ClassType , you
can write it to a .class file with
the writeToFile method. You can also make a
byte array suitable for ClassLoader.defineClass using the
writeToArray
method. This is used by Kawa to compile and immediately load a class.
You can also print out the contains of a ClassType in
human-readable
form using the class ClassTypeWriter . This prints a fair bit of
information of the generated class, including
dis-assembling the code of the methods.
You can also build a ClassType by reading it from an
existing .class
file by using a ClassFileInput class. This reads the constant
pool, the fields, methods, superclass, and interfaces.
The gnu.bytecode.dump class has a main method
that prints out the information in a named class file.
Zip archive manager
To build, extract, list, or print a zip file, you can
use ZipArchive as an application:
java gnu.bytecode.ZipArchive [txpq] archive [file ...]
See the comments for
ZipArchive.main .
ZipArchive does not do compression or uncompressions, and
it is reported that that some programs do not like the archives it creates.
It is probably best suited for listing and extracting from classes.zip-like
archives. (This class has been partially re-written to use java.util.zip.
It may get dropped in the future.)
Class file dumper
To print out the contents of a class file foo.class, you can use
the class dump as an application:
java gnu.bytecode.dump foo.class
This will print out the constant pool, fields, methods, superclass,
and implemented interfaces of class foo .
It is useful for printing out detailed information about the constant
pool, which javap does not do.
License
See the file COPYING.
Author
Per Bothner
<per@bothner.com>
How to get it
The gnu.bytecode package is currently distributed as part of
Kawa, though it can be used independent
of the rest of Kawa.
Bugs and patches
Send them to per@bothner.com,
or to the Kawa mailing list.
| gnu.commonlisp.lang | | gnu.ecmascript | | gnu.expr |
The gnu.expr Package
Supports Expression ,
and various related classes need to compile programming languages.
The exact set of classes in this package is still somewhat in flux.
License
See the file COPYING.
Author
Per Bothner
<per@bothner.com>
Bugs and patches
Send them to per@bothner.com,
or to the Kawa mailing list.
| gnu.jemacs.buffer |
JEmacs and the gnu.jemacs.buffer Package
Provides various building blocks for building an Emacs-like text editor.
It also provides a number of Scheme procedures that have the same name
and similar functionality as the Emacs Lisp functions.
Somewhat out of date.
Check the JEmacs home page
for more information.
It uses the Swing tool-kit.
Plan
The plan is to use
this together with the (unfinished) gnu.jemacs.lang
package to provide a fully-functional re-implementation of
Emacs Lisp which compiles to Java bytecodes.
I'm hoping volunteers will help me make "JEmacs" into something
useful. I have fairly clear ideas about much of what need to be
done. Contact me if you are interested.
Home page
There is now a JEmacs home page.
Also check out the
Kawa home page.
Screen snapshot
There is a now a
teaser screen snapshot.
Status
Very unfinished proof of concerpt.
It is a functional but very minimal editor.
Many of the core Emacs concepts (keymaps, windows, frames,
buffers, markers) are implemented, and generally in such a way as
to provide the standard Emacs semantics. There are Scheme functions
with the same name and similar behavior as the standard Emacs Lisp
functions. However, there is only a very limited set of core "editing"
commands, and no searching commands. And it is not
robust or reliable.
To-do
A couple of things volunteers might start with
(but let me know before you spend serious time on any of these):
- Implement more of the editing commands: Insert/delete/forward/backward
word/line.
- Display the modeline in inverse video, but extend it to the full
window width.
- Come up with a design for narrowing a buffer. One possibility
is to use some kind of invisible style for the text outside the narrowing.
But I think a more flexible design would use an "IndirectDocument" class
that refers to a sub-range of a buffer. This would help with "Indirect
Buffers", and might be flexible and elegant in general.
- Perhaps Buffer should inherit from Document (or rather
DefaultStyledDocument). However, that might lose some flexibility.
- Needs methods to control Window scrolling.
- Think about how to map extents and faces to Swing attributes
and styles.
- Decide how to implement Emacs strings.
Initially, we'll use kawa.lang.FString, but we do want to support strings
with extents and text properties.
Usage
These classes depend on Swing, so make sure you have Swing available.
Then make sure you have a version of the Kawa classes that contains
the gnu.jemacs.buffer classes. (In other words,
Kawa needs to have been configure --with-swing support.)
Then just start Kawa in the usual way:
java kawa.repl
Then evaluate:
(emacs)
That brings up a Emacs window.
You can do (split-window) to create new (sub-)windows
in an existing frame; type (make-frame) to create
a new frame (to-level window), or do (get-buffer-create NAME)
to create a new buffer.
Note also how ctrl/B and ctrl/F have been
bound to the correct functions. For other working key-bindings,
look for the calls to define-key in emacs.scm .
The call (scheme-swing-window) creates a new Scheme
interaction window.
License
Same as the package gnu.expr : Modified Gnu Public License.
See the file COPYING.
For now, the copyright holder is Per Bothner; in the future it may
make more sense to make the FSF the copyright owner, since the plan
is to use a lot of the existing ELisp packages once ELisp support
is complete.
Author
Per Bothner,
<bothner@gnu.org>
| gnu.jemacs.lang |
The gnu.jemacs.lang package
Contains classes to implement the Emacs Lisp language.
In contrast
gnu.jemacs.buffer
contains classes that implement the editing functionality for buffers.
| gnu.jemacs.swing | | gnu.jemacs.swt | | gnu.kawa.ant | | gnu.kawa.brl | | gnu.kawa.functions | | gnu.kawa.lispexpr | | gnu.kawa.models | | gnu.kawa.reflect |
The gnu.kawa.reflect package
Contains classes to use reflection.
Dependencies
Depends on
gnu.bytecode ,
gnu.mapping , and
gnu.expr .
Also uses gnu.kawa.util.FString .
Uses kawa.standard.Scheme , but that is a bug.
(It should be using gnu.expr.Interpreter instead.)
Author
Per Bothner
<per@bothner.com>
| gnu.kawa.sax | | gnu.kawa.servlet | | gnu.kawa.swingviews | | gnu.kawa.swtviews | | gnu.kawa.util | | gnu.kawa.xml | | gnu.kawa.xslt | | gnu.lists | | gnu.mapping |
The gnu.mapping Package
Supports Procedure ,
and various related classes needed at run-time by dynamically typed
languages (such as Scheme and ECMAScript).
The exact set of classes in this package is still somewhat in flux.
License
See the file COPYING.
Author
Per Bothner
<per@bothner.com>
Bugs and patches
Send them to per@bothner.com,
or to the Kawa mailing list.
| gnu.math |
The gnu.math Package
Supports various numeric
types, including complex numbers, efficient bignums, exact rational
numbers, units.
This package is used by Kawa
to provide the full Scheme "numeric tower".
Javadoc generated
documentation
of the class is available online.
License
See the file COPYING.
Author
Per Bothner
<per@bothner.com>
How to get it
The gnu.bytecode is currently distributed as part of
Kawa, though it can be used independent
of the rest of Kawa.
Bugs and patches
Send them to per@bothner.com,
or to the Kawa mailing list.
| gnu.q2.lang | | gnu.text |
The gnu.text Package
Supports various utility classes
for formatting, parsing, and manipulating text (strings).
It also contains some general IO-related classes.
This package should probably be renamed to something.io .
It is used by Kawa.
License
See the file COPYING.
Author
Per Bothner
<per@bothner.com>
How to get it
The gnu.text package is currently distributed as part of
Kawa,
though it can be used independent of the rest of Kawa.
Bugs and patches
Send them to per@bothner.com,
or to the Kawa mailing list.
| gnu.xml |
The gnu.xml package
Utilities for working with XML.
Depends on the gnu.lists
package.
| gnu.xquery.lang | | gnu.xquery.testsuite | | gnu.xquery.util | | kawa | | kawa.lang | | kawa.standard | |
|