From: Pascal Obry <p.obry@wanadoo.fr>
Subject: Re: Ada Advocacy - WPG (Web Page Generation) scheme
Date: 05 Oct 2003 11:17:46 +0200
Date: 2003-10-05T09:17:48+00:00 [thread overview]
Message-ID: <ud6dc6o1x.fsf@wanadoo.fr> (raw)
In-Reply-To: blnaim$ebkh3$1@ID-25716.news.uni-berlin.de
"Nick Roberts" <nickroberts@blueyonder.co.uk> writes:
> I've had an idea (not a blindingly original one) which might be a way to
> help promote Ada. Dynamic web content is all the rage these days; there are
> dozens of techniques used by millions of people to achieve it, including but
> not limited to SSI, ASP, JSP, PHP, CGI, and many other acronyms.
>
> How to get Ada into this picture?
By looking at AWS :)
> I think one of the big attractions of schemes like ASP, JSP, and PHP (to
> name but three) is that to use them you merely have to embed a few special
> directives into an otherwise ordinary HTML file, and often the directives
> are very simple.
Yep, but in many places you have scripts and this is plain wrong. Having
script into a Web page is mixing layout (HTML) and code. Both must really be
separated, one of the reason is that they are done by differents peoples.
> So, it seems to me, an attractive scheme would be to allow Ada code to be
> embedded into an HTML file.
No, I don't think this is right. Note that Java is moving on the opposite side
just because of this problem. A script in a page means bugs in Web document,
this is wrong. Look at the Java struts.
In AWS we have a Templates_Parser engine which can compile on-the-fly
templates file and interpret them. This is really quick and only some "tags"
needs to be added into the HTML (or whatever) document.
> A special program would transform this file into
> a complete Ada program (procedure Main is ...) in a .adb file. The Ada
> program would be a complete CGI program: you upload it, and compile it into
> your cgi-bin directory.
This is again the wrong way. CGI (Common Gateway Interface) is the old way to
develop Web apllications. A CGI have to be spawned, this is a new process on
the server side. This scheme has been dropped long time ago for the
Application Server framework (JSP, ASP, PHP...).
> It could 'with' a simple package providing support
> for the CGI protocol (and HTTP/HTML web page generation); I'm aware of an
> existing AdaCGI package that might suit this.
Which must be history now :)
> Since a TLA (three-letter acronym) seems to be obligatory for these things,
Good, lets go with AWS :)
> we might call it 'WPG' for Web Page Generation. The source file containing
> the HTML with embedded Ada could then have the .wpg extension. Other
> possibilities that occur to me are: DWP (Dynamic Web Pages); HRA (Hypertext
> Response with Ada). The sillier the better, really.
>
> The special program doing the translation (from WPG to Ada) - let's call it
> the WPGT - would (naturally!) be written in Ada, and I think it should be
> quite simple to write. Obviously I'm volunteering, if nobody else makes a
> claim.
Ok, this is Templates_Parser (see AWS.Templates). BTW, AWS's templates engine
is very fast. Lot faster than JSP, PHP or ASP.
> I propose the following embedding syntax.
[example removed]
BTW, I found it quite unreadable.
> One big selling point would be that your dynamic web pages are generated by
> a native code compiled program; a bit more efficient than a script. Another
> point is that you have the full facilities of Ada programming available to
> you (utility packages, bindings, and so on).
In AWS, the "scripts" are compiled into your main application.
> Other possibilities include: allow the name of a package to be 'withed'
> between [+ +] brackets; provide some handy translation-time values, e.g.
> [?UPDATE?] to be replaced by the date and time the translation is executed.
>
> Some issues I can see are:
>
> (1) HTTP headers. You'll see my example program above generates one HTTP
> header line. I get the impression that the headers a CGI program is supposed
> to generate are not very well defined anywhere. I think AdaCGI has a
> procedure to generate CGI headers; handy, but correct?
Supported in AWS.
> (2) Conversion of < > and & characters into escaped forms in fields. I think
> AdaCGI has a function to do this; could it be done automatically?
Supported in AWS.
> (3) Access to databases. Most CGI programs and web scripts need to get their
> information from a database, and some update databases too. I'm aware of a
> project to produce a binding to PostgreSQL and MySQL; might this be what is
> needed?
Supported in AWS, just use GNADE or whatever binding to ODBC, MySQL...
> (4) Most hosting companies don't allow binary CGI programs, for "security
> reasons" (i.e. their own stupidity). Of those which do, many refuse to
> install GNAT (despite providing GCC C++). Outrageous. However, I know at
> least one hosting company (Liquid Web, http://www.liquidweb.com/ ) who is
> willing to install GNAT, so maybe this isn't a hopeless problem.
This is a real problem. Not solved, you need to use PHP...
> Comments?
Please have a look at AWS before doing this. As I said most of the ideas here
are old-fashioned way to build Web applications.
Also note that a Web server is only a start. You'll need to support SOAP,
WSDL, SMTP, LDAP... to build real Web applications... All these standard are
supported by AWS.
Just in case : http://libre.act-europe.fr/aws
Pascal.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://perso.wanadoo.fr/pascal.obry
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
next prev parent reply other threads:[~2003-10-05 9:17 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-04 20:29 Ada Advocacy - WPG (Web Page Generation) scheme Nick Roberts
2003-10-04 21:17 ` Larry Kilgallen
2003-10-05 3:32 ` Nick Roberts
2003-10-05 3:51 ` Larry Kilgallen
2003-10-05 9:19 ` Stephane Richard
2003-10-04 21:18 ` Stephane Richard
2003-10-05 3:21 ` Nick Roberts
2003-10-05 9:16 ` Preben Randhol
2003-10-05 9:26 ` Pascal Obry
2003-10-06 0:00 ` Nick Roberts
2003-10-06 0:06 ` Stephane Richard
2003-10-06 8:56 ` chris
2003-10-06 16:31 ` Pascal Obry
2003-10-06 18:30 ` Wiljan Derks
2003-10-06 19:45 ` Martin Dowie
2003-10-08 18:22 ` Wiljan Derks
2003-10-09 17:48 ` Pascal Obry
2003-10-09 21:19 ` Wiljan Derks
2003-10-10 7:42 ` Preben Randhol
2003-10-10 18:26 ` Wiljan Derks
2003-10-07 17:21 ` Pascal Obry
2003-10-08 7:18 ` Jean-Pierre Rosen
2003-10-08 19:09 ` Wiljan Derks
2003-10-06 1:07 ` Wes Groleau
2003-10-06 3:15 ` Nick Roberts
2003-10-05 9:14 ` Preben Randhol
2003-10-05 1:00 ` Wes Groleau
2003-10-05 3:05 ` Nick Roberts
2003-10-06 1:03 ` Wes Groleau
2003-10-08 18:14 ` Jacob Sparre Andersen
2003-10-05 9:17 ` Pascal Obry [this message]
2003-10-06 3:53 ` David Trudgett
2003-10-06 7:41 ` Dmitriy Anisimkov
2003-10-06 16:09 ` Pascal Obry
2003-10-06 20:28 ` Georg Bauhaus
2003-10-05 9:41 ` Preben Randhol
2003-10-05 11:30 ` Simon Wright
2003-10-05 14:59 ` Georg Bauhaus
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox