For Programmers: Free Programming Magazines  


Home > Archive > Lisp > June 2005 > LISP for web









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author LISP for web
Damir

2005-06-08, 8:58 am

Hello!

I'm seeing more and more people are choosing lisp as vehicle for their
next web project.

I wonder if this is the best possible option?

Features like libraries, persistent SQL and sessions comes to mind. Can
(free) lisp environment scale up with let's say RubyOnRails or
Erlang...

Cheers,
Damir

Pascal Bourguignon

2005-06-08, 8:58 am

"Damir" <damir@x-si.org> writes:

> Hello!
>
> I'm seeing more and more people are choosing lisp as vehicle for their
> next web project.
>
> I wonder if this is the best possible option?
>
> Features like libraries, persistent SQL and sessions comes to mind. Can
> (free) lisp environment scale up with let's say RubyOnRails or
> Erlang...


Of course they can and they will, if more and more people who are
choosing lisp for their web project share (parts) of their
development.

--
__Pascal Bourguignon__ http://www.informatimago.com/
Wanna go outside.
Oh, no! Help! I got outside!
Let me back inside!
Marco Baringer

2005-06-08, 8:58 am

"Damir" <damir@x-si.org> writes:

> Hello!
>
> I'm seeing more and more people are choosing lisp as vehicle for their
> next web project.


there's a reason for this (and it isn't hype).

> I wonder if this is the best possible option?


depends.

> Features like libraries, persistent SQL and sessions comes to mind. Can
> (free) lisp environment scale up with let's say RubyOnRails or
> Erlang...


yes, yes, yes and yes.

ask a more specific question and you may get a more specific answer.

--
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
Damir

2005-06-08, 8:58 am

Thanks!

I'm very interested in having persistent lisp-sql connection, so
there's no open/close overhead for each request. I've found this
(http://common-lisp.net/project/pg/), but no sign of persistance. Any
clues?

http sessions? Is UCV the right answer? How is this issue treated in
real world with lisp?

Cheers,
Damir

Alexander Schreiber

2005-06-08, 8:58 am

Damir <damir@x-si.org> wrote:
> Thanks!
>
> I'm very interested in having persistent lisp-sql connection, so
> there's no open/close overhead for each request. I've found this
> (http://common-lisp.net/project/pg/), but no sign of persistance. Any
> clues?


Depends on your programming model: if you are using CGIs which are
started for each request, then you'd connect to the database on startup,
do all the queries needed and disconnect on CGI exit.
With an application server I'd also establish a handful of connections
to the database, use some kind of connection pooling layer and
disconnect the database connections only on shutdown of the application
server.

Regards,
Alex.
--
"Opportunity is missed by most people because it is dressed in overalls and
looks like work." -- Thomas A. Edison
Damir

2005-06-08, 8:58 am

Edi Weitz wrote:
> CLSQL <http://clsql.b9.com/> offers connection pools. However, just
> because everyone in the PHP/Perl/Java camps uses SQL databases that
> doesn't necessarily mean that /you/ have to use them. There are
> several other solutions and it's worth thinking about them before you
> just follow the herd.


I'd realy like to know about these alternatives.

The thing is, I'm not expirienced lisp user. I just need to do this web
app. I'm used to Apache, Pgsql, mod_perl and template toolkit. I know
if I use this setup, although I know it well, I won't have the edge I
need to compeete.

That's why I'm here in the first place. I want to get as much options
as I can, before I start hammering with perl.

Cheers,
Damir

Edi Weitz

2005-06-08, 8:58 am

On 8 Jun 2005 02:58:09 -0700, "Damir" <damir@x-si.org> wrote:

> I'd realy like to know about these alternatives.
>
> The thing is, I'm not expirienced lisp user. I just need to do this
> web app. I'm used to Apache, Pgsql, mod_perl and template toolkit. I
> know if I use this setup, although I know it well, I won't have the
> edge I need to compeete.
>
> That's why I'm here in the first place. I want to get as much
> options as I can, before I start hammering with perl.


I also came from Apache/mod_perl/SQL and it's kind of hard to get rid
of this... :)

Unfortunately, there's no easy and perfect way to find a solution
that's better for you - it depends on your problem domain and your
preferences. I'm afraid you'll have to play around with a couple of
alternatives and see for yourself (and come back here with specific
questions if needed). Really, install stuff and try it, it doesn't
suffice to just skim a few documentation pages.

Things you could/should try:

1. BKNR <http://bknr.net/>

That's a complete framework for websites including persistent
storage, and it comes with good documentation. No apache or SQL
involved... :)

