HH-Web

HH-Web is a Common Lisp framework designed to simplify authoring modern web applications.
 

About

HH-Web is a library of Common Lisp code intended to simplify development of modern web applications.

Why

I wrote it because so much of web development seems disconnected: a little CSS here, a little script there, and oh, some HTML that only makes sense when you see the CSS and Javascript that goes with it.  There's even (horrors) a lot of copy and paste, but...I digress.  

Composition is an important aid to software development: build some small parts that work really nicely, and combine them into larger parts that work better.  Designing for the web, however, makes that hard.  You need CSS, HTML, Javascript, several Javascript libraries, several stylesheets, etc.  The problem I wanted solve was: can we tackle web development at a higher-level?  Can we work with components of a higher-order, and compose applications from those parts more rapidly?  

That's why HH-Web exists.  I used it to buildNimbulous, and have wound up finding it more useful than its original application.

What

While it encompasses several different aspects of a typical web application, it's primary insight concerns generation of HTML.  Many languages such as ColdFusion, ASP(.NET), PHP, etc. emphasize the generation of HTML for a given page and based on provided parameters.  However, HH-Web distinguish itself by coordinating the generation of not just HTML but also CSS, and Javascript for a single page.  More importantly, it does this not by framework conventions or rigid patterns for developers (since all of the other languages and platforms can generate CSS and Javascript), but instead builds up the HTML/CSS/Javascript from individual tags--each of which may contain its own HTML, CSS, and Javascript content.  It's the job of HH-Web to properly aggregate all of that into a single stream of content for each page in an application.

To put this into functional terms, HH-Web encompasses the realization that responding to an URL is not a simple matter of accepting as input the HTTP request (with the URL, query string, possible post parameters, etc.) and returning a single value that is the HTML content.  Instead, handling an HTTP request is a function that multiple return values: the content, the title, the content type, etc.  Building a page out of component parts (e.g., sidebar, header, main content, archive listing, etc.) is not simply a matter of aggregating results from individual component functions that return a single value, but aggregating the results of component functions that return multiple values: HTML, CSS, Javascript, page titles, script library references, font references, links in the document head, etc.

Features

The feature list for HH-Web continues to expand, but some of the significant features already implemented include the following:

  • Custom tags for rapid HTML/CSS/Javascript generation
  • Content templates for consistent site structure (HTML and image)
  • Site customizations for specific user agents
  • Regex-based URL routing

Source

Source is available on Github:https://github.com/hargettp/hh-web.

License

HH-Web is licensed under the  MIT License, and should thus be suitable for commercial and open source projects, private or public.

Quicklisp

As of July 2012, HH-Web is installable via Quicklisp:(ql:quickload :hh-web).