Re: [racket-dev] Removing Xexpr preference from Web Server
On Sat, Nov 27, 2010 at 12:55 AM, Jay McCarthy jay.mccar...@gmail.com wrote: I would like to remove the implicit preference the Web Server gives to Xexprs and the old esoteric bytes response format. Seems like a good move to me. If a framework wants to privilege some response type over others it can provide the necessary shortcuts. N. _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] Removing Xexpr preference from Web Server
On Sat, Nov 27, 2010 at 4:31 AM, Neil Van Dyke n...@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. Jay -- http://www.neilvandyke.org/ -- Jay McCarthy j...@cs.byu.edu Assistant Professor / Brigham Young University http://faculty.cs.byu.edu/~jay The glory of God is Intelligence - DC 93 _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] Removing Xexpr preference from Web Server
Jay McCarthy wrote at 11/27/2010 05:39 AM: 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? Thanks. Sounds good. -- http://www.neilvandyke.org/ _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] Removing Xexpr preference from Web Server
On Sat, Nov 27, 2010 at 2:39 AM, Jay McCarthy jay.mccar...@gmail.comwrote: 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? Having response/port is great. In the future it would also be great to expose the input output port to the servlet. I very much agree; I wonder if the single 'make-xexpr-response' will be too much overhead. It won't be just a single make-xexpr-response at the entry point, if the idea is to push the construction of the type of responses into the servlet, unless the servlet only deals with a single type of response. On Fri, Nov 26, 2010 at 4:55 PM, Jay McCarthy jay.mccar...@gmail.com wrote: I would like to remove the implicit preference the Web Server gives to Xexprs and the old esoteric bytes response format. This is backwards incompatible change, but I think it will make the server better in the long run as it will promote other HTML encodings, like the xml and html modules, Eli's new system, SXML, etc. I am interested in your opinion. I agree with Neil that xexpr or sxml are very nice representations of html as well. Given their inherent advantage I think an extensible response mechanism might work better: 1. create hooks to handle different response types 2. let the different package to install the necessary hooks For example - the hook might be called make-response-hook, and in xml package (maybe xml/web-server.ss) can install the hook. Such a hook will allow others to make their own extension as well to manage their own custom response types. My 2 cents. Cheers, yc _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev
Re: [racket-dev] Removing Xexpr preference from Web Server
On Nov 27, 2010, at 4:31 AM, Neil Van Dyke wrote: this does not require plugging together components using units and signatures; sometimes those tools are indispensable, but they're also cumbersome Have you tried the new ones? They work smoothly for most of the time, almost like modules -- Matthias _ For list-related administrative tasks: http://lists.racket-lang.org/listinfo/dev