Re: Lisp backend protocol
- From: Pascal Bourguignon <usenet@xxxxxxxxxxxxxxxxx>
- Date: Tue, 04 Apr 2006 17:02:05 +0200
Tim X <timx@xxxxxxxxxxxxxxx> writes:
Bill Atkins <NOatkinwSPAM@xxxxxxx> writes:
ram@xxxxxxxxxxxxxxxxxx (Stefan Ram) writes:
Ari Johnson <iamtheari@xxxxxxxxx> writes:
Stefan Ram wrote:
SELECT RESULT FROM FACTORIAL WHERE ARGUMENT=5;The problem with this is that you then have a Lisp out there
polling the SQL server, unless I've misunderstood you again (a
good possibility).
A process reads SQL queries, like »SELECT RESULT FROM
FACTORIAL WHERE ARGUMENT=5;« and maps them to Lisp calls, like
»(FACTORIAL 5)«. It then returns the value of this expression
as a single-valued table.
There is no need for polling: A process controlled by
functions written in Lisp acts as the SQL server.
The client believes he is querying tables, while in fact he
is invoking lisp functions.
As another example, »( f( g 2 3 ))« is translated to:
SELECT RESULT FROM f WHERE ARGUMENT =
( SELECT RESULT FROM g WHERE ARGUMENT=2 AND ARGUMENT1=3 );
Hideous!
Thus, a user or PHP-environment knowing how to query an SQL
server can invoke Lisp functions with no need to be aware of it.
I'm afraid I'd have to agree this is hideous and I cannot see what it
would give you as you would essentially be limiting what you could do
in lisp to what you could express in SQL i.e. the question is limited
to SQL expressions and while you could process data in any way you
like to get the answer and return it as a psudo SQL table, the type of
question you can ask is still restricted to the questions you can
ask/express in SQL - in which case, what benefit would you get you
cannot already get with a decent database which supports stored
procedures?
The benefits are obvious howerver. Compare:
$server=mysql_select_db($base,mysql_connect($host,$login,$pwd));
$result=mysql_query("SELECT RESULT FROM f
WHERE ARGUMENT = ( SELECT RESULT FROM g
WHERE ARGUMENT=2
AND ARGUMENT1=3 )",$server);
$row=mysql_fetch_assoc($result);
echo $row['RESULT'];
vs.:
$server=lisp_connect($host,$login,$pwd));
$result=lisp_query("SELECT RESULT FROM f
WHERE ARGUMENT = ( SELECT RESULT FROM g
WHERE ARGUMENT=2
AND ARGUMENT1=3 )",$server);
$row=lisp_fetch_assoc($result);
echo $row['RESULT'];
See? It's exactly the same, there's nothing more to learn. Just
s/mysql/lisp/ to use the lisp server instead of the mysql server. You
could even call it LISQL and hide the fact that you've implemented
that server with a slow interpreted languages from beyond grave.
--
__Pascal Bourguignon__ http://www.informatimago.com/
This is a signature virus. Add me to your signature and help me to live.
.
- Follow-Ups:
- Re: Lisp backend protocol
- From: Tim X
- Re: Lisp backend protocol
- References:
- Lisp backend protocol
- From: Ari Johnson
- Re: Lisp backend protocol
- From: Rob Warnock
- Re: Lisp backend protocol
- From: Ari Johnson
- Re: Lisp backend protocol
- From: Rob Warnock
- Re: Lisp backend protocol
- From: Ari Johnson
- Re: Lisp backend protocol
- From: Ari Johnson
- Re: Lisp backend protocol
- From: Ari Johnson
- Re: Lisp backend protocol
- From: Ari Johnson
- Re: Lisp backend protocol
- From: Ari Johnson
- Re: Lisp backend protocol
- From: Bill Atkins
- Re: Lisp backend protocol
- From: Tim X
- Lisp backend protocol
- Prev by Date: Re: Implementation of control structures
- Next by Date: Re: Lisp backend protocol
- Previous by thread: Re: Lisp backend protocol
- Next by thread: Re: Lisp backend protocol
- Index(es):
Relevant Pages
|