David Vázquez

16 July 2013

PostgreSQL from Lisp

  • lisp

Hello everybody,

It has been a long time before my last post. Many things happened: I had a great time in ECL2013, I wrote a code generator for JSCL, exams in the university… and suffering the heat at home in Spain, of course.

These days, at work, I am migrating our old SQL Server to PostgreSQL. We used to use CLSQL to access to the server from Lisp-side, but in a very straightforward way. We built everything on query. Although CLSQL is a big monster, it misses parametric queries, and you have to escape arguments yourself. Indeed, it was not as much stable as I would like. But let apart exotic features.

Therefore I gave a try to other libraries. The obvious choice would be Postmodern, but it failed soon. DAO capabilities seem incomplete and, I think, they should be other library, but I can live ignoring it. However, have a look to query: it has a strange arg/format mix and it is a macro! It means you will fail to build simple abstractions on it.

Fortunately, Postmodern's author created a lower library cl-postgres, which I can suit easily:

(defun query (query &rest args)
  (cl-postgres:prepare-query *database* "" query)
  (cl-postgres:exec-prepared *database* "" args 'cl-postgres:list-row-reader))

but of course I will have to write connection pooling and other features myself, or perhaps mix postmodern and cl-postgres carefully.

In conclusion, I think we should be a little bit more conventional in the abstractions we build, and not to forget intermediate abstractions.

01 May 2013

The surprising JSCL rising

  • lisp

I am just back from a few days of holidays and have seen how active JSCL is! It is really exciting.

This rising is due to abeaumont probably. I stopped working, but he came up with an idea I liked. It is, why don't integrate JSCL into Conkeror? We would end up with a Lisp programmable browser… that's a practical reason! We did some tests locally and it seemed to work, but now it is time for improving JSCL itself.

It is not the only platform where JSCL could run on. I plan to add support for Node JS. Indeed, it will let us use the REPL and tests in the terminal in addition to the browser, which is a much more convenient way to program.

In the meantime, I would like to improve the compiler a little bit.

Suggestion and patches are very welcome if you want to join us.


11 April 2013

Back in action

Hello everyone. I have been away some days from the computer, but I am back now! I have spent two weeks in New York visiting such a great city. I had the opportunity to attend to a LispNYC meetup and enjoy the great atmosphere there. I hope to come back soon.

I have also a new laptop. Finally, I have to say, as I inherited the last one from my brother and I have been using it for 6 years. Most of the time it was good enough but it is becoming very annoying. For example, I could not compile SBCL because it was restarted due to overheating..

I feel like doing things now so I wish I could tell you new adventures soon.

06 March 2013

Forth model illustration

  • forth

I like old systems which expose a good part of their internals, specially when they are so simple. I created this animation using ditaa to illustrate how execution is done in Forth:


Of course, it only makes sense if you already know Forth. But I guess you do not know many languages where such thing is possible.


Copyright © 2013 David Vázquez
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
  Commons License