[Haskell-cafe] ANNOUNCE: cinvoke 0.1 released

Remi Turk rturk at science.uva.nl
Mon Mar 7 19:32:04 CET 2011


On Mon, Mar 07, 2011 at 09:41:27AM +0000, Max Bolingbroke wrote:
> Hi Remi,
> 
> On 6 March 2011 13:38, Remi Turk <rturk at science.uva.nl> wrote:
> > I am happy to finally announce cinvoke 0.1, a binding to the
> > C library cinvoke[1], allowing functions to be loaded and called
> > whose names and types are not known before run-time.
> 
> As the author of the libffi package
> (http://hackage.haskell.org/package/libffi-0.1) which does a similar
> thing, could you say when it would be appropriate to use one or the
> other package?
> 
> Cheers,
> Max

Of course:

- libffi doesn't do library/function loading; you'll need to use
  System.Posix.DynamicLinker or System.Win32.DLL for that.
  cinvoke will not only load your libraries and functions,
  but even collect the garbage afterwards.
- Things seem to have changed, but back when I first looked at
  cinvoke, getting libffi to run under windows didn't seem too
  realistic.
- If you need to pass C structs (by value), you'll have to use
  libffi: cinvoke doesn't support them at all.
- The current version of libffi is not exception safe (I do have
  some code lying around here though...)
- cinvoke is actually haddockized (although hackage still hasn't
  generated the docs, apparently).

Groeten, Remi



More information about the Haskell-Cafe mailing list