From: billc
Subject: Vancouver Lisp Users Group meeting for August - Web Continuations Considered Harmful
Date: 
Message-ID: <1155058566.054006.172050@m73g2000cwd.googlegroups.com>
Hi all,

Summer is drawing to a close, so it's time to turn our attentions to
something other than surf, sand, and Beach Boys songs! The next two
lispvan meetings will have a continuations on the web focus. In August,
Marc Battyani will be arguing against the use of continuations in web
applications. Given that a number of lispvan members feel very strongly
that they are a "good idea", this meeting promises to be an interesting
one! Then, in September, James Wright will be discussing the use of a
lisp-based program transformer to provide continuations in Javascript
for asynchronous operations in the browser (Note: Chris Double has
written a number of posts about continuations and asynchronous
operations in Javascript that are well worth reading).

Here's the "official" meeting notice:

Topic: Web Continuations Considered Harmful
Presenter: Marc Battyani
Date: Thursday, August 17, 2006
Time: 7pm - 10pm (or whenever)
Venue: Think!, 4512 West 10th Ave., Vancouver
Summary: Marc Battyani is well known in Lisp circles for a number of
reasons:

    * He does Lisp development work full-time.
    * He has written his own CL web framework (which he hasn't
released) as well as the popular mod_lisp Apache module for passing
HTTP requests from Apache to a Lisp server.
    * He developed CL-PDF and CL-TYPESETTING - two popular CL packages
for working with documents in CL.
    * When Reddit moved from CL to Python, Marc created a Reddit-clone
in Lisp (in fact, he started a trend!). From this, the Common Lisp
Directory project evolved.

So, with such an interesting Lisp background, lispvan is very pleased
to have Marc come over from France to visit Vancouver and speak at our
meeting! He will be focusing on the following two topics:

   1. Lisp at work: Marc and his wife Anne have their own Lisp-based
business called Fractal Concept that specializes in the development of
custom circuit boards and electronic devices for industry as well as
custom applications in Lisp. He will be providing an overview of what
his business does and how he manages to differentiate his offering and
stay competitive using Lisp. This will provide an interesting insight
for anyone who has ever dreamed about running their own lisp-based
business!
   2. Web Continuations Considered Harmful: Actually, this is my title
(one of the "perks" of being the one who writes up the meeting
notices!) rather than Marc's, so don't send him any hate mail! ;-) But
Marc does feel that continuations are not a "good idea" for web
application frameworks and will explain in this session why he thinks
other approaches are much better. I'm sure there will be some "frank
and meaningful" discussions following the presentation as well! ;-)

So, kick off the flip-flops, abandon the beach and join us for a
thrilling end-of-summer lispvan meeting!

Additional links are on my blog posting:
http://bc.tech.coop/blog/060808.html

--
Bill Clementson

From: Ken Tilton
Subject: Re: Vancouver Lisp Users Group meeting for August - Web Continuations Considered Harmful
Date: 
Message-ID: <K_4Cg.3020$3U4.2008@fe12.lga>
billc wrote:
> Marc does feel that continuations are not a "good idea" for web
> application frameworks and will explain in this session why he thinks
> other approaches are much better.

And supporting continuations was Patrick Collison's primary reason for 
porting CROMA from Lisp to C. Kids today, they just don't listen.

:)

kenny

-- 
Cells: http://common-lisp.net/project/cells/

"I'll say I'm losing my grip, and it feels terrific."
    -- Smiling husband to scowling wife, New Yorker cartoon
From: billc
Subject: Re: Vancouver Lisp Users Group meeting for August - Web Continuations Considered Harmful
Date: 
Message-ID: <1155063749.211079.196670@m79g2000cwm.googlegroups.com>
> > Marc does feel that continuations are not a "good idea" for web
> > application frameworks and will explain in this session why he thinks
> > other approaches are much better.
>
> And supporting continuations was Patrick Collison's primary reason for
> porting CROMA from Lisp to C. Kids today, they just don't listen.

Not like when we were young, eh Kenny?

;-)

- Bill
From: Ken Tilton
Subject: Re: Vancouver Lisp Users Group meeting for August - Web Continuations Considered Harmful
Date: 
Message-ID: <YpiCg.65$pi5.33@fe11.lga>
billc wrote:
>>>Marc does feel that continuations are not a "good idea" for web
>>>application frameworks and will explain in this session why he thinks
>>>other approaches are much better.
>>
>>And supporting continuations was Patrick Collison's primary reason for
>>porting CROMA from Lisp to C. Kids today, they just don't listen.
> 
> 
> Not like when we were young, eh Kenny?
> 
> ;-)

