TOBA

Toba: A Java-to-C translator


Toba translates Java class files into C source code. This allows the construction of directly executable programs that avoid the overhead of interpretation. Toba deals with stand-alone applications, not applets.

Toba actually reads Java class files, the object code files produced by the Java compiler for an abstract "Java virtual machine" (JVM). The generated code is designed not for human readability (although that's not impossible) but rather for easy optimization by a reasonably clever C compiler. Translation of a class file yields a .c file and a .h file. Each .c file references its own .h file and also the .h files of other classes referenced by the class file.

Toba runs under Solaris 2.5 or Linux 2.0; the Linux implementation currently lacks thread support. Ports to other platforms are under investigation.

Usage

A Java program can be translated to produce an executable a.out file through the simple Unix command toba filename.java. More complex operations also follow the the model of cc. [More details.]

Compatibility

Toba does not support dynamic loading or the Java graphics library. Most Java applications not needing those features function identically when built by Toba. Additional differences are minor. [More details.]

Native Code Interface

Functions written in C can be linked with Java files translated by Toba. The interface, however, differs from the Sun native code interface. [More details.]

Performance

Performance gains range from noticeable to spectacular, depending on the application. Computationally-intense applications see the largest gains. The Toba executable runs about four times as fast as the interpreted version.

Implementation

Toba consists of a classfile translator written in Java and some interface code written in C. Programs are also linked with the Java API library (as translated by Toba), the Boehm-Demers-Weiser conservative garbage collector, and system libraries. [More details.]

Porting hints are available. Release notes track the evolution of Toba.

Heritage

Toba was produced by the Sumatra group: Todd Proebsting, John Hartman, Gregg Townsend, Patrick Bridges, Tim Newsham, and Scott Watterson. Please send us your comments.

We're part of the Liquid Software project of the Department of Computer Science at the University of Arizona.


index | usage | differences | native code | implementation | porting | releases | installation || home
http://www.cs.arizona.edu/sumatra/toba/doc/index.html (December, 1996)