From: Andrei Stebakov
Subject: Embedding lisp inside html
Date: 
Message-ID: <2e04fd43.0410291406.2fa9231d@posting.google.com>
Hi,

I was wondering if it's possible to embed lisp in html
the way PHP does? I really want to try switching from
PHP to lisp and I have a web site that has a bunch of
pages with PHP script (*.php ones). 
The only examples of lisp I've seen so far were pure
lisp scripts that generate html. So, how about a
mixture of html and lisp in one page?

Thanks in advance.
Andrei

From: Manuel Simoni
Subject: Re: Embedding lisp inside html
Date: 
Message-ID: <37707ed1.0410300302.63b3a378@posting.google.com>
·········@yahoo.com (Andrei Stebakov) wrote:

> I was wondering if it's possible to embed lisp in html
> the way PHP does? I really want to try switching from
> PHP to lisp and I have a web site that has a bunch of
> pages with PHP script (*.php ones). 
> The only examples of lisp I've seen so far were pure
> lisp scripts that generate html. So, how about a
> mixture of html and lisp in one page?

CL-EMB seems to do what you want.
http://common-lisp.net/project/cl-emb/examples.html

See also:
http://common-lisp.net/projects#Web_programming
http://www.cliki.net/Web
From: Andrei Stebkov
Subject: Re: Embedding lisp inside html
Date: 
Message-ID: <4183b927@news.nnrp.ca>
Manuel Simoni wrote:


> CL-EMB seems to do what you want.
> http://common-lisp.net/project/cl-emb/examples.html
> 
> See also:
> http://common-lisp.net/projects#Web_programming
> http://www.cliki.net/Web

Thanks, I still can't understand how it communicates with apache and if it
does how to configure apache to work with the library. Sorry I couldn't
find it in the readme that comes with the package. Maybe I just
misunderstood the consept of the lib. I thought it work in a way PHP
embedded script does.

Andrei
From: Stefan Scholl
Subject: Re: Embedding lisp inside html
Date: 
Message-ID: <z0q6ojrcz1pt.dlg@parsec.no-spoon.de>
On 2004-10-30 17:53:12, Andrei Stebkov wrote:
> Manuel Simoni wrote:
>> CL-EMB seems to do what you want.
>> http://common-lisp.net/project/cl-emb/examples.html
> 
> Thanks, I still can't understand how it communicates with apache and if it
> does how to configure apache to work with the library. Sorry I couldn't
> find it in the readme that comes with the package. Maybe I just
> misunderstood the consept of the lib. I thought it work in a way PHP
> embedded script does.

You've asked on the TBNL list, so I though you know how to do that.


(emb:execute-emb #P"path/to/my/template.extension-i-want")

This just runs the code in path/to/my/template.extension-i-want and
returns a string.

You need something like TBNL (+ mod_lisp) or a standalone server
like Araneida (see <http://www.cliki.net/Web> for more solutions) to
serve your pages.

<http://common-lisp.net/project/cl-emb/examples.html#build-dropdown>
is a small example of CL-EMB used by a TBNL application. It gets the
current selected product with (tbnl:parameter "product").

(And yes, this is just an example. There are better ways to build a
dropdown with a selected option. Without embedding CL -- just the
template tags.)


I'd say you try the TBNL test code as described in
<http://weitz.de/tbnl/#install>. Then you can write your own
function which emits the string returned by EMB:EXECUTE-EMB, and add
this function to the dispatch table. After that you have a
playground for further experiments.
From: Mark Carter
Subject: Re: Embedding lisp inside html
Date: 
Message-ID: <2uhddpF2a6mdtU1@uni-berlin.de>
Manuel Simoni wrote:

> ·········@yahoo.com (Andrei Stebakov) wrote:
> 
> 
>>I was wondering if it's possible to embed lisp in html
>>the way PHP does? I really want to try switching from

Forgive the ramblings of a complete noob like me, but does anyone find 
the whole idea of embedding PHP/Perl/Lisp/Python/Ruby/whatever in html, 
or generating html from your <insert fav language here> a bit of an 
achey breaky concept? Please note I'm not criticising anyone or any 
language in particular.

I've also wondered how well all this stuff scales.

It seems to me that what developers really need is a kind of 
user-interface abstraction which separates out the guts of the 
application from the gui. That way, the engine needn't know, and needn't 
care, how inputs are made, and how outputs are displayed. Maybe the 
inputs are coming via the web, Tk, GTK, or even the humble command line. 
It would definitely make apps more flexible, and probably make them more 
robust, too.
From: Christopher C. Stacy
Subject: Re: Embedding lisp inside html
Date: 
Message-ID: <uekjfswwa.fsf@news.dtpq.com>
Mark Carter <··@privacy.net> writes:

> It seems to me that what developers really need is a kind of
> user-interface abstraction which separates out the guts of the
> application from the gui. That way, the engine needn't know, and
> needn't care, how inputs are made, and how outputs are
> displayed. Maybe the inputs are coming via the web, Tk, GTK, or even
> the humble command line. It would definitely make apps more flexible,
> and probably make them more robust, too.

This was one of the things that CLIM was originally about.
From: Andras Simon
Subject: Re: Embedding lisp inside html
Date: 
Message-ID: <klr7ngfrhz.fsf@hexagon.renyi.hu>
·········@yahoo.com (Andrei Stebakov) writes:

> Hi,
> 
> I was wondering if it's possible to embed lisp in html
> the way PHP does? I really want to try switching from
> PHP to lisp and I have a web site that has a bunch of
> pages with PHP script (*.php ones). 
> The only examples of lisp I've seen so far were pure
> lisp scripts that generate html. So, how about a
> mixture of html and lisp in one page?

See http://home.comcast.net/~bc19191/blog/041012.html for a list of options.

Andras