Well, that was the joke, but profoundly more interesting is the 
extraordinary waste arising from the seductive but fundamentally 
mistaken category error in which continuations are somehow deemed 
relevant to the web.

To achieve that non-result, PC is now programming in C instead of Lisp. 
 From boy genius to train wreck... too sad for jokes about generation 
gaps for my money. And too bad, Lisp could have used a good web framework.

kt

-- 
Cells: http://common-lisp.net/project/cells/

"I'll say I'm losing my grip, and it feels terrific."
    -- Smiling husband to scowling wife, New Yorker cartoon
From: billc
Subject: Re: Vancouver Lisp Users Group meeting for August - Web Continuations Considered Harmful
Date: 
Message-ID: <1155141640.358233.224140@m73g2000cwd.googlegroups.com>
Ken Tilton wrote:
> billc wrote:
> >>>Marc does feel that continuations are not a "good idea" for web
> >>>application frameworks and will explain in this session why he thinks
> >>>other approaches are much better.
> >>
> >>And supporting continuations was Patrick Collison's primary reason for
> >>porting CROMA from Lisp to C. Kids today, they just don't listen.
> >
> >
> > Not like when we were young, eh Kenny?
> >
> > ;-)
>
> Well, that was the joke, but profoundly more interesting is the
> extraordinary waste arising from the seductive but fundamentally
> mistaken category error in which continuations are somehow deemed
> relevant to the web.

A continuation-based approach can make certain types of web programming
much easier to code. For other types of web programming, a simple
REST-based approach works fine; however, many people would disagree
with your statement that continuations are not relevant to the web. I
think we'll definitely have some interesting discussions at the lispvan
meeting as views do seem to be very polarized on the topic.

> To achieve that non-result, PC is now programming in C instead of Lisp.
>  From boy genius to train wreck... too sad for jokes about generation
> gaps for my money. And too bad, Lisp could have used a good web framework.

CROMA (version 1) was quite interesting and Patrick came up with a
number of interesting approaches in his implementation. With version 2,
he wanted to do a port to C as he felt it would improve both the
continuation implementation and overall performance. However, he's
decided to take the summer off before heading to MIT in September, so
we will have to wait a while to find out whether the version 2
enhancements actually see the light of day. I think Patrick will do
quite well at MIT and I look forward to seeing what he comes up with
next. 

Cheers,
Bill
From: Ken Tilton
Subject: LispNYK report [was Re: Vancouver Lisp Users Group meeting for August - Web Continuations Considered Harmful]
Date: 
Message-ID: <m7OCg.74$5L4.35@newsfe10.lga>
billc wrote:
> Ken Tilton wrote:
> 
>>billc wrote:
>>
>>>>>Marc does feel that continuations are not a "good idea" for web
>>>>>application frameworks and will explain in this session why he thinks
>>>>>other approaches are much better.
>>>>
>>>>And supporting continuations was Patrick Collison's primary reason for
>>>>porting CROMA from Lisp to C. Kids today, they just don't listen.
>>>
>>>
>>>Not like when we were young, eh Kenny?
>>>
>>>;-)
>>
>>Well, that was the joke, but profoundly more interesting is the
>>extraordinary waste arising from the seductive but fundamentally
>>mistaken category error in which continuations are somehow deemed
>>relevant to the web.
> 
> 
> A continuation-based approach can make certain types of web programming
> much easier to code. For other types of web programming, a simple
> REST-based approach works fine; however, many people would disagree
> with your statement that continuations are not relevant to the web. I
> think we'll definitely have some interesting discussions at the lispvan
> meeting as views do seem to be very polarized on the topic.
> 
> 
>>To achieve that non-result, PC is now programming in C instead of Lisp.
>> From boy genius to train wreck... 

[Ahem, well, I should know better than to post on Usenet fresh from a 
LispNYK meeting ending at 3:30am in our dive bar of choice.]

At any rate the LispNYKs alarmed Sambuca's family-style Italian 
restaurant by turning out in force for Michael Naunton's PastaPoint 
presentation which, to my and his astonishment, several people actually 
followed as evidenced by several astute questions. Guest Barry Wilkes 
seemed to enjoy himself, and stragglers (defying my orders) straggled in 
all through the meal, commandeered chairs left unattended by hapless 
other diners, or leaned against walls, and I think we maxed out at 
twenty-five.

Micheal made a tour de force presentation: a non-technical friend 
invited at the last minute astonished me by accepting. She sat opposite 
Michael understanding not one word and after a minute turned to me and 
said it was all fascinating.

