★ wanayoo — archive 1999 http://dev.scriptics.com/community/features/tclkit.htmlNouvelle recherche | Portail wanayoo
Developer Site
Getting StartedTcl AdvocacySoftware ResourcesDocumentsServicesCommunity
Home
Login | Discussion Forums | List Archives | News and Events | TclUrl |  Features| | People | Web Sites
Search 
Tcl and ECAD | Scriptics Websites | Intelliclaim | InfoCetera | Tcl Hacker | Scripted Documents | XML Prescription App

Editor's note: Jean-Claude Wippler has been developing the MetaKit database and a Tcl interface to it for a number of years. One nice trick he uses is to bundle a Tcl interpreter with a MetaKit database into one executable file. This simplifies the task of distributing his Tcl-based software, not to mention that he has access to a small, fast database. The rest of this page is based on a posting of his to the TclHttpd mailing list.

"Scripted Documents" is a name I coined for a way to package applications: combining scripts and data into a single file, in such a way that the file can run without unpacking. Because it is based on a database, such scripted documents can also safely modify themselves while running.

Scripted Documents were presented at the last Tcl/Tk conference: http://www.equi4.com/jcw/scripdoc.html (also .ps.gz/.pdf). Various shorter explanations exist, written and different times:

    http://www.equi4.com/jcw/wiki.cgi/ScriptedDocument
    http://www.equi4.com/metakit/wiki.cgi/18.html

The Tcl'ers Wiki is an example of a scripted document, it's a single file running with TclKit as "runtime".

Scripted documents are in production in a range of commercial projects.

As exercise, I just wrapped up the TclHttpd server as scripted document. With the new VFS-based TclKit, this turns out to be trivial:

	http://www.equi4.com/previews/tclhttpd.README
As for tying TclHttpd to the MetaKit database included in TclKit - I did this a long time ago (before TclKit existed, using the Mk4tcl extension) by inserting database calls in TclHttpd ".tml" template files. There are a lot of ways to do such things - it can be as simple as inserting an "mk::file open" call at startup, then you'll have an open datafile at your disposal as long as the server is running. Note that when TclHttpd is running as scripted document, all "mk::*" commands can be used anywhere inside it since the "package require" is implicitly done. So what the above README describes is how to package TclHttpd in a single file which runs as is on a range of platforms (with all data, including logs, residing *inside* that single file). It does not add functionality to TclHttpd, in fact it does not alter the way TclHttpd works at all - it merely changes the way software is deployed and used.

Jean-Claude Wippler

Annotations Welcome
Add a comment | Add a link

Top of page
Developer Home | Ajuba | Getting Started | Tcl Advocacy | Software Resources | Documents | Services | Community
Search | Site Map | Feedback | Contact Us | webmaster@ajubasolutions.com
Increase page width
© 1998-2000 Ajuba Solutions. All rights reserved. Legal Notice | Privacy Statement

Last modified: June 05, 2000