Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] PostgreSQL and Ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-10-13 (14:25)
From: Alessandro Baretta <alex@b...>
Subject: Re: [Caml-list] PostgreSQL and Ocaml

Chris Hecker wrote:
>> If nobody has, would anyone like to join me in the project of writing 
>> an add-in for PostgreSQL supporting Ocaml stored procedures? I have 
>> little experience in this, but it should not be too difficult: it 
>> should be a matter of writing a C dll which, upon initialization, 
>> starts a bytecode compiler and interpreter, and has callbacks through 
>> with which the server can request the compilation of a text string or 
>> the execution of a bytecode cmo blob.
> I have no time to help you with this, but I have a suggestion.  I would 
> write this dll in caml and use the asmdynlink library (which, 
> unfortunately, is bound rather tightly into the apparently-moribund cdk 
> at this point, but it still appears to work). ...

This is an interesting point, but the main nightmare will be 
tying in PostgreSQL code into Ocaml. You have to consider 
that PostgreSQL is the SQL engine, and necessarily the 
embedded-Ocaml interpreter/runtime-system will have to be 
able to invoke such portions of the PostgreSQL system as are 
necessary to run queries and retrieve recordsets or to open 
and use cursors. So, C calls Caml which calls C which...

This reminds me of the autogénération de Caml:


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: