Wednesday, June 25th, 2008
No matter how much Paul Graham talks about his Web success, we don’t hear too often about Lisp-powered Web applications.
SymbolicWeb is offering up a new type of framework to help change that.
SymbolicWeb aims to create a GUI framework similar to GTK+ and QT for Common Lisp. It differs in that it uses the browser to render the UI elements.
There are a slew of examples, such as this simple echo chat program:
;;;; http://nostdal.org/ ;;;;
(defparameter *max-chat-pane-size* 100)
(defapp chat-app (empty-page-app)
(chat-pane :allocation :class (mk-container nil))))
(defuri chat-app “chat”)
(defmethod main ((chat-app chat-app))
(with-slots (input chat-pane) chat-app
(setf (on-enterpress-of input
:callback-data `((:input-value . ,(js-code-of (value-of input)))) ;; Include some data when the event fires.
:js-after (js-code-of (setf (value-of input) “”))) ;; Clear the input field after the event has been fired and sent.
(lambda (&key input-value)
(prepend (mk-span (escape-for-html input-value) :display “block”)
;; Don’t let it grow too big; delete some chat history.
(when (> (length (children-of chat-pane)) *max-chat-pane-size*)
(dolist (span (subseq (children-of chat-pane) *max-chat-pane-size*))
(mk-span (who (:p “Type something in and press enter. New content is added at the top.”)))
Posted by Dion Almaer at 5:00 am