Posted 2009-05-24 08:30:00 GMT

Finally, I've got round to releasing my Common Lisp web application platform.

It is running this blog which has the rather unique feature that comments pop up immediately for everybody whenever anybody comments on an article.

It is faster than all(?) other web application frameworks. Please let me know if you can find a faster one! I gave a talk with benchmarks at the Tokyo Linux User Group.

The main code is at github.

git clone git://github.com/vii/teepeedee2.git

[UPDATE — thanks for your input slashdot and for finding a bug for me triggered by lots of comments. I've patched it now . . .]

And here is the code that runs this blog

(in-package #:tpd2.blog) (defun tech-css () (css-html-style ((".inherit" <input <a) :text-decoration "inherit" :color "inherit" :background-color "inherit" :font-size "inherit" :font-weight "inherit" :font-family "inherit" :border "none" :padding "0 0 0 0" :margin "0 0 0 0") ((<body "h1.title") :margin "0 0 0 0" :padding "0 0 0 0") (<body :font-family "georgia, serif" :font-weight "lighter" :color "black" :background-color "white") ("[onclick]" :cursor "pointer") (".blog-entry-post-comment [onclick]" :text-decoration "underline") ("div.comment:first-child" :margin-top "3em") (".blog-entry" :margin-left "2em" :margin-right "2em") (".blog-entry-story, .blog-entry-comments" :font-size "1.3em" :x-column-width "30em" :x-column-gap "2em") (".blog-entry-story P + P" :text-indent "1em") (".blog-entry-story A" :text-decoration "underline") (".blog-entry-story P" :line-height "1.6em") ((<h1 <h2 <h3 <h4) :font-family "verdana, sans-serif" :font-weight "lighter" :font-stretch "narrower" :letter-spacing "0.09em" :margin-left "1em" :margin-right "1em") (<h2 :font-size "200%") ("h1.title" :padding-top "1em" :text-align "right" :font-size "300%" :color "white" :background-color "rgb(76,6,81)") (".blog-entry-post-comment textarea" :width "100%" :height "30em") (".time" :x-opacity 0.60 :margin-right "16%" :text-align "right" :font-size "50%") (".time .author" :font-size "200%") (".blog-entry-post-comment [name=AUTHOR]" :border-bottom "thin solid"))) (defsite *tech-blog-site* :dispatcher "127.0.0.1:11111" :page-body-start (lambda(title) `(<div :class "header" (<h1 :class "title" (<a :href "/" (output-raw-ml ,title))))) :page-head (lambda(title) `(with-ml-output (<title (output-raw-ml ,title)) (tech-css) (webapp-default-page-head-contents)))) (defparameter *tech* (make-blog :link-base "/" :comment-index-prefix "vii" :name "John Fremlin's blog" :dir "...." :static-base-url "/static-blog/" :site *tech-blog-site* :admin-password-file "....")) (defun read-in-blog () (blog-read-in *tech*)) (in-package #:teepeedee2) #.(when (find-package :swank) (push :tpd2-has-swank *features*) nil) (defun run-thread (name function) (with-preserve-specials (*trace-output* *standard-output* *error-output* *debug-io* #+tpd2-has-swank swank::*emacs-connection*) (flet ((func () (with-specials-restored (funcall function)))) #+sbcl (sb-thread:make-thread #'func :name name) #+ccl (ccl:process-run-function name #'func)))) (loop for port in '(11111) do (let ((socket (tpd2.io:make-con-listen :port port))) (tpd2.io:launch-io 'tpd2.io:accept-forever socket 'tpd2.http::http-serve))) (run-thread "read in blog" (lambda() (loop do (tpd2.blog::read-in-blog) (sleep 300)))) (run-thread "tpd2.io:event-loop" (lambda() (tpd2.datastore:datastore-use-file "datastore.log") (tpd2.io:event-loop)))