Jacl and Swank Advocacy

Purpose: Place to provide reasons for using Jacl and Swank


BAJ started this 27 May 2004 and hopes to periodically add new items to the list (others please join in as well). The items (at least as added by BAJ) are in no particular order of importance.

  • While the tcllib has added many useful features to Tcl, it has the following restriction "the module must be Tcl only: no C extensions. This minimizes the barrier to use -- not everybody has the means or desire to compile extensions.". This restriction, while very appropriate, provides a significant limitation to the types of features added. As Jacl/Swank extensions can be done as cross-platform Java bytecode files this restriction isn't necessary.
  • Get access to features of the Java Runtime Environment (JRE) without writing a single line of Java code. In this example we create an object which is an instance of the GregorianCalendar class [L1 ]. The java::new command creates the new object and returns a handle to the object. The handle can be used to invoke methods of the class:
        > set cal [java::new java.util.GregorianCalendar]
        java0x2
        > $cal isLeapYear 1999
        0
        > $cal isLeapYear 2004
        1
        $cal get [java::field java.util.GregorianCalendar DAY_OF_WEEK]
        5