2. Look at Lisp-y databases like Plob! or Elephant.

<http://plob.sf.net/>
<http://common-lisp.net/project/elephant/>

3. Checkout CLSQL's object-oriented layer atop SQL.

Search CLiki for more.

HTH,
Edi.

--

Lisp is not dead, it just smells funny.

Real email: (replace (subseq "spamtrap@agharta.de" 5) "edi")
drewc

2005-06-08, 8:58 pm

Damir wrote:
> Hello!
>
> I'm seeing more and more people are choosing lisp as vehicle for their
> next web project.
>


I've been using CL (UCW+clsql) for all my web dev over the last year.

Have a good look at UncommonWeb, and you'll see that we do things in
Lisp that you cannot do (without greenspunning) in any other language.

>
> Features like libraries, persistent SQL and sessions comes to mind. Can
> (free) lisp environment scale up with let's say RubyOnRails or
> Erlang...


I've never used Erlang or RoR (though keep your eyes peeled for
LISP-ON-LINES, which i am in the proccess of releasing) but from my own
experience, Common Lisp is more than able to withstand a slashdotting.
(a web site i run, http://lisp.tech.coop, received over 100,000 hits in
a day, and i didn't even notice a slowdown).

CLSQL has the best O/R mapping i've ever used. Sessions? whats that
about? how about Continuations instead... embrace the back button, learn
to love the "open in new tab" :)

http://lisp.tech.coop/Web%20Programming has a good outline of the
available technologies, and i really recommend:

http://lisp.tech.coop/Web%2FContinuation as well.

(shameless-plug
"If you are looking for a webhosting company to host your application,
and you want full lisp support and great technical support as well, have
a look at http://tech.coop. We'll not only host your stuff, but we help
you design and maintain it as well, and answer all your questions like
'how can i connect slime to my running application' and 'how can i serve
images if i'm using araneida'. I'm not aware of any other host that
offers what we do in the lisp space, and certainly not on a
not-for-profit basis.")


--
Drew Crampsie
drewc at tech dot coop
"Never mind the bollocks -- here's the sexp's tools."
-- Karl A. Krueger on comp.lang.lisp
otqocrkwvv@pvoalfotpmezsaq.net

2005-06-09, 3:58 am

drewc <drewc@rift.com> wrote in news:9GHpe.1604805$6l.960225@pd7tw2no:

>
> I've never used Erlang or RoR (though keep your eyes peeled for
> LISP-ON-LINES, which i am in the proccess of releasing) but from my
> own experience, Common Lisp is more than able to withstand a
> slashdotting. (a web site i run, http://lisp.tech.coop, received over
> 100,000 hits in a day, and i didn't even notice a slowdown).
>


Can you elaborate on which Lisp implementation and which
Lisp packages you are using to run lisp.tech.coop?
Web server, html generation,... etc.
Degree of difficulty to set up,... etc.

I have been looking for a while for a set of Lisp
tools (open source) that will be straight forward
to set up but so far i haven't found any.

All these processes seem to be very complex in the Lisp world.
Setting up this package, and that package, and the other...
just to do a web app. Perhaps not so complex for Lisp gurus
but can be very discouraging to others.

On the other hand, I have set up the PLT Scheme web server
without much difficulty and it does work.


R. Mattes

2005-06-09, 8:58 am

On Wed, 08 Jun 2005 19:29:09 +0000, drewc wrote:

> Damir wrote:
>
> I've been using CL (UCW+clsql) for all my web dev over the last year.


Yes, so have I. All in all it was a rather pleasant journey so far.

> Have a good look at UncommonWeb, and you'll see that we do things in
> Lisp that you cannot do (without greenspunning) in any other language.


UnCommonWeb is quite nice (i'm using parts of it for my stuff) but you
should give credit to its parents: the idea of continuation based web
frameworks is rather old in Scheme circles (IIRC Quenec was one of the
early proponents). In discussing cont. based frameworks i think it's fair
to distinguish between Scheme (with its full call/cc support) and Lisp.
The framework that kind of triggered the big interest in cont. based web
programming was most likely SeaSide - a Smalltalk framework (and the
article "Walking on the Seaside"). Following UCW's development one
sometimes sees the _limits_ of CL. Marco's framework "fakes" true
continuations with clever code walkers the rewrite the application code
into CPS style code. This is fun when it works but can result in sometimes
unexpected results. I guess a Schemer might be tempted to say that any
decent cont. based web framework will end up with a bad implementation of
call/cc :-)

>
> I've never used Erlang or RoR (though keep your eyes peeled for
> LISP-ON-LINES, which i am in the proccess of releasing) but from my own
> experience, Common Lisp is more than able to withstand a slashdotting.
> (a web site i run, http://lisp.tech.coop, received over 100,000 hits in
> a day, and i didn't even notice a slowdown).


Yes, but i wouldn't consider this high load.

> CLSQL has the best O/R mapping i've ever used. Sessions? whats that
> about? how about Continuations instead... embrace the back button, learn
> to love the "open in new tab" :)


