PHP
an interpreted language, which is quite popular for web applications.
It's basically a procedural language.
One of the tripple P (Php, Perl, Python) choice
of the lamp basic web service setup.
To give php
users a feeling, here a side by side comparison of the php and
Askemos way. We select from a data base table and format as an html
description list:
| php |
Askemos |
<?
$link=mysql_connect("localhost",
"user", "pass");
$query = "use test";
if(!mysql_query($query, $link") {
die("no data base");
}
?>
|
This initialization part does not exist in
Askemos applications. Instead there is a line in the XSQL
connection administration file. |
<dl>
<?
$query = "select Topic, Description from db";
$result = mysql_query($query, $link);
while($row=mysql_fetch_array($result)) {
echo "\n<dt>".$row["Topic"]."</dt><dd>".
$row["Description"]."</dd>");
}
mysql_free_result($result);
?>
</dl>
|
<xsql:query connection="demo"
row-element="" rowset-element="dl">
select Topic dt, Description, dd from db
</xsql:query>
|
No matter why one might choose PHP as a web
script language -- but as a computer language it's a rather poor
design, really. One word of warning: some of it's flaws let it appear
to be it a rather poor choice security wise.
:Q: Whats the difference between
{PHP, Perl, most other languages} and
Askemos' XSLT / NameSpaceDSSSL for web scripting?
:A: In most languages the resulting document
is constructed charachter by character from quoted strings
of the programming language.
This incures a lot of quoting and can produce invalid output.
In contrast in Askemos, the result is created as a document tree
from components of the input tree and syntax tree of
the running programm.
This safes typing, ungly code and ensures
at least well formed results.
See also selforum (german).
Note: There is a
phptools kit under development, which will eventually
allow to convert PHP to Scheme
(and with a little help of a to be developed rewritng engine
equivalent DSSSL code).