Version 3 of Starkit is a mechanism not a file format

Updated 2004-09-16 02:32:59

Brian Theado - after seeing uses of the terms starkit and starpack (c.l.t [L1 ]) that didn't match my understanding, I wrote the following:

Starkit

starkit - has two meanings:

  1. A sealed application that requires only a runtime to execute
  2. A library that can be package required in support of creating a starkit

'sealed application' - all the necessary tcl files and binary files are contained within a single directory structure

A starkit can take many forms. It imposes no constraints that a starkit must be a certain vfs format. It doesn't even force the starkit to be a single file. A starkit could be a set of extracted files on the file system. It could be a single file containing an metakit vfs. It could be a single file containing a zip vfs. Pretty much any Tcl code that starts with the following incantation is a starkit:

 package require starkit
 starkit::startup

If a starkit is a single file vfs, then it starts with a header of that contains at least the following:

 package require starkit
 starkit::header mk4 -readonly

The mk4 in the above can be replaced by any vfs supported by the Tcl vfs package (metakit, zip, etc.).

Runtime

A runtime that can execute a starkit can take many forms. The most common and most convenient in every case that I've encountered is the single file tclkit. However, nothing about starkits imposes that tclkit must be used to run them. A vanilla tclsh can be used to execute any starkit as long as the starkit (pure tcl) package is available and the tclsh has core vfs support (8.4 and greater) and the vfs package used by the starkit (if any) is available.

If a freewrap executable contained the starkit package and support for one or more tclvfs package, then it too could execute single file starkits.

The tclkit runtime is itself a single file starkit. It doesn't contain the starkit::header lines from above and instead consists of an executable prefix with a metakit vfs suffix. This vfs contains all the Tcl/Tk library scripts. It also contains a subset of Tcl's encodings.

Encodings and tclkit:

Using only a tclkit, the sdx utility, and the desired encodings files, tclkit can be updated to support any encodings that Tcl supports. See http://www.equi4.com/tkunicode.html for step-by-step instructions.

The encodings can be added on the fly and therefore don't have to be part of the runtime and can reside in a starkit instead. See http://www.equi4.com/pipermail/starkit/2004-May/001991.html for some details.

From starkit to starpack

Converting a tclkit+starkit into a starpack involves only copying the files from the starkit's vfs into the vfs suffix at the end of the tclkit executable.

Conclusion

In my experience, the starkit mechanism is so simple to use, flexibly defined and imposes so few constraints, that it takes some work to go wrong with them. When I come across cool applications in other scripting languages, I find myself wishing they were as easily deployable and installation-free as starkits/starpacks.


See also No Magic or Policy in Starkits