Mod_dtcl
|
|
 |
WHAT IS mod_dtcl ?:
- mod_dtcl is a free/open source implementation of server
parsed Tcl, under Apache, distributed under
the terms of the GNU GPL. It allows you to tightly
integrate html with Tcl, a widely used scripting language
with many years of development invested in it. This is an
ideal combination, allowing you to greatly extend what you
could do with plain html. Because Tcl is such a widely used
language, there is a large amount of documentation for it,
both on the net and books. There are also many external Tcl
modules that you can load into mod_dtcl, to create images,
access databases, etc. Apache, is, of course, the world's
most popular web server. If you aren't reading this from
the web pages, they are available at http://comanche.com.dtu.dk/dave/.
Install mod_dtcl!
EXAMPLES:
- The examples.ttml file has a
few very limited examples of what is possible with mod_dtcl.
You need to make it accessable to the web server in order to
be able to view it. Put it in your public_html directory or
something. Have a look at my rough benchmarks - although they are
unscientific, the results are interesting.
USE AND FEATURES:
How to use mod_dtcl, features available, etc...
SUPPORT:
There is a mailing list at mod_dtcl@lists.prosa.it.
To subscribe, send a message with 'subscribe' in the body to
mod_dtcl-request@lists.prosa.it. Mod_dtcl is currently alpha
software (meaning that it is subject to change), however, due to
the relative simplicity of the design, it is fairly stable, and
performs well. If you have any questions or comments, please
send them to the mailing list.
TODO:
-
Security review.
- There ought to be a way to make it so things like while
{1} doesn't go ape and make the process run away. I.e.,
create a limit on the maximum execution time.
- Lots more commands.. like php, to make life easier. Some
things will have to be done in the module itself, I think,
like cookie things, because they deal with headers. Other
things could probably be implemented in tcl, if the speed
loss isn't too great. PHP would be a good place to look for
examples.
- Make file uploads work. Once again, PHP has some code
which does this, but it looks like a mess. It's a pity that
Apache doesn't have a standard way of getting stuff out of
Mime headers, without doing most of the parsing yourself.
-
Configurations options: safe mode, ???.
- Long term: it would be neat to build something that could
use any one of a variety of languages, like Perl, Python,
Guile..whatever.
- Long term: maybe have a seperate process running
somewhere that all the different server processes could talk
to, similiar to how java servlets work (ridruejo@esi.us.es).
-
Fix up the logo I hacked together with The Gimp:->
WHY:
Why mod_dtcl when there are already so many other server parsed
implementations?
- Because it was fun to do:-)
- Because Tcl is a common and relatively well known
language. PHP, while nice,
is not really used much outside the web. It's easier, and
more practical, to learn a more general language, that can
be used outside of the web, for many other applications.
Also, Tcl has had many more years than PHP to mature, and it
has a large user base.
- Because mod_perl is a big heavy chunk of Perl that seems
like overkill for many things. Mod_dtcl aims to be more
lightweight - it doesn't get involved much in the server
config files, for instance.
-
Because, when I began, mine was the only Free server-parsed
Tcl implementation. Subsequently, neowebscript,
and AOL Server have
been freed. They are worth a look.
INTERNALS:
A brief description of how it works. For each page requested,
a new tcl namespace is created within the global
namespace. The module then reads through the page, aggregating
plain HTML into big "hputs" statements, and anything between
the delimiters ( <+ and +> ) as regular tcl. After this is
done, the whole script is eval'ed and sent to the client.
After it is eval'ed, the namespace that it was run in is
destroyed, so as to destroy local variables.
As of 0.7.0 there is more code to deal with buffering and
headers. The first 'hputs' has been replaced with
'buffer_add', which stashes the first html to be output into
'output_buffer'. If buffering is turned on, hputs continues
to output to output_buffer, and only prints and flushes at the
very end of processing. This allows you to manipulate headers
at arbitrary points in the file, at the cost of having to wait
for the whole thing to be done before printing anything.
Turning buffering on and off allows you to choose which route
you would prefer.
For more information, please read the code!
THANKS:
I would like to thank Daniel Ridruejo for furnishing me with
the web space, Rolf Ade, and the various people subscribed to
the mod_dtcl mailing list for ideas, comments and suggestions.
Thanks also to Prosa SRL for
setting up a mailing list for me.
Send me mail about
mod_dtcl!. (Or better yet, send it to the mailing list).
mod_dtcl is Copyright David Welton 1998
$Id: readme.html,v 1.14.2.1 1999/12/06 05:26:28 davidw Exp $