Wispy Lisp := A Lispy Web-framework by Howard Yeh hayeah@gmail.com ---Synopsis--- A unified syntax for web-programming. ---Proposal--- This web-framework would provide all the necessary tools to create a respectable, fully dynamic web-application. A programmer would code in a unified meta-syntax that subsumes html, css, javascript, sql, and lisp-- effectively blurring client/server scripting. HTML/CSS generation should paper over the (perverse) idiosyncrasies of certain web-browsers, and conform to web standards. The most infamous being, naturally, the box-model interpretation. In this case, the framework's generator should transparently attach the necessary fix (i.e. box-model hack). User can override this behavior. Parenscript covers primitive interface scripting. A lisp syntax to Google's AJAXSLT would allow higher abstraction to interface programming. This project would also include a mini data-persistence language by extending CLSQL. This mini-language would provide declarative specification of table definitions, relations, and constraint s. Instead of raw SQL for data retrieving/storing, a simple pattern matching syntax is used. In a typical application under this framework, the programmer would first specify the app's valid dataset with a declarative schema. This data schema determines the legal pattern matching syntax the programmer can use to access/persist data. The interface templating system helps the programmer to establish robust communication channels between client and server. By declaring "SETFable" places in various subtemplates, local/remote functions have well defined places to return their response. ---Syntax--- ............ Data Schema: ............ ;; Defines database ;; ;; In later iterations, perhaps redefines database safely. (def-schemas ) := ( *) := | := ( ) := ( ) := integer | (string ) | date := :many | :one ;; Example: (def-schemas (brain (blood-pressure integer) (color (string 32)) (smell (string 32)) (:many personality) (:one obsession) (:many dream)) (personality (complex (string 32)) (mood integer) (:many brain)) (obsession (nature (string 255)) (shrink (string 32)) (hourly-rate integer)) (dream (expiry-date date) (price integer)))) The 'id' fields of each schemas are implied. The ':many' relation generates an auxiliary table, and foreign keys in the related tables. Similarly, the ':one' relation. ............... Data Retrieval: ............... Now that we have a few brains in our database, we can fetch them. ;; Data query mini-language ;; ;; Data persisting is similar (with-data &key limit offset) := (? *) := ( ) | := | ( ) | := ( *) := < | <= | = | >= | > | or | and := :sum | :max | :min ;;Example (let-data ((b brain) (color (= color "jaundice")) (smell (or (= smell "rotten") (= smell "sour"))) ((p personality) complex mood ((b2 brain) smell (blood-pressure (> 150)) ((p2 personality) mood)))) (out (h1: "Down the meat grinder:") (:div (b-smell " stuff and " b-color)) (:div ("Perfectly suited for " b2-mood " clients with blood-pressure exceeding (or at): " (:em br-blood-pressure)))) :limit 100) 'let-data' binds the fields of the a matching record to corresponding symbols (possibly prefixed with table alias). The second argument provides an action to iterate over all the matching records. The matching conditions are collected and combined into the SQL 'where' statement. The join conditions are generated appropriately as defined by the schema. ........... Templating: ........... (def-wact ...) ;; Server action (def-jact ...) ;; Client action