[racket-dev] Removing Xexpr preference from Web Server

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sat Nov 27 05:39:02 EST 2010

On Sat, Nov 27, 2010 at 4:31 AM, Neil Van Dyke <neil at neilvandyke.org> wrote:
> * I'd like to efficiently support SXML, as well as my new union of SXML and
> xexprs, by writing while traversing the data structure, without introducing
> an extra copy by first converting to byte string.  Perhaps "response/c"
> could permit a closure to write the content and perhaps to produce or write
> the headers, or something similar?  (Ideally, this does not require plugging
> together components using units and signatures; sometimes those tools are
> indispensable, but they're also cumbersome.)

I've just added response/port for this purpose, although it only
provides the ability to stream the content, the headers must be
produced beforehand. Is that a game breaker?

> * I'd say that using SXML or xexprs for HTML and XML responses from a Web
> server is the normal and preferred way to implement most pages.  Using these
> efficiently should be easy for people to do in substantial systems, such as
> by letting them define their own wrapper procedure or syntax for making a
> response of their preferred type.  Using SXML or xexprs for output should
> also "give good demo" in tutorials and pilot apps, so it would be nice if
> people doing "#lang simple-web-server" or whatever could have a simple and
> terse way of saying "send an HTML response from this SXML or xexpr, with all
> the continuation magic", such as using one procedure or syntax name, rather
> than two to four.
> BTW, SXML and xexprs are a big win for Web development.  For one large
> system in PLT Scheme, the architects have repeatedly mentioned the
> productivity benefits of SXML for HTML pages as one of the major advantages
> of using Scheme.

I very much agree; I wonder if the single 'make-xexpr-response' will
be too much overhead.


> --
> http://www.neilvandyke.org/

Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University

"The glory of God is Intelligence" - D&C 93

Posted on the dev mailing list.