lessand.ro

>>> Building in Lisp

I have always been fascinated by obscure technologies, after reading Paul Graham essays about ViaWeb I decided to spend the weekend to learn lisp.

>>> Starting out

Being a strong vim user I have mixed feeling about using emacs for writing Lisp. Turns out you need to use emacs, since is actually built in Lisp. I am following Practical Common Lisp and the Common Lisp Cookbook to get started (since getting a hold on Paul Graham "Ansi Common Lisp" book is surprisingly hard. Together with the book I am also followinig 6.001 Structure And Interpretation of Computer Program, a course from MIT from 1986 about Lisp.

My firsts attempt is building a toy database query language (e.g. SQL) in Lisp. I am trying to do it along side with python, and I am pushing the limits of its functional programming style: In Lisp we are writing closures for WHERE clauses, and we construct SELECT statements that passes around those closures. With Python I am applying filters passing around lambda functions and so far it holds. But if we try to write UPDATE statements, keeping Python functional starts to make the code totally unreadable. On the other hand, Lisp is code still looks pretty clean: we use funcall to apply the WHERE closure.

© Alessandro Solbiati. Built using Python 2.7.10 and Flask 1.0.2 only. Read the code on the github repo.