Scripting Java

In previous sections, we used Tcl Blend to call Java. In this section, we will use Jacl. Unlike Tcl Blend, Jacl contain no native code -- that is, it is written entirely in Java. All of the code we have executed so far will work exactly the same in Jacl as in Tcl Blend, although the Tcl code will (with the current Java compilers) run more slowly.
Java is slow, so Jacl will be glacial
The speed of Java has been a common criticism of the language. A just-in-time (JIT) compiler comes with the Windows version of JDK 1.1, and will be in the Solaris version in JDK 1.2. Sun are making great claims for their new HotSpot compiler technology, and we will just have to wait and see what happens there. We suspect part of the performance problem noted in our Timing Trials II: More Experiments with Scripting Languages paper simply lies in the relative immaturity of the Jacl code. So, in summary, no, you don't want to use Jacl if performance is critical -- but then, scripting languages aren't the best choice for top performance anyway.

In this section, we will take the scenario that our main code base is Java, and we are adding extra functionality using Tcl. Remember that most of the code shown here will work just as well (and faster) in Tcl Blend.