[plt-scheme] Sources for "real-world" web applications running on plt-web-server

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Mon Mar 15 13:54:48 EDT 2010

On Sun, Mar 14, 2010 at 8:51 PM, Reginaldo J. S. Filho <xregis at gmail.com> wrote:
> Hi. I'm somewhat new to Scheme, but not a complete newbie. I've gone
> through HtDP and read many parts of the Guide and Reference that come
> with PLT Scheme. In practical terms, I'm reasonably comfortable with
> writing small to mid-sized programs with PLT, like command-line
> utilities, games and the like.
> Currently, I'm in the process of developing a web app to run on the
> PLT web server. The main benefit for me is the fine-grained control
> supplied by the continuation-based framework, which allows me to think
> as if I was doing "regular" programming (no inversion of control
> because of HTTP).
> I've seen (and implemented on my on) many of the examples I could
> find, which means:
> 1) The blog app from the "Continue" tutorial;
> 2) ListIt, by Jens Axel Søgaard;
> 3) pltwitter.plt, by Jay McCarthy
> They are all fine examples, but aren't enough to give me a feeling,
> for instance, how I should structure code that will be deployed to
> production.
> For instance, the blog app and ListIt (as shown in MacCarthy's blog)
> all produce html, using xexpr format, straight from the controller
> code. In principle I have nothing against it, but I suspect that for
> big applications it wouldn't work so well. Besides, one can't easily
> output doctypes using the standard xexpr only, and the code is not
> "pretty-print" in the browser. I was able to find a way around the
> doctype issue using tips from the following posts:
> http://www.topmost.se/personal/articles/web-programming-with-plt-scheme/serving-xhtml.htm
> http://www.topmost.se/personal/articles/web-programming-with-plt-scheme/custom-dispatchers.htm
> Anyways, for bigger application I'm sure it would be better to use
> templates, but still have some questions.
> * In practical terms, how do I use apache with the plt-web-server?
>   Should I just proxy the requests or use apache to serve static files
>   too? I suspect apache's performance is better for static files, but
>   don't have means to know if the added complexity (in terms of
>   configuration) pays off.

As far as the How:


> * Are there any bigger open source web apps written for PLT that you
>   can point me to?

Not that I'm familiar with. PLT is normally the secret ninja master technique.

You can look at DrDr's source, but it isn't really dynamic and is a tad hacky.


> * Are there any practical guides on how to deploy an application to
>   production? It seems the server can be configured in many different
>   ways, and that's a good thing. On the other hand, as a beginner, I
>   feel overwhelmed with so many options.

Most of the time I use something like:

(serve/servlet top-dispatch
               #:port 9000
               #:listen-ip #f
               #:quit? #f
               #:launch-browser? #t
               #:servlet-regexp #rx""
               #:servlet-path "/"
               #:extra-files-paths (list static-path))

And maybe I will customizer the manager if I problems.

> * Are there any connection-pool-style packages that let me connect to
>   PostgreSQL with minimal hassle?

See Noel's

> * How well do JQuery, prototype, and the like, fit together with Scheme
>   code?

It fits just as well as anything else. I use Dave's JS package for the



> Thanks from Brazil,
> Reginaldo
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme

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

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

Posted on the users mailing list.