Sometimes these things are just what you want, sometimes they introduce
a strange semantic.

> http://lisp.tech.coop/Web%20Programming has a good outline of the
> available technologies, and i really recommend:
>
> http://lisp.tech.coop/Web%2FContinuation as well.


Those pages are a good collection of the current tools, thank's for
putting them together.

Cheers, Ralf Mattes
> (shameless-plug
> "If you are looking for a webhosting company to host your application,
> and you want full lisp support and great technical support as well, have
> a look at http://tech.coop. We'll not only host your stuff, but we help
> you design and maintain it as well, and answer all your questions like
> 'how can i connect slime to my running application' and 'how can i serve
> images if i'm using araneida'. I'm not aware of any other host that
> offers what we do in the lisp space, and certainly not on a
> not-for-profit basis.")


Marco Baringer

2005-06-09, 8:58 am

"R. Mattes" <rm@mh-freiburg.de> writes:

> UnCommonWeb is quite nice (i'm using parts of it for my stuff) but you
> should give credit to its parents: the idea of continuation based web
> frameworks is rather old in Scheme circles (IIRC Quenec was one of the
> early proponents). In discussing cont. based frameworks i think it's fair
> to distinguish between Scheme (with its full call/cc support) and Lisp.


[proving once again that common lisp is the borg of programming languages:]

the first paper i've been able to find which deals explicitly with
continuations as web applications is Christian Queinnec's 2000 paper
"The Influence of Browsers on Evaluators or, Continuations to Program
Web Servers" (http://www-spi.lip6.fr/~queinnec/PDF/webcont.pdf). As
far as UCW is concerned Queinnec's book L.i.S.P. was very helpfull in
writing the cps transformer used to fake continuations. Queinnec is a
very smart cookie and writes very readable papers, i would suggest
looking around his site: http://www-spi.lip6.fr/~queinnec/WWW/Queinnec.html

> The framework that kind of triggered the big interest in cont. based web
> programming was most likely SeaSide - a Smalltalk framework (and the
> article "Walking on the Seaside").


SeaSide was, afaik, the first continuation based web framework to
become popular and talked about on the web, though PLT scheme's web
framework was the first.

> Following UCW's development one
> sometimes sees the _limits_ of CL. Marco's framework "fakes" true
> continuations with clever code walkers the rewrite the application code
> into CPS style code.


for what its worth i'm currently working on a small interpreter which,
combined with some of the code from sacla, will raise those limits
substantially (but not remove them completely).

> This is fun when it works but can result in sometimes
> unexpected results. I guess a Schemer might be tempted to say that any
> decent cont. based web framework will end up with a bad implementation of
> call/cc :-)


and they'd be right (see preceding paragraph).

--
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
Peter Scott

2005-06-09, 3:59 pm

Marco Baringer wrote:
> "R. Mattes" <rm@mh-freiburg.de> writes:
>
> for what its worth i'm currently working on a small interpreter which,
> combined with some of the code from sacla, will raise those limits
> substantially (but not remove them completely).


Could you give more details about this interpreter? What problems is it
supposed to solve, and how does it solve them? Since I've written a
significant real-world application with UCW and I plan to use it more
in the future, I'm intensely interested in any upcoming major
improvements to it.

-Peter

drewc

2005-06-09, 8:58 pm

otqocrkwvv@pvoalfotpmezsaq.net wrote:

> Can you elaborate on which Lisp implementation and which
> Lisp packages you are using to run lisp.tech.coop?
> Web server, html generation,... etc.
> Degree of difficulty to set up,... etc.


Sure. From the front page of lisp.tech.coop (doesn't anybody do their
own research any more) :

"For those who may be interested, we run this cliki in a UML instance,
using pound + araneida (a lisp web server) running on SBCL."

IIRC, setting up lisp.tech.coop was very simple.. (asdf-install:install
'cliki) ... (hit the "2" restart when it complains about package locks)
... edit a simple config file, point the reverse proxy to the right port
.... leave it alone and let slashdot have a go. :)


> I have been looking for a while for a set of Lisp
> tools (open source) that will be straight forward
> to set up but so far i haven't found any.


Really? you can't have looked very hard. SBCL is easy to install,
araneida is ASDF-INSTALL'able. Like i mentioned before, if this is a big
problem for you, we do offer support for web applications at the tech
co-op :)

