Package based tcl/tk compiler/wrap/loader


Integrated application framework Logo


Ability to obfuscat the tcl source code via compiling.

The program "tclc" in geek can compile a tcl code to the tcl bytecode, thus the code will be obfuscated and later the "gwish" program provided by geek can explain this bytecode since tcl has already had this kind of capability. This compiled file can be treated just like the normal tcl file. No special handling is needed for geek wish later.

Idea of reuable package shared with each tcl/tk application.

We know, there are many kind of libraries existing in the tcl/tk world. Originally, the tcl/tk wrap is trying to establish one exectuable file with statically linked library or zipped in the file itself. It is a very simple way to help us wrap the tcl/tk application. Geek uses another mechanism to provide this wrap ability. It first asks each library to be a package, just like the jar file in java language. Then these package file can be loaded by geek wish. The advantage is that these package file can be shared with any tcl/tk application. Thus tcl application will become much like a java application when we define the search path for those package file. For dll file needed by those packages in windows, geek wish can also search them in the package search path. However, someone may still want to see only a single-file to execute. Geek provides this ability to wrap the all needed package/dll into one exectuable file and extract them automatically.

Integrated application framework

Geek includes an application framework which can provide the utility to hanlde the detail of an application, such as GUI, thread, profile, etc. Developper can quickly establish an application based on geek application level library.


The purpose of geek is trying to provide an essential environment which can benefit the tcl/tk developper with the rapid coding and deployment. This is also a result when I start to write a more commercial tcl/tk program.


Actually many ideas/solution of geek come from several existed tcl/tk open source.

Wrap part is based on the freewrap, but geeks use a different way to organize the start file and the packages.

Layout description in the geek framework is based on the sdtcl, but has some different rules and is trying to make it look more comfortable.

Comparison Table with Java







Package Tool jar zip
Interpreter java gwish
wrap - gwrap

History - current revision = 0.1

Features for version 0.1

    1. tclc is provided for tcl compiling.

    2. gwish is provided as a special wish which can load package and tcl bytecode.

    3. gwrap is provided to easily wrap a tcl/tk program to be an exectuable file.

    4. gswish is much similar as gwish, except it is a single executable file, no other dll/package is needed (Actually they are either statically linked or zipped in that file).

    5. gswrap is similar with gwrap, however, it is based on gswish, i.e. The essential library is statically linked into the executable file.

Learn More

    Under construnction.


    The latest downloads are available from


"GEEK_PKGPATH" is an environment variable which is used for Geek to search those zipped package files. This variable is much like the "PATH". You can add more than one search path into this variable. For example,


Geek has provided a binary package in the download page, which includes some essential zipped package for gwish, like geek.pkg, tcl8.4.pkg and tk8.4.pkg. Please install them into a searchable path included in "GEEK_PKGPATH"

How to build a package

You can use any zip compatible problem to build a package. Only one rule should be obeyed, i.e. the package file name should be the same as the top folder under the zipped file.

For example, the content of tcl8.4.pkg is




The zip.exe is provided in the binary download package to help build the package. It is a open source software, and you can find the manual page from the offical web page Actually the usage of zip.exe is very simple. Suppose you already have a folder named tcl8.4 and all needed .tcl file is under this folder, you just need to type 

zip -r tcl8.4.pkg tcl8.4 

How to load a package

Before load a package, you should make sure the package is under the path where gwish can search, see GEEK_PKGPATH for more information.

geek_loadpkg is a predefined command to search and load package. For example, we can load tcl8.4.pkg via 

geek_loadpkg tcl8.4.pkg

gwish will automatically load geek.pkg, tcl8.4.pkg and tk8.4.pkg when it starts up.

When a package is loaded, the package will be added into the tcl variable ::auto_path, thus later the "package require" command can find this package.

Sometimes, a zipped package may contain several packages which can be used by "package require" command. In this case, you can define a tcl file named "pkg.tcl".

For example, tcl8.4.pkg contains this kind of file under the top folder with scripts like,

geek_addautopath $::dir/http2.4

geek_addautopath is just add some search path to ::auto_path and ::dir is a global variable setting to current package path.

This page last updated Oct 7, 2006

Send comments to