Lisp In A Box - Why is it starting a server? - emacs

I've decided to get back into LISP (haven't used it since my AI classes) to get more comfortable with functional programming in general, so I downloaded Lisp In A Box (which we actually used in a previous class) which comes with CLISP and Emacs.
When I run it, it says:
Connected on port 1617. Take this REPL, brother, and may it serve you well.
What the? So I looked on the Lisp In A Box webpage more closely and found this:
SLIME is an integrated development environment for Emacs which interfaces with a Common Lisp implementation over a network socket. Lots of information about SLIME can be found at the SLIME node on CLiki. The manual for SLIME is available in PDF format online.
I somewhat understand what SLIME is (some sort of extension to emacs, right?) But why in the world is a text editor starting its own server and connecting to it?

The purpose is so that Lisp will be running in parallel.
Slime connects to the session and then you can have the same environment, definitions, etc from many different windows (or machines even). This means that you can start up your application and debug it on the fly, for instance.
For further information, look at this blog.

Sockets are more flexible than pipes. For one, SLIME lets you connect to Swank servers on the network, which is very useful for doing live fixes on remote machines with long-running processes (such as web servers). Given this, why would you add another layer of complexity by abstracting communication in such a way as to support both pipes and sockets? It's not like pipes are any simpler to program than sockets, anyway.

Well, Slime starts Lisp process to give you integrated development environment. So that you can test and debug your code on the fly and also be able to inspect objects.
I think architecture with sockets was chosen for better portability between different lisps (Btw, Slime also supports Clojure and MIT Scheme ) and OS-es (Slime works on Windows too). Also it allows cross-platform development - you can test your software on target architecture from your Emacs.
So I think, that this decision is great, you just should not put swank (Slime back-end) on production servers.

You get a REPL (read-evaluate-print-loop) running in parallel, so that you can compile and test code snippets on the fly from your editor. "Practical Common Lisp" (freely available on the web) has a good explanation for this, and it is a very good book for learning Lisp.

Related

Interact with a locally long-running Common Lisp image, possibly daemonized, from the command line