Heck, if you use Debian you can apt-get everything. I personally find my
lisp set-up to be significantly easier than perl/php/whatever + apache.

> All these processes seem to be very complex in the Lisp world.
> Setting up this package, and that package, and the other...
> just to do a web app.


When compared to what? I recently set up a Perl Web app, and it was not
easy at all. Install and configure apache. Install Perl. install
mod_perl ... Install a dozen or so CPAN packages... pray ....

"just" to do a web app? Web application programming is as far from
trivial as it gets... A good framework makes this all easier, but it's
still a pain in the ass.

> Perhaps not so complex for Lisp gurus
> but can be very discouraging to others.


One could say the same about PHP and apache gurus. I don't want to sound
contrary here, but what have you actually tried to set up?
ASDF-INSTALL has always worked for me, and i'm _very_ far from gurudom
(one look at my code would tell you that).

Tell you what, If you email me, or come to #tech.coop on freenode, I, or
someone else, will walk you through installing araneida... just tell me
where you get stuck. I'll expect you to have read the relevant
documentation first of course ;)

--
Drew Crampsie
drewc at tech dot coop
"Never mind the bollocks -- here's the sexp's tools."
-- Karl A. Krueger on comp.lang.lisp
otqocrkwvv@pvoalfotpmezsaq.net

2005-06-10, 4:00 am

drewc <drewc@rift.com> wrote in news:c83qe.1626324$8l.1295319@pd7tw1no:

> otqocrkwvv@pvoalfotpmezsaq.net wrote:
>
>
> Sure. From the front page of lisp.tech.coop (doesn't anybody do their
> own research any more) :


:)

Not at all, I'm doing more research than I've ever done for any
other language. The learning curve for Lisp systems is a steep one.

>
> "For those who may be interested, we run this cliki in a UML instance,
> using pound + araneida (a lisp web server) running on SBCL."


Some more research. Seems very good.
http://www.apsis.ch/pound/

