[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] PERl or Applescript

>I administer a Mac server running Webstar 2.0 (I've got
>WebStar 3.0 trial on my machine). Probably my most important project
>over next 6 months is to redesign our Web site to include ability to
>accept application information online directly into a database
>(Filemaker Pro) and possibly setting up an online bookstore. I plan to
>keep the Mac Web server (maybe upgrade hardware & software).
>In this respect learning CGI will be helpful but should I learn CGI
>scipting in Perl or Applescript?? I reread my WebStar manual which
>mentioned Applescript is preferable 'cause it supports synschronous

Very briefly and very generally:

I have written Mac CGI's in both MacPerl and Applescript.  After
considerable experimentation, I concluded that the major advantage of
MacPerl is that Perl is a powerful, easy to use language.  The major
advantage of Applescript is that it is low footprint.  With MacPerl, each
CGI needs to start up and run the MacPerl interpreter.  This consumes disk
space, RAM, and makes for a slower startup.  On the other hand, MacPerl,
once running, is in my unverified opinion, vastly faster than AppleScript.

Important points to remember:

1) MacPerl is NOT multithreaded; it can only do one thing at a time.  Thus,
while CGI #1 is processing a request, a hit to CGI #2 has to wait.  The
same is true of Applescript.  This is OK for a low traffic server, except
that if you are using the same Mac as a Web server and as a workstation
(suboptimal, in my opinion, I say as I type this on a Mac running a Web
server), you have to be careful about running other MacPerl tasks.  For
this reason, I would write a CGI in AppleScript on a dual use Mac (Web
Server + Workstation) and in MacPerl on a dedicated Web Server.

2) Server push is very useful for websites that access databases; if you
are returning a lot of data it is nice to send it back a bit at a time so
that the user doesn't get impatient or the client (e.g. Netscape) doesn't
time out.  You access this in MacPerl by naming the CGI .acgi instead of
.cgi.  In my hands, this is a mistake.  Problems with overlapping hits
which simply cause queueing for a .cgi, cause dropped connections or
crashes for an .acgi.  Your mileage may vary, but that's my experience.

3) I have never written a CGI in Frontier; its publishers implemented an
expensive licensing policy at about the time I thought of trying it, and it
is a fairly complex package to learn.  However, it is advertised as
multithreading and folks that I trust tell me that it solves the above
problems.  If this is a serious website, I would evaluate Frontier.

-David Steffen-

David Steffen, Ph.D.
President, Biomedical Computing, Inc. <http://www.biomedcomp.com/>
Phone: (713) 610-9770 FAX: (713) 610-9769 E-mail: steffen@biomedcomp.com

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org