Version 59 of Jacl

Updated 2005-07-29 20:52:52

http://tcljava.sourceforge.net/ is the home of Jacl. Jacl is an alternate implementation of Tcl 8.x, written entirely in Java. Jacl is production ready software, it is stable enough to be used in production systems on a daily basis.

Jacl and TclBlend are both implementations that make it easy to use Tcl scripting on the Java platform. The Tcl/Java project provides mailing lists [L1 ], online documentation [L2 ], and a bug reporting interface [L3 ].

Links to a number of Jacl and Tcl Blend related articles are also available [L4 ].

For help building Jacl under Windows, see Building JACL with Msys


According to this InfoWorld article[L5 ], Sun is thinking of introducing scripting to Java. Shouldn't they be encouraged to do this with Tcl? - escargo 12 Jun 2003 (The linked page did not display well with IE, but did with Mozilla.)

LV Sun has nothing to do with Tcl ... it has been long enough that the people still working there may not even remember that there was ever a Tcl and Sun connection.

It'd be great however if some of the Java heavies got on the Jacl band-wagon.


Swank is an interesting extension to Jacl. It was just updated during 2004.


CL occasionally updates a page [L6 ] of information related to Jacl. Note that much of the information on this page is out of date.


Has anyone figured out a way for Jacl apps to communicate with tcl/tk apps via a send like mechanism?

There is no support for send in Jacl.


For an informal comparison of how Jacl fared in a 2003 vote for favorite Java scripting language, check http://viva.sourceforge.net/republic/2004/01/scripting_language_of_the_year_2003_award_and_the_winner_is.html

schlenk With only 480 votes this can be hardly seen as relevant, perhaps we should hold such votings for Tcl too...


Summer 2004: "Tom Poindexter is working on a companion to Jacl (called Hyde) that compiles Java on the fly ..."


Running JACL under IBM RAD 6/Eclipse 3.1.

Patrick Finnegan 13/07/2005.

Someone at work asked me how to do this so here are some concise instructions with a trivial example for anyone else who wants to experiment with RAD6 or Eclipse 3.1.

Download RAD6 trial from:

http://www-128.ibm.com/developerworks/downloads/r/rad/?S_TACT=105AGX14&S_CMP=DWNL

Start RAD6 or Eclipse 3.1.

1. Create Java project.

2. Add the JACL jar files.

Add jacl.jar and tcljava.jar to the java build path under "project properties". The jar files are already packaged with RAD6 and can be found under the install directory e.g. "D:\IBM\Rational\ADTrial\6.0\runtimes\base_v6\lib\jacl.jar".

3. Create a top level java class.

Create a top level java class with a main method. Instantiate the tcl interpreter and use the Interp eval method to either run Tcl in-line or source Tcl from a file.

Example.

*

1. Run the tcl command in-line "puts clock format [clock seconds -format %k:%M:%S]"

2. Source the proc compare.

proc compare {howmany value} {

   for {set i 1} {$i < $howmany} {incr i} {
      if {$i == $value} {
         puts $i
      }
   }

}

set bench 1000

set bench2 expr $bench - 1

puts "comparing an int against $bench others..."

compare $bench $bench2

import tcl.lang.*;

// Java wrapper to test JACL under RAD 6.

public class ScriptRunnerTcl {

    public static void main(String []args) {

        Interp i = new Interp();

    try {

            i.eval("set x {The time is }");
            i.eval("set y [clock format [clock seconds] -format %k:%M:%S]");
            i.eval("puts [append z $x $y]");
            i.eval("puts \\n");
            } catch (TclException e) {
            System.out.println("Exception: " + e.getMessage());

            }

        try {
            i.eval("source E:/scripts/TCL/jacl/compare.tcl");
            } catch (TclException e) {
            System.out.println("Exception: " + e.getMessage());
            }


    }
 }

The output looks like:

The time is 21:19:51

comparing an int against 1000 others...

999


See also


Category Language | Category Java | Category Tcl Implementations