You can't build a web application on Hunchentoot -- a basic HTTP server -- and call it modern. Take a look at Clack for the actual modern approach: <a href="http://clacklisp.org/" rel="nofollow">http://clacklisp.org/</a><p>Or one of the frameworks built on it:<p><a href="http://8arrow.org/caveman/" rel="nofollow">http://8arrow.org/caveman/</a><p><a href="http://8arrow.org/ningle/" rel="nofollow">http://8arrow.org/ningle/</a><p><a href="http://eudoxia.me/lucerne/" rel="nofollow">http://eudoxia.me/lucerne/</a>
>You can imagine Lisp grammar like Pac Man eating the dots: ᗧ••••, and there is no ghosts here. Pac Man is the function in Lisp, and the dots are arguments. After Pac Man eat up all the dots (the function is executed with all these arguments), it becames a dot: • . and a dot is able to be eaten by another Pac Man.<p>Simplest explanation of Lisp grammar I've read!
This is a reasonable way to get a simple hello world up, but for those new to lisp, know that this isn't how most people develop.<p>Firstly, it is rare to see the SBCL REPL used directly.<p>Most commonly, lisp is developed via an IDE that will include a full-featured REPL (there are several; for sbcl SLIME is what is most commonly used. ClozureCL has its own IDE on OS X, and commercial lisp implementations will ship with their own).<p>GNU clisp has a more feature-full REPL, so you may see that used occasionally.<p>Secondly, lisp has a build system called ASDF. There is a tiny amount of code needed to setup a simple project, and there is a tool named "quickproject" that will generate it all for you. With all the improvements to ASDF in the past decade, I never do a "write lisp file, then load it" anymore.
In case anyone might find it helpful to have another example: I wrote a similar post a couple years ago: <a href="https://kuomarc.wordpress.com/2012/05/13/12-steps-to-build-and-deploy-common-lisp-in-the-cloud-and-comparing-rails/" rel="nofollow">https://kuomarc.wordpress.com/2012/05/13/12-steps-to-build-a...</a>
For anyone interested in having their application and web testing in the same runtime, I'm making a CL web automation library/front-end out of emacs for testing and botting purposes.
<a href="https://github.com/olewhalehunter/kommissar" rel="nofollow">https://github.com/olewhalehunter/kommissar</a>
> Why Lisp? Again
> It is awesome.<p>Why do people who write or talk about Lisp always have to start with something like this? To be honest I still can't see the appeal of Lisp. Yes everything is a function so you can add/remove 'language features' as you want, and the syntax is really simple, and code is data (a rare need of mine anyway). But Lisp sacrifices the most important thing of all; readability.<p>Everyone tries to read programming languages as close as possible to plain english in their head, but Lisp goes completely against this and makes you write things like (* 1 (+ 2 (/ 3 4))) where you have to glance back and forth to even understand the equation - is 1 * (2 + 3/4) not easier to read? Even in C# the phrase 'if (!(foo is bar))' annoys me because it reads 'if not foo is bar' when I'd like to say 'if foo is not bar'! So I think me and Lisp have no hope.
Nice tutorial!<p>Note that your sbcl must be built with threading enabled for the example to work. Otherwise, the initial Lisp landing page will show up at URI /, but the handler for /hello?name=Blah will never be executed because sbcl-without-threading silently fails to use threading and instead runs the server in a blocking way in which later code never gets a chance to run.<p>This was confusing for me at first, but once I built sbcl from source using "./make.sh --fancy" everything worked perfectly.
Don't know how are things on the Common Lisp side, but on the Clojure side, as much as I prefer it to Javascript I end writing regular web applications in Javascript, because for me, it is the more pragmatic choice when I need to get something done.
Javascript/nodejs has lots of good mature libraries with good documentation for anything related to web dev, sponsored by companies that eat their own dog food (ex: the passportjs lib).