From: Torsten Zühlsdorff on
Hello,

i am a german developer which reads this newsgroup for some month. Sadly
reading english is easier for me, than writting it ;) So i hope you can
understand me.

First some words to me: I am 23 year old boy and write programms nearly
since 9 years. The last years i have specialced at the development of
internet applikations - often with php.
The last 3 years i develop a framework for the easy implementation of
browsergames. All in PHP It is damend small, fast and really nice. The
best PHP-Code i every see ;)

But now i want to do something in lisp, because lisp really impress me.
So i want to perform some webdevelopment (if i ever get tbnl run ^^),
but i do not want to fail on the differences between the development
methods in php and lisp. Therefore i ask for them.

In PHP a Script is called, i include needed other scripts, parse and
analyse config files, manage db-connections, evaluate the input, work on
the input and so on.

I have read, that lisp is "always" running while the php-script is at
his end after some milliseconds and will start again at the next call -
right?
I have seen, that lisp has his own html-output-"implementation". Can i
work with xml/xslt or other templates?
And what are other differences in developing webapplikations in PHP or LISP?

Greetings from Germany,
Torsten
From: Robert Uhl on
Torsten Zühlsdorff <thornythegod(a)arcor.de> writes:
>
> i am a german developer which reads this newsgroup for some
> month. Sadly reading english is easier for me, than writting it ;) So
> i hope you can understand me.

No worries--your English is better than my German.

> But now i want to do something in lisp, because lisp really impress
> me. So i want to perform some webdevelopment (if i ever get tbnl run
> ^^), but i do not want to fail on the differences between the
> development methods in php and lisp. Therefore i ask for them.

Always a good idea. Also, bear in mind that there are several different
Lisp web development environments: the key is to find one which works
similarly to the way you think. If TBNL does that for you, excellent.

> In PHP a Script is called, i include needed other scripts, parse and
> analyse config files, manage db-connections, evaluate the input, work
> on the input and so on.
>
> I have read, that lisp is "always" running while the php-script is at
> his end after some milliseconds and will start again at the next call
> - right?

You _could_ configure your webserver to start a Lisp process which would
load itself, load a script then generate output--but the overhead would
be insane. From what I can discern the typical pattern is to have a
Lisp webserver running constantly (and generally hidden behind Apache or
some other server), which responds to user requests as needed.
Depending on the paradigm, the webserver might have scripts or templates
which it executes, and these might be reloaded when updated on disk.

> I have seen, that lisp has his own html-output-"implementation". Can i
> work with xml/xslt or other templates?

There are several HTML-output languages, from those which operate inside
of Lisp, perhaps by calling some macro with arguments representing the
code, e.g.:

(html
(:html
(:head (:title "Foo"))
((:body lang "en-GB")
(:p "Bar baz quuz"))))

To those which involve external template files which call Lisp
functions, e.g.:

<html>
<head><title><page_title/></title></head>

<body lang="<page_language />">
<page_content/>
</body>
</html>

To those which involve external templates which just do simple variable
substitution:

<html>
<head><title><% title %></title></head>
<body lang="<% lang %>">
<% page_content %>
</body>
</html>

Generally these approaches can be mixed together as you like, although
of course doing so adds a certain amount of complexity.

To more directly answer your question, you can see that you can generate
anything, not just HTML. So you could generate XML if desired. I'm
frankly not certain if there are XML-manipulation libraries available,
but I imagine so.

> And what are other differences in developing webapplikations in PHP or
> LISP?

Well, for one thing the default Common Lisp database library doesn't
seem to have the security issues that PHP database access methods have,
which is nice.

OTOH, PHP seems to have a lot more libraries out-of-the box. There are
some very nice CL libraries out there, but finding them can be
interesting. Your countryman Dr. Edi Weitz writes some absolutely
excellent Lisp code (including TBNL, so I'm guessing you've seen his
name before); his site <http://weitz.de/> is well-worth a look when
you're searching for libraries.

But I think the biggest hurdle for you will be the different web
paradigm between PHP and Lisp. Once you get over that, I believe you'll
really enjoy programming Common Lisp.

Tschuß!

--
Robert Uhl <http://public.xdi.org/=ruhl>
....the world's richest Chief Software Architect continues a record for design
elegance unmatched since the Yugo. --re. Windows XP, Forbes Magazine
From: Torsten Zühlsdorff on
Robert Uhl schrieb:

>>i am a german developer which reads this newsgroup for some
>>month. Sadly reading english is easier for me, than writting it ;) So
>>i hope you can understand me.
>
> No worries--your English is better than my German.

Thank you - i will keep this in mind ;)

