Path: news.cs.au.dk!not-for-mail From: Sascha Kimmel Newsgroups: comp.lang.beta Subject: Re: I feel a bit discriminated Date: 19 Jun 2000 14:11:25 -0000 Organization: University of Aarhus, Department of Computer Science (DAIMI) Lines: 111 Approved: mailtonews@cs.au.dk Distribution: world Message-ID: <20000619141125.4936.qmail@noatun.mjolner.dk> Reply-To: Sascha Kimmel NNTP-Posting-Host: daimi.cs.au.dk X-Trace: xinwen.cs.au.dk 961423914 282880 255.255.255.255 (19 Jun 2000 14:11:54 GMT) X-Complaints-To: news@cs.au.dk NNTP-Posting-Date: 19 Jun 2000 14:11:54 GMT Xref: news.cs.au.dk comp.lang.beta:12428 Lars Balker Rasmussen said: > Atle writes: > > Of course, since I know so little of web-scripting, I may be confusing > > the server side with the client side. > > You are confusing the two. > > Client side: > * Applets are client-side (java-)applications delivered by the > server. > * Javascript is embedded scripting in HTML, handled by the > web-browser. ... and JScript(TM) by M$, and VBScript by M$... :) > Server side: > * Servlets are server-side (java-)applications executing on the > server, presenting results to the client. > * Serverside scripting such as PHP and ASP are embedded in HTML, but > executed on the server, so all the client sees is HTML. > * CGI (Common Gateway Interface) is a standard to execute programs > on the server to present information to the user "independent" of > HTML. It is independent of the programming language used! > > 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. 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.) > Several of the CGI-programs on Mjølners webserver are > written in BETA. After all, CGI is all about reading some stuff from > environment variables > > '$(QUERY_STRING)' > -> ExpandEnvVar(# defaultValue:: (# do '' -> envvarvalue[]; #) #) > -> params[]; I know! > and printing the results > > 'Content-type: text/html\n\n' -> s.puttext; > '' -> s.putline; > 'Result' -> s.putline; > '

Result

Result!' -> s.putline; > '' -> s.putline; Simple, but in PHP you don't even need so many language statements: --------X<---------------------------------------------- Result

Result

--------X<---------------------------------------------- Or one example in Perl: --------X<---------------------------------------------- print < Result

Result

Hello, you came here from $ENV{'HTTP_REFERER'} EOF --------X<---------------------------------------------- > Granted, it's not as suited for CGI-work as Perl with the CGI module, > but that's not the same as saying it's not possible. Writing a similar Sorry, I meant that it's not technically impossible but that it is no alternative for me to load huge executable files again and again.... > 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 ... Regards, Sascha Kimmel