>
> IIRC, setting up lisp.tech.coop was very simple..
> (asdf-install:install 'cliki) ... (hit the "2" restart when it
> complains about package locks) .. edit a simple config file, point the
> reverse proxy to the right port ... leave it alone and let slashdot
> have a go. :)
>
>


Yes, I've just been able to install araneida under SBCL and CMUCL
with this procedure. Thanks. (CMUCL + ASDF-INSTALL from
http://weitz.de/)



> Tell you what, If you email me, or come to #tech.coop on freenode, I,
> or someone else, will walk you through installing araneida... just
> tell me where you get stuck. I'll expect you to have read the relevant
> documentation first of course ;)
>


Thanks again. :)

Marco Baringer

2005-06-10, 8:57 am

"Peter Scott" <sketerpot@gmail.com> writes:

> Could you give more details about this interpreter? What problems is it
> supposed to solve, and how does it solve them? Since I've written a
> significant real-world application with UCW and I plan to use it more
> in the future, I'm intensely interested in any upcoming major
> improvements to it.


by controlling the execution of the code (instead of just rewriting it
and passing it to the underlying lisp) we can:

1) allow mutually recursive actions; allow actions which call actions
to be defined in any order (currently an action must be defined
before it can appear in the body of an action which calls
it). (this particular limitation is the "straw which broke my
back")

2) deal with lambdas in actions. for example you will be able to
write:

(setf effective-users
(remove-if (lambda (user)
(call 'option-dialog
:message (format nil "Do you want to keep ~A?"
(username user))
:options '(("Yes" . t) ("No" . nil))))
available-users))

3) support catch/throw and progv (as long as they don't extend outside
the current continuation's delimitiation).

4) support multiple-values (this is doable in the current
implementation but i never got around to actually doing it).

5) greatly improve the debugging and error reporting (the current
transformation destroys the original code and this makes it very
hard (even for me) to debug actions).

however we'll take a major speed hit (though in my test in time spent
executing actions is ~0 compared to the time spent copying the html to
the socket) and we'll (i'll) need to reimplement certain standard
functions (such as remove-if) to deal with continuation enabled
lambdas functions (this is where sacla comes in).

this isn't really a 'major' feature, but it will be a big help and,
hopefully, allow people to write/debug more complicated actions.

p.s. - could we get more details on your real-world app?

--
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
Peter Scott

2005-06-10, 4:00 pm

Marco Baringer wrote:
> by controlling the execution of the code (instead of just rewriting it
> and passing it to the underlying lisp) we can:
> [snip list of bugs that will be fixed]
> p.s. - could we get more details on your real-world app?


Sure! The app is a web-based system for making, discussing, and voting
on proposals. It's being used by a small political lobbying
organization whose members are too far apart to attend meetings. The
mailing list they were using before was too cumbersome, so they hired
me to create a more specialized system for them, incorporating their
rules of order (a proposal needs 1/3 of the members to endorse it
before going to a vote, that sort of thing). Since I had until then
been using normal web programming frameworks, I never dreamed that I
could write something this slick and useful, and UCW made a lot of
nasty parts trivial. For example, here's how someone changes his
password:

Click on "settings".
Click "Change your password".
A page comes up asking you to type in your new password twice. If you
type in the same password twice, it changes your password and tells
you that your password has been changed, and gives you a link back to
the preferences page. Otherwise, it tells you what you did wrong and
asks you to type the password twice again. The amazing part is that
this is all written very straightforwardly; the top-level controlling
code looks something like this:

