[MLton-user] Hypothetical question

Raymond Racine rracine@adelphia.net
Sat, 06 Nov 2004 13:46:34 -0500


On Sat, 2004-11-06 at 12:28, Henry Cejtin wrote:
> I would probably use the FFI on top of pgsql.  Not so much because of the
> `robustness' of the FFI, but because the actual underlying wire protocol is
> probably more likely to change than the interface that psql gives you.

Postgres is a fairly mature product, so the velocity of API changes are
not that much of a consideration.

Robustness was a poor choice, maybe flexible enough to accommodate. 
AFAIK there is no SWIG or other tool to generate bindings from .h files
for MLton.  Therefore wouldn't I have to enter into hand-to-hand combat
teasing data out of libpg's magic cookies (pointers to C structures),
and creating a number of C wrappers to handle castings, etc....  If the
API changes then I need to go at it again.

On the hand the range of messages are few, and the 2-3 field types are
trivial in nature.  

http://www.postgresql.com/docs/7.4/static/protocol-message-formats.html

The existing Java JDBC drive eschews JNI bindings to libpg and simply
generates and parses the message packets directly.  The only real
complication is the SSL/Kerbos support.  For that, I do not envision an
attempt to write that from the ground and looking toward an FFI
solution.  Since I don't require that level of support at this time, I
can ignore it for now.

Still mussing ....

Ray