MJ Ray <email@example.com> wrote:
| firstname.lastname@example.org writes:
| > Usually, server-side web programming in Scheme does not use the Common
| > Gateway Interface (CGI) for performance reasons.
| MzScheme's CGI support almost seems fast enough to use in stand-alone
| scripts to me.
I agree. I just finished doing a one-off internal survey, for which both
the form-submission/data-recording and the later post-processing/reporting
were done with a CGI using the MzScheme "cgi.ss" library. It was plenty
fast for that application (~400 survey forms submitted the first two days,
with another ~40 that trickled in over the next week).
Minor neat hack: If you run a post-processing/reporting CGI script directly
from the shell [as yourself], the environment variable "REQUEST_METHOD"
will [normally] not be set, which will cause (get-cgi-method) to return
#f, which you can use to do something different for the interactive case,
such as at the very end:
(unless (get-cgi-method) ; if run from a shell,
(read-eval-print-loop)) ; stop before exiting for debugging
| However, if you're talking to databases, that's not a good idea...
Well, that depends. If you had an intermediate server program that
cached connections to the database, such that CGI scripts could connect
(with a TCP socket) to the intermediate program without going through
a full heavyweight database connection, then it should be plenty fast
enough for low-volume stuff (local intranets), though maybe not for
running a mass-distribution public web site.
Rob Warnock, 30-3-510 <email@example.com>
SGI Network Engineering <http://reality.sgi.com/rpw3/> [until 8/15]
1600 Amphitheatre Pkwy. Phone: 650-933-1673
Mountain View, CA 94043 PP-ASEL-IA