Andy Chambers a écrit :
Hi,
I want to be able to use monetdb from common lisp and was looking at the other language bindings for clues on how to write one for cl. Python and Ruby seem to communicate using a socket rather than use the C api.
However, in common lisp it's relatively easy to use C bindings (though CFFI) so I'd rather use them if I thought they were going to continue to be supported.
Are there any other factors I should consider in deciding which API to use?
Many Thanks, Andy
I guess that the standard way to go would be to communicate through a socket. Provides the advantage of running the client on another machine than the server, quite obviously. The C api is fairly exhaustively documented, but not necessarily easy to read. That's one thing to consider. But if you want in the end to have a tight, low-level integration with the server (for example an embedded server), then it's the natural way to go. In the end, I believe both approaches should be supported by a binding. I've chosen the C approach, because OCaml is compiled rather efficiently to machine code, and it would be a shame not to take advantage of it. Concerning Lisp, you may have another opinion. If you go the C way, I'd strongly suggest to first target reproducing example 1.78.6.1 of m5manual.pdf in Lisp. You can have a look at my Objective Caml binding there: http://yziquel.homelinux.org/gitweb/?p=ocaml-monetdb5.git;a=tree The 1.78.6.1 example is reproduced in the test/ directory. All the best, -- Guillaume Yziquel http://yziquel.homelinux.org/