How could one interact with a locally long-running Common Lisp image, possibly daemonized, from the command line?
I know it is possible to run a Common Lisp function from a Terminal command prompt, I am also aware of this.
I would need to do a similar thing, but with a local, already long-running Common Lisp image, being able to poll available functions from the CLI or shell scripts.
Is there a way to do that from a CLI, for example calling a function from a bash script, and receiving back whatever the function returns?
I though one could, for example, create a primitive web service, perhaps using woo or Hunchentoot, calling functions and fetching returned values via curl or wget, but it feels a little convoluted.
Of course, that is one of the many features of Emacs' SLIME, but I would need to call functions just from the CLI, without invoking Emacs.
Is there perhaps a way to reach a swank backend, outside of SLIME?
If possible at all, what would be the lisp idiomatic way of doing that?
I would be grateful for any pointers.
Update
Additional note
Many years ago, I was intrigued by being able to telnet into a long-running LISP image (I believe in this case uppercasing the name should be fine). If I remember correctly, it was available at prompt.franz.com. An article, somehow connected: telnet for remote access to a running application
Telnet is of course quite unsafe, but the usefulness of being able to access the Lisp application(s) in that way, for whatever reason, cannot be overstated, at least to some people.
Some additional pointers, and thanks
I would like to thank Basile Starynkevitch for his elaborate and thorough answer, especially on the theoretical aspect. I was looking for a more practical direction, specially connected to Common Lisp. Still, his answer is very instructive.
I was all ready to start writing a local server, perhaps using one of the fine Common Lisp libraries, like:
usocket: Universal socket library for Common Lisp
iolib: Common Lisp I/O library
cl-aync: Asynchronous IO library for Common Lisp
But, thanks to Stanislav Kondratyev, I didn't have to. He pointed out an already existing solution that nicely answer my question, ScriptL: Shell scripting made Lisp-like
I tested it with success on Linux, FreeBSD and OS X, just make sure to install the thin wrapper over POSIX syscalls first. Among many features (see README), it allows exposition of just selected functions, security is properly handled, and it even supply a custom C client, which builds as part of the ASDF load operation, and supports a number of new features, such as I/O, in place of netcat.
You may find scriptl useful: http://quickdocs.org/scriptl/. However, it depends on iolib, which depends on some nonstandard C or C++ library, so building it is not quite straighforward.
It is indeed possible to communicate with a swank server if you familiarize yourself with the swank protocol, which seems to be underdocumented (see e. g. here: https://github.com/astine/swank-client/blob/master/swank-description.markdown). However, this exposes a TCP socket over a network, which could be unsafe. Once I tried that, too, but I was not satisfied with the IPC speed.
A while ago I wrote a rather naive SBCL-specific server that uses a local domain socket for communication, and a client in C. It's very raw, but you could take a look: https://github.com/quasus/lispserver. In particular, it supports interactive IO and exit codes. The server and the client form the core of a simple framework for deploying Unix style software. Feel free to borrow code and/or contact me for explanations, suggestions, etc.
It certainly is operating system specific, because you want some inter-process communication, and they are provided by the OS.
Let's assume you have a POSIX like OS, e.g. Linux.
Then you could set up a socket(7) or fifo(7) to which you send s-exprs to be evaluated. Of course you need to adapt the Common Lisp program to add such a REPL.
SBCL has some networking facilities, you could build on them.
Of course, you should understand first how IPC work on your OS. If it is Linux, you could read Advanced Linux Programming (it is centered on C programming, which is the low-level way of using OS services on POSIX, but you can adapt what you have learned to SBCL). And indeed, the Common Lisp standard might not have an official POSIX interface, so you need to dive into implementation specific details.
Perhaps you should learn more about BSD sockets. There are tons of tutorials on them. Then you could use TCP sockets (see tcp(7)) or Unix ones (see unix(7)). Advanced users could use the unsafe telnet command. Or you might make your software use SSL, or perhaps some libssh e.g. use ssh as their client.
You could decide and document that the protocol between user apps and your program is : send some-sexpr (on a documented socket) from user-app code to your server which is terminated by a double newline or by a form feed, and have your server eval it and send back the result or some error message. I did similar things in MELT and it is not a big deal. Be careful about buffering.
I guess that you assume that you have responsible and competent users (so don't open such a remote REPL to the wild Internet!). If you care about malicious or stupid use of a remote REPL, it is becoming complex.
Alternatively, make your server a web application (by using some HTTP server library inside it), and ask users to use their browser or some HTTP client program (curl) or library (libcurl) to interact with it.

Webdevelopment in Common Lisp

I am somewhat familiar with Scheme. I am reading OnLisp, and would love to do a real world project in it. Most likely web development. I would love to know what kind of setup people use to develop websites in lisp. I have a couple of macs at home and I have figured I would use clozure cl. I am wary of a few things though. I have read on the internets that cl doesn't have reliable threading facility nor good networking. Is this true? What was your experience?
PS:Don't tell me about clojure :). Lisp is a itch I need to scratch.
Currently I'm using Restas a framework based on Hunchentoot and inspired by the route system of Rails. I also use Postmodern to interact with a PostgreSQL database and I generate HTML with cl-markup though I'm thinking about switching to cl-who which looks more customizable.
When I've started I've also considered using Parenscript to generate the JavaScript but now I'm just happy with Mootools and plain JavaScript.
Everything runs on SBCL and is available with Quicklisp.
Not sure why it wouldn't have "good networking"; you can't rely on threads if you want to write a portable Common Lisp application since certain implementations don't support them (AFAIK, just clisp, though you can compile it with experimental thread support). If you plan on picking an implementation and sticking with it, you won't have that problem.
The "standard" CL web stack is Hunchentoot/cl-who/clsql, though you can find tutorials that run on Araneida or Portable AllegroServe.
The setup I use is Debian/SBCL running quicklisp and the above systems along with MySQL (though I'm seriously considering jumping over to Postgres) for the database and nginx to run in front of Hunchentoot serving any static content.
mck- has been maintaining the heroku common lisp webapp.
https://github.com/mck-/heroku-cl-example/tree/
The problem with Common Lisp's "networking" is, we don't have sockets in CL standard, so each implementation has it's own socket API. We have some attempts to give a common interface though, like usocket. You can find a list of networking related packages here.
If you need a web framework, look into Caveman. I haven't used it yet but it looks like the most complete CL web framework I've ever seen.

How can I do web programming with Lisp or Scheme?

I usually write web apps in PHP, Ruby or Perl. I am starting the study of Scheme and I want to try some web project with this language. But I can't find what is the best environment for this.
I am looking for the following features:
A simple way of get the request parameters (something like: get-get #key, get-post #key, get-cookie #key).
Mysql access.
HTML Form generators, processing, validators, etc.
Helpers for filter user input data (something like htmlentities, escape variables for put in queries, etc).
FLOSS.
And GNU/Linux friendly.
So, thanks in advance to all replies.
Racket has everything that you need. See the Racket web server tutorial and then the documentation. The web server has been around for a while, and it has a lot of features. Probably the only thing that is not included is a mysql interface, but that exists as a package on PLaneT (Racket package distribution tool).
UPDATE: Racket now comes with DB support, works with several DBs including mysql.
You may want to have a look at Clojure:
Clojure is a dynamic programming language that targets the Java Virtual Machine. [...] Clojure provides easy access to the Java frameworks, with optional type hints and type inference, to ensure that calls to Java can avoid reflection.
Clojure is a dialect of Lisp, and shares with Lisp the code-as-data philosophy and a powerful macro system.
Interop with Java is straightforward in Clojure, so you can re-use any existing Java libraries as you need. I'm sure there are plenty that are useful for web development.
clojure-contrib has an SQL API, and there is ClojureQL as well, which should cover your DB access needs.
There is a web framework for Clojure called Compojure under development. There may be others, too.
Clojure's source is available on github under the EPL. Getting it running on Linux is easy; I just clone the git repos and run ant.
You can do web development with guile scheme. Its standard library includes the (sxml simple) module that is very useful for html generation, manipulation, and parsing. The guile-www library adds support for http, cgi, etc. The guile-dbi library provides access to MySQL and other databases. With these building blocks, you can implement everything from simple cgi scripts to web applications with their own HTTP server.
Try Weblocks, a Common Lisp web framework:
http://weblocks.viridian-project.de/
I've written a pretty extensive tutorial/ebook on the topic: http://lispwebtales.ppenev.com/
Quick summary:
It uses Common Lisp
It uses the Restas framework
It has examples for pretty much most of basic web development, including DB access, authentication, HTML generation and templating.
Since the Restas documentation is pretty much out of date, my tutorial is the closest thing to up to date docs.
Shows a few of the more advanced features, like policies, which allow you to write pluggable interfaces, for instance you can write a data store layer, and write back-ends for different storage mechanisms with relative ease, the module system which allows you to write reusable components, like auth frameworks and things like that.
It covers things like installing lisp, setting up the ASDF build system and the quicklisp package manager etc.
It's free online, and as soon as I finish it it will be free on leanpub as well. The source is on https://github.com/pvlpenev/lispwebtales under a CC license, the source code is MIT. Not all of it is published yet, and I'm in the process of revising.
This may be what you are looking for.
http://www.plt-scheme.org/
http://docs.plt-scheme.org/web-server/index.html
http://common-lisp.net/project/cl-weblocks/
If you are interested in Common Lisp to be exact and do not want to go the weblocks route I would recommend the following setup:
Use SBCL on Linux but with multiple thread support
Use Hunchentoot as a web server which will provide you with all the server processing required including sessions and cookies
Use ClSql to communicate with MySql it has ample documentation and is very stable.
For the HTMl generation you can use Dr Edi Weitz Cl-WHO (very well documented).
Note all the above are under GPL or similar license (one that works more for lisp programs)
Gambit Scheme has its own solution to web apps as well. It uses the Spork framework, based o the Black Hole module system (both by Per Eckerdal).
Andrew Whaley has an initial tutorial on how to get Gambit, Black Hole and Spork running a web app under Apache using mod_proxy. You might want to take a look at that.
On a (possibly) related note, Gambit will also compile your stuff to C and then to an executable, if you feel so inclined.
Paul Graham (and friends) made a lisp dialect specifically for writing basic web applications. It's called Arc, and you can get it at arclanguage.org.
It's probably not suited for really big complex websites and I'm not sure what state it's database support is at but Paul Graham knows how to write web applications in lisp, so Arc will make the HTTP/HTML part easy for you while you spend most of your brain cycles learning the lisp way.
Weblocks is nice tool for building web apps in Common Lisp, but a bit too heavy-weight for me.
We use the following stack:
OpenMCL (open source Lisp, very nice)
Portable Allegroserve (web server, HTML generator)
Our own Rails-like tools for doing Ajaxy stuff (update: this has now been open sourced as WuWei)
A variety of CL libraries like cl-json, cl-smtp, md5
I use my own, customized version of Scheme, derived from MzScheme. It has a new, simple web-application framework, a built-in web-server (not the one that comes with MzScheme) and ODBC libraries. (http://spark-scheme.wikispot.org/Web_applications). The documentation may not be exhaustive, as this is more of a personal tool. But there are lots of sample code in the code repository.
Clojure is a Lisp dialect which may interest you. At this point there's a pretty decent web development stack. I can recommend a few things:
The leiningen dependency manager which makes is really easy to install and manage libraries that you're using. Pretty nice set of plugins for it too. There's even a plugin for Clojurescript, which is a language based on Clojure that compiles to Javascript.
The ring HTTP server abstraction. Its used in most actual web frameworks. Its a pretty good idea to learn that first before jumping into an actual framework.
hiccup is a HTML dsl/templating language written in Clojure. Its very expressive! Reminds me a bit of Jade, in a sense.
composure would have to be the most popular web framework for Clojure. Its essentially a routing library like express.js.
Let's see what can be done with Common Lisp.
The state of the Common Lisp ecosystem (2015) and the Awesome Common Lisp list show us a couple of modern frameworks (Caveman, Lucerne, all built on the new Clack web application server, an interface for Hunchentoot and other servers). Let's discuss with our own findings.
update 2019: there's a new tutorial on the Common Lisp Cookbook: https://lispcookbook.github.io/cl-cookbook/web.html It covers routing, template engines, building self-contained binaries, deployment, etc.
update: a bit later, I found out Snooze, by the creator of Sly or Emacs' Yasnippet, and had a much better impression than say Caveman. Declaring endpoints is just like declaring functions, so some things that were tedious in Caveman are obvious in Snooze, like accessing the url parameters. I don't have much experience with it but I recommend checking it out.
update june 2018: also don't miss the ongoing rewrite of Weblocks, it's going to be huge ! :D http://40ants.com/weblocks/quickstart.html Weblocks allows to build dynamic webapps, without a line of Javascript, without separating the back and front. It is components-based, like React but server-side. It's very alpha as of writing (june 2018), but in progress, and it's working, I have a couple simple web apps working.
A simple way of get the request parameters (something like: get-get #key, get-post #key, get-cookie #key).
I found easier the Lucerne way, it iss as simple as a with-params macro (real world example):
#route app (:post "/tweet")
(defview tweet ()
(if (lucerne-auth:logged-in-p)
(let ((user (current-user)))
(with-params (tweet)
(utweet.models:tweet user tweet))
(redirect "/"))
(render-template (+index+)
:error "You are not logged in.")))
Caveman's way has been less clear to me.
Mysql access
Caveman advertises database integration (with Fukamachi's Datafly and sxql).
You can just use clsql or the Mito ORM: https://lispcookbook.github.io/cl-cookbook/databases.html
HTML Form generators, processing, validators, etc.
I don't know if there are form generators out there. edit: there are: cl-forms and formlets, or again 1forms, working with Caveman2.
Caveman does not have one (issue raised in 2011).
Helpers for filter user input data (something like htmlentities, escape variables for put in queries, etc).
Ratify is an input validation library, not integrated into a framework though.
FLOSS and GNU/Linux friendly: ✓
Other web stuff
Speaking about web, there are other nice libraries in CL land:
web servers: Woo is a fast HTTP server, faster than Nodejs (beware of charts…), wookie is an async http server,
Dexador is an HTTP client
Plump, lquery and CLSS make it easy to parse html and query the DOM.
cl-bootstrap offers twitter-bootstrap shortcuts for the cl-who templating engine (which kind of replaces Jade/Pug, even though we have usual templates too).
Ajax in Lisp
(remember, with Weblocks, see above, we might not need those)
With ParenScript, we can write JavaScript in Common Lisp, without living our usual workflow, and we can thus use the fetch web API to write Ajax calls.
Clojure would be perfect for this. With some very short, clean code, you can implement some very complex applications, such as blogs or forums.
You might want to consider the awful web framework for Chicken Scheme.
Natively supports PostgreSQL and SQLite
Built-in easy support for sessions
Shortcuts for some webdev idioms, like the (ajax) procedure
Your app can be easily compiled to a static executable (via csc -static) for easier deployment
The collection of all chicken libraries (eggs) isn't as versatile as in some other programming languages, but isn't awful either

How do the various ANSI CL implementations differ?

When I started learning CL from Practical Common Lisp, as is preached in the book, I started off with Allegro CL compiler. I stopped using it, since its commerical, yet free bit didn't impress me. It needed a connection to its remote server for some licensing stuffs.
I switched to 'clisp' and am using it. Now, I have been hearing about SBCL and planning to start using it as well.
So, the question is: How do the various ANSI CL implementations differ? Any practical experience of using one over the other ?
Thank you.
See Common Lisp Implementations: A Survey by Daniel Weinreb.
If you are on a machine that can run SBCL, you should use it. It's
the fastest free Lisp compiler (it can generate code that is as fast
as Haskell, OCaml, Java, C, and C++, which are all very very fast,
especially compared to Python and Ruby). It also is a fairly complete
implementation, and supports most of Swank's features (for SLIME), which is nice when you are developing.
As some of the other comments mention, you won't really notice any
differences when you are first starting out. All the free CL
implementations are "fast enough" and support all the features you'll need. But if you start writing
production software, you will appreciate SBCL's features. OTOH, there's really no reason not to switch now.
I have been looking at Win32 solutions to the same question. As far free Lisp implementations on Windows, I would strongly recommend Clozure CL (CCL). There are several reasons for this. The first is that Clozure supports 32- and 64-bit binaries. It's very fast, and somewhat compact. But most importantly, it's consistent and correct. I find it to be an extremely mature Lisp, after working with Lispworks (which I miss) for several years. CCL does a very nice job with native OS threads, sockets, and some other elements that are not part of the CL spec. Its implementation of CLOS seems to be extremely thorough. And it's GC and memory management are excellent. I compared CCL to SBCL on Win32, and while SBCL was a bit faster on several benchmarks, it cons'd up a lot more, and its image kept growing and growing, even after several forced GCs. Meanwhile, CCL was consistent, small, quick, and lovely to use. And if you want a platform that's consistent across Windows, Mac, and Linux, and has both 32- and 64-bit support, then look no further.
I did try CormanLisp on Win32, and there were many things about it I liked. But it does not run properly on 64-bit Windows platforms, and is limited to Win32. It's also not free, and somehow I had it crash on me when I'd throw some garbage code at it. I also was easily able to make SBCL crash. Not so with CCL. Rock-solid. Really, those guys did an amazing job, and ultimately will help keep Lisp alive.
As for SLIME, I didn't try to get SLIME working with SBCL, but I did get it working nicely with CCL. No matter what your fancy is, I advise that people write code to be easily portable. Aim for Windows, Mac, and Linux, and aim for 64-bit. If you consider these, then CCL is your best choice overall.
A last attempt at an answer to this is to consider what is wrong with the others. Here's what I've come to find:
CLISP is nice, but is far slower, relative to SBCL or CCL. I see little upside
SBCL seems poor on Win32. Image size can get big.
CormanLisp is good on Win32, but not portable, and does not support Windows x64.
It also seems that Roger Corman is not actively developing CormanLisp, which is
a shame, but it's the reality.
Clojure (with a "j") is not Common Lisp. As nice as it may be, I think that
if you already know CL, then it's not worth the overhead of learning Clojure's
many differences. I'm sure some may pick them up fast, but I surely did not.
(If Java-compatible code is what you're after, then look at ABCL).
dave
There are portions of ANSI CL that leave certain details up to the implementations to determine; you will find that for those parts of the standard, each implementation will have its own quirks.
Also, look for things that are important to the runtime but not defined in the language: things like threading and multiprocessing and garbage collection will vary substantially in performance and reliability.
I have found SBCL to be the easiest implementation to work with in Linux; it has good support for threading in Linux. I can't say much about the garbage collector, because it hasn't mattered to me much yet.
On Windows, your best bet will probably be Allegro or LispWorks, although I've had some success with clisp on Windows. The Windows port of SBCL is progressing, but I haven't used it much, so I can't really comment.
Generally speaking, an understanding of these kinds of things that are difficult to acquire through research or analysis; it comes through experience. Just pick a decent implementation that you're comfortable with, and get to work. You'll figure out the tricky stuff as you go.
I don't know enough to give you a detailed answer, but I noticed that SBCL was considerably faster then Clisp when I was working with CL for my AI class. Unless you have a compelling reason not to, I'd suggest going with SBCL.
I've heard that Clisp is easier to install and is more portable than SBCL (which has lots of processor-specific optimizations), but if you're using Linux they're both easy enough to fetch from the package manager.
I found the error messages in clisp to be more friendly and help me find the problem faster.
It seems that SBCL's REPL is not friendly compared with clisp ? E.G. I can use TAB key to auto-complete input in clisp.
so clisp is a better for lisp newbie.
I've had pretty good luck with installing clisp using cygwin if you're under windows.
Depends on your OS of choice
Windows - use ecl or abcl
Linux - use sbcl or ecl or abcl or cmucl
Mac - ccl or ecl or sbcl
Other - abcl or ecl or sbcl
EDIT:
Sbcl on windows lacks threading and is, in general not that stable, and none of core maintainers use windows.
ecl is much better choice for cross platform lisps, its feature set is equaly stable on all major platforms.
EDIT 2011-10:
Sbcl windows now has threading support. It is not yet fully merged in mainiline, but there is a fork which is pretty stable which have threading and other Windows specific goodies.

Lisp Web Frameworks? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
What are the popular (ok, popular is relative) web frameworks for the various flavours of LISP?
PLT Scheme features a built-in, continuation-based web server.
Update: PLT Scheme is now called Racket.
Hunchentoot is also quite widespread
What is Weblocks?
Weblocks is a continuations-based web framework written in Common Lisp.
http://common-lisp.net/project/cl-weblocks/
Most (perhaps all) of the well-known Common Lisp web frameworks have already been mentioned, so I'll just add some comments.
Hunchentoot is not a "web framework" in the sense that most people mean. It's an HTTP server (an extremely good one).
Drew Crampsie's "Lisp on Lines" looks extremely promising, but I'm not sure how far along it is. I've been waiting to hear an announcement.
Marco Baringer's UnCommon Web runs on many of the prominent CL implementions: Allegro CL, CMUCL, Clozure CL (formerly known as OpenMCL), GNU clisp, and SBCL. The only major one missing is LispWorks; I don't know if that means it hasn't been tested to work, or is known not to work, or what; but if it runs on all those other dialects, it's probably easy to make it run on any other.
For Clojure you can try Compojure.
Common Lisp
A lot of the usual suspects (Hunchentoot, UCW, LoL) have already been mentioned.
Franz makes available for Allegro Common Lisp (and ported to other Lisps):
at a lower level (handling HTTP requests yourself), AllegroServe.
at a higher level (more of a "framework"), WebActions.
Both are open source. I tend to use AllegroServe, factoring out utilities as I need them, but some people really like WebActions.
I used Araneida for quite some time, and I prefer its style to AllegroServe, but it hasn't been maintained since 2006.
I've searched quite extensively for a good web framework for Lisp, and I found them all to be somewhat inaccessible. The Architecture of UCW didn't seem very natural to me (I can't remember why; it's been a while since I looked into it), and KPAX isn't maintained anymore (I think).
Symbolic web looks very interesting, and I think Weblocks is the most interesting, but Weblocks isn't very well documented and can be pretty intimidating to the newcomer. SymbolicWeb was immature last time I looked, but it may have grow up some since then. The features page looks pretty good today.
There are different approaches you could take. If you want a purely lisp approach, then you could:
If you can read code proficiently and understand continuations, you might try Weblocks with a Hunchentoot backend (Weblocks has a dependency on Hunchentoot that hasn't been abstracted yet). There is supposed to be a real user manual out in a month or two, but as with any OSS project, such commitments are sketchy.
Similarly, you might try SymbolicWeb. [update: nevermind, the project is no more]
roll your own. Seriously - there's cl-who to help with HTML generation, there are javascript and json libraries available, usockets, elephant, cl-sql, hunchentoot, aserve, and lots of utility libraries that you could bake together.
If you are ok with a hybrid approach, this is something I'm experimenting with at the moment: I've written a Lisp JSON-RPC backend for Qooxdoo, so I can serve up pure javascript frontends through a superfast http server like Cherokee and let Cherokee farm out connections to as many backend json-rpc servers running in Lisp as I want. Very, very scalable. I'm far from figuring out the kinks and challenges, but it was pretty straight-forward to get working. the json library makes it stupid simple to get the backend working - Qooxdoo itself is actually harder, I think (but I'm not a JS developer, really).
I'm also going to be checking out WebActions from allegro, because there's a certain allure to the availability of paid support - not to mention that Allegro may be the best CL implementation available (His Kennyness uses it :-)).
UnCommonWeb (UCW) is often mentioned http://www.common-lisp.net/project/ucw/ -- it's not REST as is in en-vogue at the moment, more like Smalltalk's SeaSide (but then again, SeaSide is quite en-vogue).
LeftParen
Lisp-on-lines is a web application framework built on top of CLSQL and UCW and provides an application development model similar in many ways to Ruby on Rails. Right now it can be found at http://versions.tech.coop/lisp-on-lines/.
http://www.cliki.net/lisp-on-lines
http://kevin.casa.cavewallarts.com/LISP/LOL/lol.html
For Clojure you can try Webjure.
I just discovered a web framework called Clack for common lisp and found it quite easy to get started.
See http://clacklisp.org/
Quote from it's web site
"Clack is a web application environment for Common Lisp inspired by Python's WSGI and Ruby's Rack."
and caveman is a micro web framework based on Clack.
Another cool (yet far from "popular") thing to look at is SymbolicWeb -- http://groups.google.com/group/symbolicweb
Re: SymbolicWeb (and its exaggerated demise)
SymbolicWeb project page at Gitorious and SymbolicWeb article at Wikipedia. The Google Groups page is definitely dead (and unarchived?,) but the Gitorious tree shows checkins as recently as 29 April 2010. The project page also refers to "some running examples" being "occasionally available" at nostdal.org (which is unreachable as I write this, reinforcing the "occasionally" qualifier :-) .)
(Note: I'm not a SymbolicWeb user. I just tracked down the SymbolicWeb links while reading this thread.)
Restas is another web framework that has seen recent updates:
http://restas.lisper.ru/en/
Its overview
RESTAS is a Common Lisp web application framework. Its key features are:
RESTAS was developed to simplify development of web applications following the REST architectural style.
RESTAS is based on the Hunchentoot HTTP server. Web application development with RESTAS is in many ways simpler than with Hunchentoot, but some knowledge of Hunchentoot is required, at least about working with hunchentoot:*request* and hunchentoot:*reply*.
Request dispatch is based on a route system. The route system is the key concept of RESTAS and provides unique features not found in other web frameworks.
The other key RESTAS concept is its module system, which provides a simple and flexible mechanism for modularized code reuse.
Interactive development support. Any RESTAS code (such as the definition of a route, a module or a submodule) can be recompiled at any time when you work in SLIME and any changes you made can be immediately seen in the browser. No web server restart or other complicated actions are needed.
SLIME integration. The inner structure of a web application can be investigated with the standard "SLIME Inspector." For example, there is a "site map" and a simple code navigation with this map.
Easy to use, pure Lisp web application daemonization facility based on RESTAS and SBCL in Linux without the use of Screen or detachtty.
RESTAS is not an MVC framework, although it is not incompatible with the concept. From the MVC point of view, RESTAS provides the controller level. Nevertheless, RESTAS provides an effective and flexible way for separation of logic and representation, because it does not put any constraints on the structure of applications. Separation of model and controller can be effectively performed with Common Lisp facilities, and, hence, doesn't need any special support from the framework.
RESTAS does not come with a templating library. cl-closure-template and HTML-TEMPLATE are two good templating libraries that can be used with RESTAS.
This question is a bit old but I thought I'd share my recent discovery: the Hop language which is based on Scheme and is quite complete.
HOP is a multi-tier programming language for the Web 2.0 and the so-called diffuse Web. It is designed for programming interactive web applications in many fields such as multimedia (web galleries, music players, ...), ubiquitous and house automation (SmartPhones, personal appliance), mashups, office (web agendas, mail clients, ...), etc.
HOP features:
an extensive set of widgets for programming fancy and portable Web GUIs,
full compatibility with traditional Web technologies (JavaScript, HTML, CSS),
HTML5 support, a versatile Web server supporting HTTP/1.0 and HTTP/1.1,
a native multimedia support for enabling ubiquitous Web multimedia applications,
fast WebDAV level 1 support,
an optimizing native code compiler for server code,
an on-the-fly JavaScript compiler for client code,
an extensive set of libraries for the mail, calendars, databases, Telephony, ...