sábado, 28 de enero de 2012

Lisp and the web (probably part 1)

I've tried some lisp frameworks with different intensities and approaches, without settling with anyone of those. Just looking around.

As a first approach, I'm going for the minimalist frameworks. Caveman (on top of Clack), and RESTAS.

My first experience is with caveman, as I want something really simple, and known. Not that I've worked with Sinatra/Rack nor Flask/WSGI, but at least, the architecture is more well known that with other fw like weblocks or RESTAS.

With Toni, we've been hacking a bit our way to do a super simple micro app. And we stumbled upon a few WTFs, or undocumented Caveman spots, or just blockers for us due to our lisp newbieness. Luckily, most of them are solved now :)
  • In GETs, (getf params :id) work, but in post POSTs, the symbols are presented in a different format (getf params :|id|). As davazp pointed, this probably has some problems issues with CL never garbage collecting those interned symbols.
  • clsql:*default-database*. clsql will use *default-database* database handler if you dont's specify any. This makes using clack's middleware for clsql transparent from caveman apps.
  • Getting caveman through quicklisp threw some erros during installation. Installing newer version of sbcl just solved it. (http://comments.gmane.org/gmane.lisp.steel-bank.announce/111)
     * new feature: SB-EXT:VALID-TYPE-SPECIFIER-P returns whether a given type
specifier is valid where "valid" basically means "would be accepted as
second argument of TYPEP".

  • cl-project doesn't create the link in ~/quickload/local-projects on new generated projects . If you create your projects under ~/quickload/local-projects, quicklisp will be able to quickload it, but if you put it somewhere else, you should create a link to your project.


I'm now struggling with form-builder, and widgets (no docs nor examples at all). We'll see how it goes.