>>But now i want to do something in lisp, because lisp really impress
>>me. So i want to perform some webdevelopment (if i ever get tbnl run
>>^^), but i do not want to fail on the differences between the
>>development methods in php and lisp. Therefore i ask for them.
>
> Always a good idea. Also, bear in mind that there are several different
> Lisp web development environments: the key is to find one which works
> similarly to the way you think. If TBNL does that for you, excellent.

Ok. Till now i was not able to get TBNL work. So there is enough
flexibility to check some other environments ;)
Which else there are?

>>I have seen, that lisp has his own html-output-"implementation". Can i
>>work with xml/xslt or other templates?
>
> There are several HTML-output languages, from those which operate inside
> of Lisp, perhaps by calling some macro with arguments representing the
> code, e.g.:
>
> [example-code]
>
> To those which involve external template files which call Lisp
> functions, e.g.:
>
> [example-code]
>
> To those which involve external templates which just do simple variable
> substitution:
>
> <html>
> <head><title><% title %></title></head>
> <body lang="<% lang %>">
> <% page_content %>
> </body>
> </html>
>
> Generally these approaches can be mixed together as you like, although
> of course doing so adds a certain amount of complexity.
>
> To more directly answer your question, you can see that you can generate
> anything, not just HTML. So you could generate XML if desired. I'm
> frankly not certain if there are XML-manipulation libraries available,
> but I imagine so.

Some time ago, i used a template engine which do variable substitution
on a higher level. It support loops and conditions, but later i tend to
use XML/XSLT, because there is now a native support by PHP.
I will look for such libraries for LISP.

>>And what are other differences in developing webapplikations in PHP or
>>LISP?
>
> Well, for one thing the default Common Lisp database library doesn't
> seem to have the security issues that PHP database access methods have,
> which is nice.

Yes, but i think that the commun problems which interactive Webpages
like Session-Hijacking&-Fixation, RCE, SQL-Injection will not be safed
by LISP ? ;)

> OTOH, PHP seems to have a lot more libraries out-of-the box. There are
> some very nice CL libraries out there, but finding them can be
> interesting. Your countryman Dr. Edi Weitz writes some absolutely
> excellent Lisp code (including TBNL, so I'm guessing you've seen his
> name before); his site <http://weitz.de/> is well-worth a look when
> you're searching for libraries.

Yes - i know the site and already have bookmarked it.
I try the tutorial to install TBNL, but i have problems with installing
Araneida at the moment. The installation of mod_lisp2 was no problem,
but Araneida seems to need a working lisp. I have clisp on my Mandriva
Linux, but if i use the given commands, clisp mentioned that there is no
asdf.
Slowly i understand why so many people say, that the first hurd to lisp
is to get a lisp-environment run.

> But I think the biggest hurdle for you will be the different web
> paradigm between PHP and Lisp. Once you get over that, I believe you'll
> really enjoy programming Common Lisp.

Till now i believe (and hope) that i can take this hurd, because i love
to programm in different paradigm and languages. We will see :)

Thank for your help,

> Tschuß!
Tschueß!

Torsten
From: John Thingstad on
On Thu, 07 Sep 2006 15:42:21 +0200, Torsten Z?hlsdorff
<thornythegod(a)arcor.de> wrote:

>
> I have read, that lisp is "always" running while the php-script is at
> his end after some milliseconds and will start again at the next call -
> right?
> I have seen, that lisp has his own html-output-"implementation". Can i
> work with xml/xslt or other templates?
> And what are other differences in developing webapplikations in PHP or
> LISP?
>
> Greetings from Germany,
> Torsten

If you are used to PHP AllegroServe and ActionScript may be more to your
liking.
Both are available for free in one package.
In particular it takes care of sessions like PHP.
The big difference is that PHP can only run one script at a time.
It times out after 30 seconds. Lisp is a resident program it can handle
many connections at once and share data between the connections.
You can work with XSLT but quite frankly woring with HTML as list's
is more powerfull in Lisp. Try Alegro Coimmon Lisp (www.franz.com).
They have a very stable and good web developement environment.

--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
From: Stefan Nobis on
Torsten Zühlsdorff <thornythegod(a)arcor.de> writes:

> flexibility to check some other environments ;)
> Which else there are?

Hmmm... I can think of Webactions (based on (portable) AllegroServe),
UCW and TBNL. Most other frameworks (that I looked at) are based on
one of these three.

I like TBNL mainly because of two reasons: It's easy to control the
URLs and not too many dependencies. UCW has the (dis)advantage to go
quite a different route like classic approches (namley using
continuations) -- quite enlightening to take a look at.

> but later i tend to use XML/XSLT

Uh, I really dislike XML, but it surely has it's applications.

> clisp mentioned that there is no asdf.

Tried (require 'asdf)? Is ASDF installed?

--
Stefan.