Path: news.cs.au.dk!not-for-mail From: Erik Corry Newsgroups: comp.lang.beta Subject: BETA for CGI Date: 19 Jun 2000 14:42:35 GMT Organization: =?ISO-8859-1?Q?Mj=F8lner?= Informatics ApS Lines: 52 Distribution: world Message-ID: <8ilbgr$8l0j$1@xinwen.cs.au.dk> References: <20000619141125.4936.qmail@noatun.mjolner.dk> NNTP-Posting-Host: amigo.cs.au.dk X-Trace: xinwen.cs.au.dk 961425755 283667 255.255.255.255 (19 Jun 2000 14:42:35 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 19 Jun 2000 14:42:35 GMT User-Agent: tin/pre-1.4-980818 ("Laura") (UNIX) (IRIX64/6.5 (IP27)) Xref: news.cs.au.dk comp.lang.beta:12433 Sascha Kimmel wrote: > Lars Balker Rasmussen said: >> As for Sascha's comment: >>> The only possibility to use BETA for CGI programming is to use BETA as >>> a language for programming a server! >> >> This is not true. > Technically it is possible of course, but I don't think that this is a good > approach, loading an executable file of some megs in size will > 1) take some time > 2) these megs will use up RAM > 3) make it impossible to do this on a high-load server, because you need much > much RAM for this (imagine a high-load-website with 50 calls to your CGI app > (in BETA) per second - if your file has a size of 1MB this means starting 50 > of these files as fast as possible, so that the clients don't have to wait > and "wasting" your RAM with 50MB of code. Most of this should be shared between the instances, so the RAM use would be much smaller. Also if it is called frequently, it would be cached, so it doesn't have to be read in from disk every time. With a perl CGI the perl interpreter would be shared in the same way, but every time you start the perl script the interpreter has to compile the script to its own internal format. The performance tradeoff depends on how large your perl program is, how many different CGI scripts you have, whether perlmod is an option and how heavily you use regular expressions, which are heavily optimised in perl. > I guess the only possibility for a high- or moderate-load site is to use a > language that is embedded in the server (mod_perl or PHP as module e.g.) This is probably true. >> [The implementation of a PERL::CGI-like] >> module for BETA is left as an exercise to the interested reader. > .. which is not easy because only Mjolner has the sourcecode for the BETA > runtime system ... I don't think you need to change the runtime system for this sort of thing. You have the source for almost all the libraries in the BETA system, only the compiler and the runtime system itself is missing. Yours, -- Erik Corry