(let ((password (call 'get-password)))
(change-password (get-user) password)
(call 'info-message :message "Your password has been sucessfully
changed"))

Some complexity is hidden in the get-password dialog, but most of that
was handled neatly by having a few slots and using <ucw:input with the
:accessor option.

While it's still rough around the edges, UCW is now the first system
I'd consider for building a web application of any significant
complexity. It blows my mind to see that people are still trying to do
this sort of thing with more primitive methods and tremendous effort.

Screenshots:
http://img.photobucket.com/albums/v...eterpot/wc1.png
http://img.photobucket.com/albums/v...eterpot/wc2.png

-Peter

drewc

2005-06-11, 3:57 am

Peter Scott wrote:

>
> While it's still rough around the edges, UCW is now the first system
> I'd consider for building a web application of any significant
> complexity. It blows my mind to see that people are still trying to do
> this sort of thing with more primitive methods and tremendous effort.
>


I think, esp. now that Marco is adding an interpreter, that UCW is a
programming language that, while hosted on CL, is quite different in a
lot of ways. Are we greenspunning Scheme by adding call/cc like
semantics to a superset of Common Lisp? Perhaps, although i've read (i
cannot find a reference for this) that First-Class Continuations are
infact too much for web programming, and that a "partial continuation"
allows more flexibility WRT control flow.

I personally could not imagine having to do web programming without UCW
.... It's be like programming without Lisp.. ouch!

I thought i'd take this opportunity to show off some of what i'm
currently working on, and why i love UCW :)

I'm written a system that generates presentations for database objects
based on the type and relation information in the system catalog. Its
based on Mewa[1] clsql + postgres and the UCW presentation components.

This is the code to add a new contact to the system. (screenshot pr0n
follows).

In the RENDER-ON method of my front-page i have :

(let ((p (make-instance 'person :person-type-code nil)))
(<:as-html "Add Person :")
(<ucw:render-component
:component (make-presentation
p
:type :one-line
:initargs '(:attributes
((person-type-code :editablep t)))))
(<ucw:submit :action (new-person self p) :value "add"))

This creates a drop-down list of person-types and an "add" button which
calls NEW-PERSON :

(defaction new-person ((self component) person)
"
Take a PERSON with a user-defined PERSON-TYPE-CODE,
* Prompt the user for a FIRST-NAME, LAST-NAME and/or COMPANY-NAME
* Search for similar PERSONs in the database.
* If they exist, ask the user to select one or continue
* otherwise, just continue editing the person"

(let ((named-person
(call-component self (make-presentation
person
:type 'new-person
:initargs '(:global-properties
(:size 25 :editablep t))))))
(when named-person
(call-component self (make-presentation
(find-or-return-named-person self named-person)
:type :editor)))))


(defaction find-or-return-named-person ((self component) person)
"
If any similiar contacts exist in the database,
select one or continue with the current person
PERSON must have FIRST-NAME, LAST-NAME and COMPANY-NAME bound."

(let ((instances (sql-word-search person 'first-name 'last-name
'company-name)))
(if instances
(call-component self (make-presentation
person
:type 'person-chooser
:initargs
`(:instances ,instances)))
person)))


You can hardly tell it's a web application ... there is no checking of
CGI params etc... just nice code in the order i wanted to write it.

Screenshots :
http://tech.coop/img/screenshots/select-person-type.jpg
http://tech.coop/img/screenshots/enter-person-name.jpg
http://tech.coop/img/screenshots/se...ar-contacts.jpg
http://tech.coop/img/screenshots/ed...son-details.jpg
http://tech.coop/img/screenshots/vi...ent-changes.jpg


All of the code used to create the presentations for this is below my
sig. I do eventually plan to release the presentation system as Free
Software, it just needs a little cleaning up. E-mail me for a sneak peak.

[1] Mewa : Meta-level Architecture for Generic Web-Application Construction
http://map1.squeakfoundation.org/sm...c8-1006dd462859
--
Drew Crampsie
drewc at tech dot coop
"Never mind the bollocks -- here's the sexp's tools."
-- Karl A. Krueger on comp.lang.lisp


(def-view-class/table "person")

(set-default-attributes (make-instance 'person)

(defcomponent person-display (mewa::two-column-presentation)
())

(defcomponent one-line-person (mewa::mewa-one-line-presentation)
()
(:default-initargs :attributes '(first-name last-name company-name)))

(setf (find-attribute 'person :one-line) '(one-line-person))
(set-attribute 'person 'person-type-code '(code-select :category 1))
(set-attribute 'person 'province-state-code '(code-select :category 2))

(setf (find-attribute 'person :viewer) '(person-display
:global-properties (:editablep nil)))

(set-attribute 'person :editor '(person-display :global-properties
(:editablep t)))

(setf (find-attribute 'person 'claim->adjuster-id) '(ucw::has-very-many
:label "Claims as Adjuster" :slot-name claim->adjuster-id ) )

(set-attribute 'person 'policy->agent-id '(ucw::has-very-many :label
"Policies as Agent"))


(defcomponent new-person (person-display)
()
(:default-initargs
:attributes '(first-name last-name company-name)))

(defcomponent person-chooser (mewa::mewa-list-presentation)
()
(:default-initargs
:attributes '(first-name
last-name
company-name
address
city
person-type-code)
:global-properties '(:editablep nil)
:editablep nil
:deleteablep nil))

(defmethod render-on :wrapping ((res response) (self person-chooser))
(<:p (<:as-html "Similar contact(s) in database. You can :")
(<:ul
(<:li (<:as-html "Select one of the contacts below"))
(<:li (<ucw:a :action (answer (instance self))
(<:as-html "Continue, adding a new contact")))))
(call-next-method))

(defaction ok ((self new-person) &optional arg)
(declare (ignore arg))
(answer (instance self)))


(defmethod sql-word-search ((instance standard-db-object) &rest slots)
(let ((names
(loop for slot in slots
nconc (split-sequence #\Space (slot-value instance slot)))))
(select (class-name (class-of instance))
:where (sql-or (mapcar #'(lambda (x)
(when (< 0 (length x))
(apply #'sql-or
(mapcar #'(lambda (y)
(sql-uplike

(sql-slot-value 'person y)
(format
nil "%~a%" x)))
slots))))
names))
:flatp t)))

Marco Baringer

2005-06-11, 8:57 am

"Marco Baringer" <mb@bese.it> writes:

> "Peter Scott" <sketerpot@gmail.com> writes:
>
>
> by controlling the execution of the code (instead of just rewriting it
> and passing it to the underlying lisp) we can:


(i really can't believe i forget to mention this)

there is one other thing which will become much easier if we take over
control of executing actions: serializing session state and, thanks to
this, ucw session mobility. atm everything in a session is easily
(fsvo easy) serializable except the anonymous closures which are
generated by the cps transformation and stored in the components. if
we stop using the lisp's functions object but create our own which
consits of: code [another set of clos objects] and the environement
[again a clos object] then sending the entire session over the wire
becomes doable.

currently if you need to run a ucw app on multiple machines your only
option is to tie a session to a particular machine and map all
subsequent requests to that machine. this kind of setup is easy to
create and works fine, but it has the major defect that if the machine
goes down it takes all of its sessions with it. i don't know what most
people think about this but the only client i have who would like to
run the site on multiple machines wants a hardware failure to be as
transparent as possible.

--
-Marco
Ring the bells that still can ring.
Forget the perfect offering.
There is a crack in everything.
That's how the light gets in.
-Leonard Cohen
david.tolpin@gmail.com

2005-06-11, 3:58 pm


> (i really can't believe i forget to mention this)
>
> there is one other thing which will become much easier if we take over
> control of executing actions: serializing session state and, thanks to
> this, ucw session mobility. atm everything in a session is easily
> (fsvo easy) serializable except the anonymous closures which are
> generated by the cps transformation and stored in the components. if
> we stop using the lisp's functions object but create our own which
> consits of: code [another set of clos objects] and the environement
> [again a clos object] then sending the entire session over the wire
> becomes doable.


If you don't use Common Lisp's lambdas, why do you re-invent the wheel?
Grab a Scheme intrerpreter on top of Common Lisp, and you have all you
need. It's just a bit slow, but then you do not have to use a Common
Lisp-based implementation, in the end, it is the functionality that
matters, not tools it was created with. Get Bigloo, and you have a fast
lisp with continuations?

Isn't it what you are striving for?

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com