Side note: an offhand quip to the maitre d' by your correspondent 
suggesting "no children should be seated near us" led to said 
correspondent being taken aside by said maitre d' and nervously asked 
exactly what the meeting was to be about. The response "Lisp" seemed 
only to increase his disquiet. Seeing that, I told him that Michael was 
however talking about a Python application. This seemed to mollify the 
gentleman and the evening proceeded without further event.

kenny (back on the wagon)

-- 
Cells: http://common-lisp.net/project/cells/

"I'll say I'm losing my grip, and it feels terrific."
    -- Smiling husband to scowling wife, New Yorker cartoon
From: Ray Dillinger
Subject: Re: Vancouver Lisp Users Group meeting for August - Web Continuations Considered Harmful
Date: 
Message-ID: <44da57bf$0$96154$742ec2ed@news.sonic.net>
Ken Tilton wrote:

> 
> Well, that was the joke, but profoundly more interesting is the 
> extraordinary waste arising from the seductive but fundamentally 
> mistaken category error in which continuations are somehow deemed 
> relevant to the web.
> 
> To achieve that non-result, PC is now programming in C instead of Lisp. 
>  From boy genius to train wreck... too sad for jokes about generation 
> gaps for my money. And too bad, Lisp could have used a good web framework.

Ehh, tomayto, tomawto.  Continuation-based web programming is
a technique.  It works.  There's really no problem with choosing
it over some other techniques, nor with choosing other techniques
over it.

But I'm not understanding something here; a Lisp programmer
who wants continuations moved to C instead of moving to Scheme?
Ow.  That had to hurt, no matter what species he is.

				Bear
From: Ken Tilton
Subject: Re: Vancouver Lisp Users Group meeting for August - Web Continuations Considered Harmful
Date: 
Message-ID: <PuuCg.42$5x7.18@newsfe09.lga>
Ray Dillinger wrote:
> Ken Tilton wrote:
> 
>>
>> Well, that was the joke, but profoundly more interesting is the 
>> extraordinary waste arising from the seductive but fundamentally 
>> mistaken category error in which continuations are somehow deemed 
>> relevant to the web.
>>
>> To achieve that non-result, PC is now programming in C instead of 
>> Lisp.  From boy genius to train wreck... too sad for jokes about 
>> generation gaps for my money. And too bad, Lisp could have used a good 
>> web framework.
> 
> 
> Ehh, tomayto, tomawto.  Continuation-based web programming is
> a technique.  It works.  There's really no problem with choosing
> it over some other techniques, nor with choosing other techniques
> over it.

You read my mind. Today I was thinking it does not bother me that anyone 
wants to use continuations, what bothers me is that that arguable choice 
(to be debated soon at Lispvan) led to some poor soul deciding to write 
C instead of Lisp. (To get to the stack so he could do continuations in 
his homebrewed language.)

> 
> But I'm not understanding something here; a Lisp programmer
> who wants continuations moved to C instead of moving to Scheme?
> Ow.  That had to hurt, no matter what species he is.

And that was my next thought! Scary. I did not think to ask patrick why 
he did not just use scheme as the implementation layer for CROMA. CROMA, 
btw, /is/ Lispy.

kt

-- 
Cells: http://common-lisp.net/project/cells/

"I'll say I'm losing my grip, and it feels terrific."
    -- Smiling husband to scowling wife, New Yorker cartoon
From: Rob Warnock
Subject: Re: Vancouver Lisp Users Group meeting for August - Web Continuations Considered Harmful
Date: 
Message-ID: <j4GdnazAuoV9MEfZnZ2dnUVZ_t2dnZ2d@speakeasy.net>
Ken Tilton  <·········@gmail.com> wrote:
+---------------
| >> And too bad, Lisp could have used a good web framework.
+---------------

Strange. I hacked together one that was quite adequate [for the
needs of the sites I had to support] in a very short amount of time,
and I wasn't even an experienced CL programmer at the time [though
I did have several years of Scheme usage, including for web stuff].

+---------------
| Ray Dillinger wrote:
| > Ehh, tomayto, tomawto.  Continuation-based web programming is
| > a technique.  It works.  There's really no problem with choosing
| > it over some other techniques, nor with choosing other techniques
| > over it.
| 
| You read my mind. Today I was thinking it does not bother me that anyone 
| wants to use continuations, what bothers me is that that arguable choice 
| (to be debated soon at Lispvan) led to some poor soul deciding to write 
| C instead of Lisp. (To get to the stack so he could do continuations in 
| his homebrewed language.)
+---------------

