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
"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!
"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
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
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
On 8 Jun 2005 01:04:25 -0700, "Damir" <·····@x-si.org> wrote:
> 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?
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.
> http sessions? Is UCV the right answer? How is this issue treated in
> real world with lisp?
<http://bc.tech.coop/blog/041017.html>
<http://www.cliki.net/Web>
Cheers,
Edi.
--
Lisp is not dead, it just smells funny.
Real email: (replace (subseq ·········@agharta.de" 5) "edi")
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
On 8 Jun 2005 02:58:09 -0700, "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 ·········@agharta.de" 5) "edi")
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
drewc <·····@rift.com> wrote in ····························@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.
··········@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
drewc <·····@rift.com> wrote in ·····························@pd7tw1no:
> ··········@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) :
:)
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. :)
On Wed, 08 Jun 2005 19:29:09 +0000, drewc wrote:
> 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.
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 :-)
> >
> > 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).
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.")
"R. Mattes" <··@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
Marco Baringer wrote:
> "R. Mattes" <··@mh-freiburg.de> writes:
> > 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).
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
"Peter Scott" <·········@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
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/v324/sketerpot/wc1.png
http://img.photobucket.com/albums/v324/sketerpot/wc2.png
-Peter
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/select-similar-contacts.jpg
http://tech.coop/img/screenshots/edit-person-details.jpg
http://tech.coop/img/screenshots/view-recent-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/package/32c5401f-fa30-4a2b-80c8-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" <··@bese.it> writes:
> "Peter Scott" <·········@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:
(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
> (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?
·············@gmail.com" <············@gmail.com> writes:
> 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?
no, then i would have a scheme and i want a common-lisp (obviously). i
could get into the technical and social reasons as to why i'm going to
stick with common lisp, but that would quickly derail into a cl vs
scheme thread, and we've had enough of those already. i'll just say
that it's easier (for me) to implement scheme's interesting features
in common-lisp than it would be to implement common-lisp's interesting
features in scheme.
--
-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
Marco Baringer wrote:
> (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.
Ideas on how to store this information centrally for all of the app
servers? I would love to see either a RDBMS (Postgres) or Memcached
(http://www.danga.com/memcached/) option.
>
> 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.
This would allow me to use UCW not only in personal projects, but at
work as well. Any timeline? I can do some testing, although I'm a bit
of a newb.
BA
Brad Anderson <····@dsource.dot.org> writes:
> Ideas on how to store this information centrally for all of the app
> servers? I would love to see either a RDBMS (Postgres) or Memcached
> (http://www.danga.com/memcached/) option.
>
> [snip]
>
> This would allow me to use UCW not only in personal projects, but at
> work as well. Any timeline? I can do some testing, although I'm a
> bit of a newb.
we're talking about two different things:
1) scalability. can you increase the performance of a ucw app by
adding hardware? two options:
a) manage sessions with cookies and use pound for load balancing
(www.apsis.ch/pound/). this is by far the simplest solution and
is doable today with the current ucw code base. you still run
the risk of losing data and sessions if one of the machines goes
down and, if you're unlucky, you could still end up with one
machine serving lots of busy sessions and another sitting
idly. if you can't use cookies then you'd need to change some of
ucw's form handling code (to make sure session ids are always
passed in the url), this is fairly easy but hasn't been done yet
(and won't get done unless i need it or someone else contributes
it).
b) store the sessions in a memcache (thanks for the link btw) or an
rdbms and use lvs (www.linuxvirtualserver.org) to balance the
work on the machines. this has the advantage that you won't end
up with one busy machine and one idle machine and lvs deals hot
swapping of machines and dead nodes transparently. this has the
major disadvantage that, as of now, you can't do it since
there's no way to store a session in anything but local
ram. once sessions are completly serializable then this requires
modifying find-session, expire-session and adding a new :after
method on service (to store the changed session back in the
db). since each and every request will require first fetching
the session object and then, just before sending back the html,
puting the session object back into the store (it has changed in
the mean time) we will need to make sure session serialization
doesn't become a bootleneck.
2) high availablity. can you create a ucw app which is resistent to
hardware failures? not currently. the load-balancing solution in
(1.b) can deal with hardware failures an the app servers but this
leaves the db as a spof. the only 'real' solutions to this is to
use a db which supports replication and store sessions in the db. i
think postrgesql can but i haven't checked in a while and i know
berkeleydb does (though i've never actually used it)).
as far as ucw is concerned the only thing missing is fast session
serialization and this will happen as soon as I convince someone to
pay me for it (hint hint hint :)).
--
-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
Marco Baringer wrote:
> Brad Anderson <····@dsource.dot.org> writes:
>
>
>>Ideas on how to store this information centrally for all of the app
>>servers? I would love to see either a RDBMS (Postgres) or Memcached
>>(http://www.danga.com/memcached/) option.
>>
>>[snip]
>>
>>This would allow me to use UCW not only in personal projects, but at
>>work as well. Any timeline? I can do some testing, although I'm a
>>bit of a newb.
>
>
> we're talking about two different things:
>
> 1) scalability. can you increase the performance of a ucw app by
> adding hardware? two options:
>
> a) manage sessions with cookies and use pound for load balancing
> (www.apsis.ch/pound/). this is by far the simplest solution and
> is doable today with the current ucw code base. you still run
> the risk of losing data and sessions if one of the machines goes
> down and, if you're unlucky, you could still end up with one
> machine serving lots of busy sessions and another sitting
> idly. if you can't use cookies then you'd need to change some of
> ucw's form handling code (to make sure session ids are always
> passed in the url), this is fairly easy but hasn't been done yet
> (and won't get done unless i need it or someone else contributes
> it).
>
> b) store the sessions in a memcache (thanks for the link btw) or an
> rdbms and use lvs (www.linuxvirtualserver.org) to balance the
> work on the machines.
This is what we have in production at work. LVS with session
persistence allowed us to remove the affinity settings by class C
address (keep sessions on one app server) and move to more of a
round-robin or least weighted connections.
> this has the advantage that you won't end
> up with one busy machine and one idle machine and lvs deals hot
> swapping of machines and dead nodes transparently. this has the
> major disadvantage that, as of now, you can't do it since
> there's no way to store a session in anything but local
> ram. once sessions are completly serializable then this requires
> modifying find-session, expire-session and adding a new :after
> method on service (to store the changed session back in the
> db). since each and every request will require first fetching
> the session object and then, just before sending back the html,
> puting the session object back into the store (it has changed in
> the mean time) we will need to make sure session serialization
> doesn't become a bootleneck.
Fast session serialization is the feature I'm interested in. You can
even store the sessions in memcached *and* the database, and if you get
a cache miss, go to the slower database. A new thread can take care of
the session writing to the store, if you can live with 'dirty session
writes' (can't think of a better name). This gets you to sending back
the html faster.
>
> 2) high availablity. can you create a ucw app which is resistent to
> hardware failures? not currently. the load-balancing solution in
> (1.b) can deal with hardware failures an the app servers but this
> leaves the db as a spof. the only 'real' solutions to this is to
> use a db which supports replication and store sessions in the db. i
> think postrgesql can but i haven't checked in a while and i know
> berkeleydb does (though i've never actually used it)).
Agreed, and we have an active/active database cluster (MS SQL Server).
I would like to re-create this with Postgres (and use Slony, maybe?? I
think we'd need to use LVS at this level too, after the replication is
working.)
>
> as far as ucw is concerned the only thing missing is fast session
> serialization and this will happen as soon as I convince someone to
> pay me for it (hint hint hint :)).
>
For now, I'm using UCW on a small personal site, but with these
features, it would be much more attractive to use at work. I'm afraid I
can't pay you yet. I'd need to make some inroads w/ Lisp in other
places first. I'm attempting to displace a J2EE system piece-by-piece,
and I'm starting with the core classes, not the presentation layer.
BA
"Marco Baringer" <··@bese.it> writes:
[snippedy-snip]
> 2) high availablity. can you create a ucw app which is resistent to
> hardware failures? not currently. the load-balancing solution in
> (1.b) can deal with hardware failures an the app servers but this
> leaves the db as a spof. the only 'real' solutions to this is to
> use a db which supports replication and store sessions in the db.
That's just one solution. Using other High Availability solutions like
failover mechanisms (stable solutions available for all commercial
unixes and also even for Linux) do provide this also, and work in many
setups I have done also as 'real' solutions.
Need more input? Ask!
Frank
Frank Goenninger DG1SBG <················@t-online.de> writes:
> "Marco Baringer" <··@bese.it> writes:
>
> [snippedy-snip]
>
>> 2) high availablity. can you create a ucw app which is resistent to
>> hardware failures? not currently. the load-balancing solution in
>> (1.b) can deal with hardware failures an the app servers but this
>> leaves the db as a spof. the only 'real' solutions to this is to
>> use a db which supports replication and store sessions in the db.
>
> That's just one solution. Using other High Availability solutions like
> failover mechanisms (stable solutions available for all commercial
> unixes and also even for Linux) do provide this also, and work in many
> setups I have done also as 'real' solutions.
>
> Need more input? Ask!
i'm asking :)
--
-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
"Marco Baringer" <··@bese.it> writes:
[Snippedy-Snip]
>>
>> Need more input? Ask!
>
> i'm asking :)
>
So you dare you ask, hm ? ;-) Here you go:
Any large scale web app that is business critical is based on a few
fundamental components.
1. All components are redundant
-> So you need at least two routers, two switches, two machines ...
And also two UPS boxes, two power supplies in each devices...
2. Load balancing is done based on content and on network traffic
Cisco and Baynetworks are examples for producers of stuff like
LoadBalancer that direct traffic based on content and network
bandwidth requirements to parts of the network infrastructure and
to the application servers
3. High availability is achieved on application level either by
having mulptiple instances of a given app on several machines
(which of course are running in buildings that are at least
2 km apart - according to NATO regulations) and/or by
putting the apps in packages that are switchable between
machines in case of a hardware failure. Commercial solutions
are IBM'S HACMP or HP's MC/ServiceGuard. These solutions facilitate
the switching based on monitoring critical resources and also
by updating each node in a cluster about health status of each
node. If a node experiences problems all other nodes are either
notified actively or passively (when that node is no more
reachable). Then the packages (a DB, a CL image proces, the Web
server, whatever) gets shutdown on the problem node and started
on another, pre-defined failover sequence node. In doing so the
IP address of that app (NOT of the interface, in a HA cluster
each application is assigned an IP address) is taken onto the
new node's network interface. The network infrastructure is
notified about the new MAC address to IP address mapping using
the ARP protocol and other mechanisms. Therefore the load
balancer, the switch and all other devices "know" that the
app is now running on a new node. Or, more precisely, they
don't care because the switches next to the nodes take
care of this using IP protocol facilities.
Even Amazon and Ebay are running based on the architecture outlined
above.
Hey, normally I do charge 1250 EUR for this type of consulting ;-)
Want more? Ask!
Frank
Frank Goenninger DG1SBG <················@t-online.de> writes:
> "Marco Baringer" <··@bese.it> writes:
>
> [Snippedy-Snip]
> >>
> >> Need more input? Ask!
> >
> > i'm asking :)
> >
>
> So you dare you ask, hm ? ;-) Here you go:
>
> Any large scale web app that is business critical is based on a few
> fundamental components.
>
> 1. All components are redundant
> -> So you need at least two routers, two switches, two machines ...
> And also two UPS boxes, two power supplies in each devices...
>
> 2. Load balancing is done based on content and on network traffic
> Cisco and Baynetworks are examples for producers of stuff like
> LoadBalancer that direct traffic based on content and network
> bandwidth requirements to parts of the network infrastructure and
> to the application servers
>
> 3. High availability is achieved on application level either by
> having mulptiple instances of a given app on several machines
> (which of course are running in buildings that are at least
> 2 km apart - according to NATO regulations) and/or by
> putting the apps in packages that are switchable between
> machines in case of a hardware failure. Commercial solutions
> are IBM'S HACMP or HP's MC/ServiceGuard. These solutions facilitate
> the switching based on monitoring critical resources and also
> by updating each node in a cluster about health status of each
> node. If a node experiences problems all other nodes are either
> notified actively or passively (when that node is no more
> reachable). Then the packages (a DB, a CL image proces, the Web
> server, whatever) gets shutdown on the problem node and started
> on another, pre-defined failover sequence node. In doing so the
> IP address of that app (NOT of the interface, in a HA cluster
> each application is assigned an IP address) is taken onto the
> new node's network interface. The network infrastructure is
> notified about the new MAC address to IP address mapping using
> the ARP protocol and other mechanisms. Therefore the load
> balancer, the switch and all other devices "know" that the
> app is now running on a new node. Or, more precisely, they
> don't care because the switches next to the nodes take
> care of this using IP protocol facilities.
>
>
> Even Amazon and Ebay are running based on the architecture outlined
> above.
>
> Hey, normally I do charge 1250 EUR for this type of consulting ;-)
>
> Want more? Ask!
>
> Frank
>
And to just add to Frank's outline - Red Hat is now offering a
clustered version of their enterprise solution. They have some good
documentation available and while their cluster version may be a bit
expensive, there is enough information available to "do it yourself"
if your adventurous enough. We did this when we wanted to do a "proof
of concept" at work, but didn't have the funds to invest in full
commercial versions. It worked well. The only warning is that you do
need at least 3 servers participating in the cluster. This is because
with only two nodes, each node cannot easily determine if it is the
node which should be "master" (overly simplified, but should give you
the idea). Note that the commercial clustering solutions are still
IMHO superior to "roll your own" or even Red hats current offering,
but of course everything is relative to your need and your budget.
Tim
.
--
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you
really need to send mail, you should be able to work it out!
In article <··············@soma.local>, Marco Baringer <··@bese.it> wrote:
> 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.
Then you can store the entire session (with strong encryption of course)
in a browser cookie. How's that for server failover reliability! :-)
-bcd
--
*** Brian Downing <bdowning at lavos dot net>