You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-cvs@tcl.apache.org by da...@apache.org on 2001/12/09 17:01:19 UTC
cvs commit: tcl-site/presentations/dtcl advantages.ttml cacheing.ttml cgi.ttml channel.ttml comparisons.ttml conclusion.ttml example1.ttml example2.ttml future.ttml how.ttml htmltcl.ttml index.ttml interpreter.ttml java.ttml mod_perl.ttml mod_tcl.ttml other.ttml php.ttml results.ttml rivet.ttml smalllight.ttml template.ttml what.ttml zope.ttml
davidw 01/12/09 08:01:19
Added: presentations/dtcl advantages.ttml cacheing.ttml cgi.ttml
channel.ttml comparisons.ttml conclusion.ttml
example1.ttml example2.ttml future.ttml how.ttml
htmltcl.ttml index.ttml interpreter.ttml java.ttml
mod_perl.ttml mod_tcl.ttml other.ttml php.ttml
results.ttml rivet.ttml smalllight.ttml
template.ttml what.ttml zope.ttml
Log:
Added dtcl presentation.
Revision Changes Path
1.1 tcl-site/presentations/dtcl/advantages.ttml
Index: advantages.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Advantages</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Advantages</h1>" ?>
<ul>
<li>Avoid reinventing the wheel!</li>
<li>Lots of existing Tcl code.</li>
<li>Use code both for web projects, and elsewhere.</li>
<li>Lightweight.</li>
<li>Easy to use.</li>
<li>Fast!</li>
</ul>
</body>
</html>
1.1 tcl-site/presentations/dtcl/cacheing.ttml
Index: cacheing.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Cacheing</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Cacheing</h1>" ?>
When a .ttml page is first loaded, the byte-compiled Tcl code is
inserted into a cache, so that the next time the page is hit, it
is not necessary to recompile the code, or even open the file
again.
</body>
</html>
1.1 tcl-site/presentations/dtcl/cgi.ttml
Index: cgi.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>CGI</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>CGI</h1>" ?>
CGI is a bit dated, and is inefficient, unless the process being
run is so heavy as to make the overhead of running it seem
insignificant. Should it be your only option, it should be noted
that Don Libes' <code>cgi.tcl</code> is a great CGI package for
Tcl.
</body>
</html>
1.1 tcl-site/presentations/dtcl/channel.ttml
Index: channel.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Apache IO Channel</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Apache IO Channel</h1>" ?>
When creating mod_dtcl, it was considered desirable to be able to
run normal Tcl scripts with as little modifications as possible.
In order to deal with standard output, mod_dtcl uses an in-memory
file channel that then uses Apache's output functions. 'puts
"foobar"' works in mod_dtcl.
</body>
</html>
1.1 tcl-site/presentations/dtcl/comparisons.ttml
Index: comparisons.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Comparisons with other systems</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Comparisons with other systems</h1>" ?>
Flame war!
<ul>
<LI>CGI</LI>
<LI>PHP</LI>
<li>mod_perl</li>
<Li>Zope</Li>
<Li>Java</Li>
<li>Other Tcl solutions</li>
</ul>
</body>
</html>
1.1 tcl-site/presentations/dtcl/conclusion.ttml
Index: conclusion.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Conclusion</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Conclusion</h1>" ?>
Tcl is an excellent language for the web. As a generalized,
embeddable "command language", it is a natural for the web, giving
the user a powerful language with years of history and many
capabilities, in an environment tuned for use with the web.
<h2 align="center">Links</h2>
<table align="center" width="80%">
<tbody>
<tr>
<th align="left">mod_dtcl:</th>
<td align="right"><a href="http://tcl.apache.org/mod_dtcl/">http://tcl.apache.org/mod_dtcl/</a></td>
</tr>
<tr>
<th align="left">Apache Tcl:</th>
<td align="right"><a href="http://tcl.apache.org/">http://tcl.apache.org/</a></td>
</tr>
<tr>
<th align="left">Tcl Web Site:</th>
<td align="right"><a href="http://www.tcl-tk.net/">http://www.tcl-tk.net/</a></td>
</tr>
<tr>
<th align="left">Presentation:</th>
<td align="right"><a href="http://tcl.apache.org/presentations/tcl/">http://tcl.apache.org/presentations/dtcl/</a></td>
</tr>
<tr>
<th align="left">David N. Welton:</th>
<td align="right"><a href="mailto:davidw@dedasys.com">davidw@dedasys.com</a></td>
</tr>
</tbody>
</table>
</body>
</html>
1.1 tcl-site/presentations/dtcl/example1.ttml
Index: example1.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Example</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Example</h1>" ?>
<PRE>
<B><FONT COLOR="#A020F0"><h1></FONT></B>Some HTML<B><FONT COLOR="#A020F0"></h1></FONT></B>
<B><FONT COLOR="#A020F0"><?
hputs </FONT></B><B><FONT COLOR="#BC8F8F">"hello world"</FONT></B><B><FONT COLOR="#A020F0">
?></FONT></B>
<B><FONT COLOR="#A020F0"><? if { $foo == 1 } { ?></FONT></B>
More Html
...
<B><FONT COLOR="#A020F0"><? } ?></FONT></B>
...
</PRE>
</body>
</html>
1.1 tcl-site/presentations/dtcl/example2.ttml
Index: example2.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Another Example</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Another Example</h1>" ?>
<PRE>
<?
<B><FONT COLOR="#A020F0">set</FONT></B> i 1
puts <B><FONT COLOR="#BC8F8F">"<table>"</FONT></B>
<B><FONT COLOR="#A020F0">while</FONT></B> { $<FONT COLOR="#B8860B">i</FONT> <= 8 } {
puts <B><FONT COLOR="#BC8F8F">"<tr>"</FONT></B>
<B><FONT COLOR="#A020F0">for</FONT></B> {<B><FONT COLOR="#A020F0">set</FONT></B> j 1} {$<FONT COLOR="#B8860B">j</FONT> <= 8} {<B><FONT COLOR="#A020F0">incr</FONT></B> j} {
<B><FONT COLOR="#A020F0">set</FONT></B> num [ <B><FONT COLOR="#A020F0">expr</FONT></B> {$<FONT COLOR="#B8860B">i</FONT> * $<FONT COLOR="#B8860B">j</FONT> * 4 - 1} ]
puts [ <B><FONT COLOR="#A020F0">format</FONT></B> <B><FONT COLOR="#BC8F8F">"<td bgcolor=%2x%2x%2x > $num $num $num </td>"</FONT></B> \
$<FONT COLOR="#B8860B">num</FONT> $<FONT COLOR="#B8860B">num</FONT> $<FONT COLOR="#B8860B">num</FONT> ]
}
<B><FONT COLOR="#A020F0">incr</FONT></B> i
puts <B><FONT COLOR="#BC8F8F">"</tr>"</FONT></B>
}
puts <B><FONT COLOR="#BC8F8F">"</table>"</FONT></B>
?>
</PRE>
</body>
</html>
1.1 tcl-site/presentations/dtcl/future.ttml
Index: future.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>The Future</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>The Future</h1>" ?>
<ul>
<li>mod_tcl
<ul>
<li>
mod_tcl is the Tcl equivalent of mod_perl - it gives us
access to the Apache API through Tcl. It is currently
available for Apache 2.0.
</li>
</ul>
</li>
<li>Apache Rivet
<ul>
<li>Apache Rivet is a descendant of mod_dtcl and
NeoWebscript, and an attempt to combine the best of both,
and leave behind some extra baggage.</li>
</ul>
</li>
</ul>
</body>
</html>
1.1 tcl-site/presentations/dtcl/how.ttml
Index: how.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>How does it work?</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>How does it work?</h1>" ?>
<ul>
<li>Embedded Tcl interpreter.</li>
<li>Pages run in separate namespaces.</li>
<li>Cached byte-compiled scripts.</li>
<li>Memory IO channel / cached output.</li>
<li>HTML/Tcl integration.</li>
</ul>
</body>
</html>
1.1 tcl-site/presentations/dtcl/htmltcl.ttml
Index: htmltcl.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Mixing HTML and Tcl</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>HTML and Tcl</h1>" ?>
Tcl and HTML can be mixed as much as is necessary. The mod_dtcl
parser replaces sections of HTML as "hputs" statements. This lets
you put bits of HTML in the middle of loops, in conditional
statements, and so on.
</body>
</html>
1.1 tcl-site/presentations/dtcl/index.ttml
Index: index.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>mod_dtcl</title>
<link rel="stylesheet" href="style.css">
</head>
<body class="splash">
<? prevnext {<h1 align="center" class="splash">Programming for the Web with Tcl</h1>} ?>
<h2 align="center" class="splash">David N. Welton</h2>
<p align="center">
<a href="mailto:davidw@dedasys.com">davidw@dedasys.com</a>
</p>
<a></a>
</body>
</html>
1.1 tcl-site/presentations/dtcl/interpreter.ttml
Index: interpreter.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Tcl Interpreter</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Tcl Interpreter</h1>" ?>
One Tcl interpreter runs in each Apache process, and each .ttml
file is run within a separate Tcl namespace. This lets .ttml
files share variables, if necessary, but makes it difficult for
pages to interfere with one another.
</body>
</html>
1.1 tcl-site/presentations/dtcl/java.ttml
Index: java.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Java</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Java</h1>" ?>
Buzzwords galore!
Java isn't a higher level language. Strings are what "goes into"
and "comes out of" web pages, so why not use a language adept at
dealing with them? Java is harder to use, set up, and you may
have licensing issues.
</body>
</html>
1.1 tcl-site/presentations/dtcl/mod_perl.ttml
Index: mod_perl.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>mod_perl</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>mod_perl</h1>" ?>
mod_perl takes a different approach - it lets you access all the
functionality of Apache with Perl. This makes it rather large,
and at times difficult to install and use for simple things, like
templates. It is very powerful, but with this power comes a lot
of complexity, and responsibility...
</body>
</html>
1.1 tcl-site/presentations/dtcl/mod_tcl.ttml
Index: mod_tcl.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1></h1>" ?>
</body>
</html>
1.1 tcl-site/presentations/dtcl/other.ttml
Index: other.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Other</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Other Tcl Web Platforms</h1>" ?>
AOLserver is a very nice package which demonstrates the power of
Tcl. It is impressive to think that it (along with the
proprietary StoryServer) were created in 1995, when most people
were using Perl CGI's. It is a complete server from the ground
up, and so doesn't ride on Apache. NeoWebScript, by Karl
Lehenbauer, is similar to mod_dtcl, but does a few things
differently, and in the future will be merged with mod_dtcl as
'Apache Rivet'. WebSH is another web Tcl platform that deserves
mention, as it has been used in commercial environments for some
time.
</body>
</html>
1.1 tcl-site/presentations/dtcl/php.ttml
Index: php.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>PHP</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>PHP</h1>" ?>
PHP is the example that mod_dtcl follows, but has a big
limitation: it only runs on the web! It has a number of good
features - it is small, light, reasonably fast, and is easy for
non programmers to use. However, it has the disadvantage of being
originally created for one and only one use, making it difficult
to use elsewhere.
</body>
</html>
1.1 tcl-site/presentations/dtcl/results.ttml
Index: results.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Produces</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Produces...</h1>" ?>
<?
set i 1
puts "<table>"
while { $i <= 8 } {
puts "<tr>"
for {set j 1} {$j <= 8} {incr j} {
set num [ expr {$i * $j * 4 - 1} ]
puts [ format "<td bgcolor=%2x%2x%2x > $num $num $num </td>" \
$num $num $num ]
}
incr i
puts "</tr>"
}
puts "</table>"
?>
</body>
</html>
1.1 tcl-site/presentations/dtcl/rivet.ttml
Index: rivet.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1></h1>" ?>
</body>
</html>
1.1 tcl-site/presentations/dtcl/smalllight.ttml
Index: smalllight.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Small and light</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Small and light</h1>" ?>
<ul>
<li><code>ls -l mod_dtcl.so</code> is about 45K on a Linux PPC system.</li>
<li><code>wc -l *.[ch]</code> is 3010 lines.</li>
<li>Runtime Apache processes grow by about a meg with mod_dtcl, on a PPC Linux system.</li>
</ul>
</body>
</html>
1.1 tcl-site/presentations/dtcl/template.ttml
Index: template.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1></h1>" ?>
</body>
</html>
1.1 tcl-site/presentations/dtcl/what.ttml
Index: what.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>What is it?</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>What is it?</h1>" ?>
mod_dtcl integrates the Tcl scripting language with the Apache web
server, so that it is possible to use Tcl for server-side web
scripting. It is similar to PHP, in functionality.
</body>
</html>
1.1 tcl-site/presentations/dtcl/zope.ttml
Index: zope.ttml
===================================================================
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Zope</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<? prevnext "<h1>Zope</h1>" ?>
Zope is another large, and somewhat complex system. It may work
well for larger sites that need some of the order and structure it
imposes, but it is difficult to compare to mod_dtcl, which is
aimed at a different target. It must be said, though, that Python
is a nice language.
</body>
</html>