As I discussed at ILC'03 with Christian Quennec (who mostly agreed),
it's not "real" continuations *per se* that's important, it's the
*idea* of web continuations that's important. Once you've grokked
that idea, you can still program in CL [or anything else] by simply
reifying externalizable markers for your "continuations", and then
dispatching on them when they come back in.

In fact, "real" continuations *are* somewhat harmful, since they
imply a *single* place a.k.a. flow-of-control to re-enter when the
user clicks "Submit". Often one needs pages with several *different*
HTML forms in them, each with a different "continuation" to evoke.
If you use "real" continuations you are then forced to add an
explicit dispatch layer... but if you do *that*, you might as
well be using the simple "pseudo-continuations" I use, which are
just tokens [stored in hidden form variables] containing the
"Where do I want to go now?" information.

Said another way, my simple web framework contains the following:

;;;
;;; Web Continuations Module (well, the feeble beginnings of one).
;;;

;;; Within an HTML <form>, (BUILD-CONTINUATION :var1 "val1" :var2 "val2")
;;; will pass "var1=val1&var2=val2" in the CGI bindings.
;;; Includes automatic debug-state propagation.
(defun build-continuation (&rest rest &key (stream *standard-output*)
                                      &allow-other-keys)
  (with-html-output (s stream t)
    (loop for (name value) on rest by #'cddr
          and first = t then first do
      (unless (eq name :stream)
        (when (and first *debug*)
          (setf first nil)
          (htm "[debug = " *debug* ", k = {" name "," value "}]" :br (lfd)
               (:input (:type "hidden" :name "debug" :value "yes")) (lfd)))
        (htm (:input (:type "hidden" :name name :value value)) (lfd))))))

and a typical usage might be like so [the :STATE is the critical bit]:

    (defun search-type2-page (stream self results bindings)
      (with-html-output (s stream t)
	(:form (:method :post :action self)
	  (build-continuation :stream s :state "type2-results"
			      :m_ci "yes" :m_pm "no")
	  (:b () "1. Select how much to display:") :br (lfd)
	  (:table (:border 0 :cellpadding 0)
	    (:tr () (:td ()
              (:input (:type "radio" :name "m_sel" :value "min"
                 :checked nil))
              "Name &amp; email only." (lfd)
              (:input (:type "radio" :name "m_sel" :value "mid"))
              "Name, email, &amp; phones." (lfd)
              (:input (:type "radio" :name "m_sel" :value "max"))
              "All columns." (lfd))))
	  ...The rest of the page...)))

It's been "continuations" enough for me...  ;-}  ;-}


-Rob

-----
Rob Warnock			<····@rpw3.org>
627 26th Avenue			<URL:http://rpw3.org/>
San Mateo, CA 94403		(650)572-2607
From: Ken Tilton
Subject: Re: Vancouver Lisp Users Group meeting for August - Web Continuations Considered Harmful
Date: 
Message-ID: <93ACg.4542$Er7.2735@newsfe10.lga>
Rob Warnock wrote:
> Ken Tilton  <·········@gmail.com> wrote:
> +---------------
> | >> And too bad, Lisp could have used a good web framework.
> +---------------
> 
> Strange. I hacked together one that was quite adequate [for the
> needs of the sites I had to support] in a very short amount of time,
> and I wasn't even an experienced CL programmer at the time [though
> I did have several years of Scheme usage, including for web stuff].

Well, OK, yeah, I expect to roll my own in short order once I come to 
grips with the problem (and learn this web thingy), especially since I 
doubt anything out there uses Cells* and it is becoming more and more 
apparent that Cells are the only way to program. Someone was kind enough 
to send me word of even more prior art:
 
http://www2.warwick.ac.uk/fac/sci/dcs/research/em/publications/phd/syung/

* Actually, the first PyCells demo was a web application. :)

kt

-- 
Cells: http://common-lisp.net/project/cells/

"I'll say I'm losing my grip, and it feels terrific."
    -- Smiling husband to scowling wife, New Yorker cartoon
From: Kaz Kylheku
Subject: Re: Vancouver Lisp Users Group meeting for August - Web Continuations Considered Harmful
Date: 
Message-ID: <1155142701.166459.158050@n13g2000cwa.googlegroups.com>
Ken Tilton wrote:
> billc wrote:
> > Marc does feel that continuations are not a "good idea" for web
> > application frameworks and will explain in this session why he thinks
> > other approaches are much better.
>
> And supporting continuations was Patrick Collison's primary reason for
> porting CROMA from Lisp to C. Kids today, they just don't listen.

A Cromagnon youngster from Limerick
Foundthatcon tinua tionswereslick
Shaking his fist, in with C, out with Lisp,
He longjmp'd straight into a wall of bricks.