- PHP, ASP and the like all allow the web developer to embed code directly into the markup language. I wanted to be able to do this with my preferred scripting language - Tcl.
- I wanted to ensure that only complete commands were executed so simply using eval was out.
- I wanted to be able to embed bits of HTML inside the code directly such as
<%tcl while {$i<10} { %><B>Repeated line</B><BR><%tcl } %>
- I wanted to be able to include other files by preparsing them (or pre-interpreting).
- I wished to make the code as neat and fast as I could without making it unreadable (not sure if I've achieved either, you be the judge).
- The code should be platform, server and client independent.
- Using THP must be very easy.
- Linux with Apache using both the standard interpreter (tclsh) and tclkit.
- Windows XP/Server2003 with Tclhttpd using tclsh and tclkit.
- Windows XP/Server2003 with IIS and THP wrapped as a starpack.
SMSM 04-16-16, Using Firefox 38, on a PPC Mac OS 10.5, the example at [2] fails with 500.
It might make sense to see if you could utilize the standalone Rivet stuff. It's capable of doing a lot of what you require (maybe all of it, I don't recall), including parsing, including files, and so on.Standalone? Does Rivet work without Apache? I've looked at Rivet in the past and although it has the advantage of a persistent interpreter, I thought it only worked with Apache.THP does have its overhead of being run in a new interpreter for each page the client requests (as do most other CGI scripts using Tcl/Perl/Python, etc), but it's as portable and as easy to learn as Tcl, does pretty much what Rivet does and only three new commands are defined, two of which can be ignored if the user wishes.It is up to the developer to decide how they get at GET and POST variables. As ncgi is available in tcllib, that shouldn't be a problem for most folks. ncgi is my preferred method: simply use
package require ncgiinside your script. --CAU
schlenk Rivet has all the stuff needed to make it work outside of Apache, including a pure Tcl Rivet parser, parsing the special Rivet markup. I have an ncgi based application using rivet for page templating, works perfectly. One just needs to write some ncgi wrappers to setup the environment expected by standard Rivet pages.
See also: