[Haskell-cafe] Re: Haskell binding to Berkeley DB?

John Goerzen jgoerzen at complete.org
Fri Feb 4 10:15:14 EST 2005


On 2005-02-04, Dimitry Golubovsky <dimitry at golubovsky.org> wrote:
> Hi,
>
> Has anyone tried/been successful on developing such a binding?

Funny you should ask.  I released one yesterday.

http://quux.org/devel/missingpy/html/MissingPy.AnyDBM.html#v%3AopenSpecificDBM

(Download from http://quux.org/devel/missingpy/)

That does go via Python, but Python uses the C binding so the
performance hit should be minimal.  Python is also highly portable and
easy to install, so the convenience hit should also be minimal.  Python
is also a strongly typed language with exceptions that get propogated
into Haskell, so the reliability hit should also be minimal :-)

FWIW, this binding works with any *dbm that is supported by Python,
which includes dbhash, (n)dbm, gdbm, and its own dumbdbm.

I also wrote a StringDBM available in my MissingH library
(quux.org/devel/missingh).  It is slow and simple, using a HashTable as
an in-memory representation and reading/writing it from disk as needed.
If all you need is simple persistence, that may do it for you, without
requiring any non-Haskell binding at all.  If you need the other
benefits of *dbm, MissingPy may be what you need.

-- John




More information about the Haskell-Cafe mailing list