I'm working on modernizing Rosetta Code's infrastructure. Starting with communications. Please accept this time-limited open invite to RC's Slack.. --Michael Mol (talk) 20:59, 30 May 2020 (UTC)


From Rosetta Code
Tclkit is an implementation of Tcl. Other implementations of Tcl.

tclkit and tclkitsh are single-file distributions of Tcl (based on libtcl) that can be launched without prior installation; they store all auxiliary files in an internal filesystem-in-a-database. The main difference between tclkit and tclkitsh is on Windows, where the former is built as a graphical application (so not using real stdio) and the latter as a console application (forcing the opening of a console window if run from Explorer); these differences are a feature of the Windows platform. (The difference between java and javaw for Java runtimes is analogous.)

Tools are available for simply building user applications into single file distributions based on tclkit, through concatenating a further filesystem-database file. Since this technique is orthogonal (and largely transparent) to the application, it has become a very popular technique for distributing applications implemented in Tcl.

Building an Application with Tclkit[edit]

Note that unlike the source for this material, this quick tutorial assumes that you already have things installed.

Write your application[edit]

Save this into a file hello.tcl:

package require Tk
pack [button .b -text "Hello World!" -command bell]

Wrap your application[edit]

At the shell command line, type this:

SDX="tclkit sdx.kit"
$(SDX) qwrap hello.tcl

Test your application[edit]

tclkit hello.kit

Unwrap and rewrap with the full runtime attached[edit]

$(SDX) unwrap hello.kit

That creates a directory, hello.vfs, that contains the packaged application. This is when you would copy into there any libraries – either pure scripted or compiled from some other language, e.g., C – that you wanted to distribute with your application. Then you rewrap it into a full, self-contained executable like this:

$(SDX) wrap hello -vfs hello.vfs -runtime `which tclkit`

See Also[edit]