views:

1614

answers:

9

I keep hearing that Lisp is a really productive language, and I'm enjoying SICP. Still, I'm missing something useful that would let me replace PHP for server-side database interaction in web applications.

Is there something like PHP's PDO library for Lisp or Arc or Scheme or one of the dialects?

A: 

Cliki is a good resource for Common Lisp libraries: http://www.cliki.net/database

There is a project named Elephant (http://common-lisp.net/project/elephant/index.html), which is an abstraction for object persistence in CL.

Ali
+1  A: 

newLISP - http://www.newlisp.org/ - has support for MySQL, but I haven't used it (newLISP).

Jeremy Weathers
Be forewarned. If you're injto SICP, newLISP will disapoint you greatly.
jfm3
A: 

If you're happy with SQL as part of your life, CL-SQL provides a mapping into CLOS objects. It appears to be more mature than Elephant.

I'm using it on my own website.

John McAleely
A: 

We use SBCL, UCW, CL-SQL and MySQL as our back-end for Paragent.com. It has worked very well for us. We also have a number of clients using UCW/CL-SQL/MySQL for custom sites we have built them through our consulting arm Bitfauna.

+2  A: 

newLisp has support for mysql5 and if you look at the mysql5 function calls, you'll see that it's close to PDO.

barce
A: 

I've had good success with SBCL and CL-SQL. CL-SQL has a object mapping API, but I used the plain SQL API which simply returns lists and this worked well enough. And in the Clojure language, you interact with JDBC through a maps or structs {:col1 "a", :col2 "b"}, so a generated class library doesn't get you any simpler code, the language handles it nicely. In my experience, there is less cruft between lisp and sql than between more static languages and sql.

Mike H
+1  A: 

our Common Lisp ORM solution is http://common-lisp.net/project/cl-perec/

the underlying SQL lib is http://common-lisp.net/project/cl-rdbms/ (fully tested with PostgreSQL, has a toy SQlite backend and a somewhat tested Oracle backend)

we started out using CLSQL, but after some struggle we decided to roll our own.

these libs and PostgreSQL are used in a clustered web application developed for the Hungarian government for planning the budget of the municipalities. it has about 4000 users, 500 at peek time. a little more info is available at http://common-lisp.net/project/cl-dwim/

Attila Lendvai
A: 

Since nobody has mentioned it, you can try Postmodern, which is an interface to PostgreSQL. It aims for a tighter integration with PostgreSQL and so doesn't pretend to portability between databases.

I've put it together with hunchentoot and cl-who and built a pretty nice website.

twopoint718
+1  A: 

As long as you're switching your Webapp on Lisp, consider using persistence: you now have a constantly running Lisp image that holds everything about your application. I personnally used Elephant for that.

Elephant can use CL-SQL or BDB as it's backend, which means that you can use MySQL if you have one running. I found using SQLite really practical, though.

Nowhere man