[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FFI in Emacs

From: joakim
Subject: Re: FFI in Emacs
Date: Sat, 25 Aug 2012 20:20:19 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.50 (gnu/linux)

Aurélien Aptel <address@hidden> writes:

> Hi all,
> Joakim, thank you for your work! Did you make any progress since then?
> I was wondering, is anyone else working on this?
> The patch mentioned earlier to load dynamically compiled modules is
> not a FFI but it can be useful nonetheless. Why not have both?

I commited the GIR patch to the xwidget emacs repo. You can already do
ings with it:

- create gnome objects dynamically(previously only hardcoded objects
were possible)

- dynamically call their methods, with an (early) lisp to C object

Anyway, a FFI needs type information from somewhere, and with GIR you
get that from 
e library provider. Therefore GIR is IMHO more interesting than  plain
FFI. You can also provide GIR typelib wrappers that would benefit all
GIR implementations, not only the xwgir one in the xwidget branch.

Well maybe that wasnt so clear. Hear is a concrete example:
- you want to call the libmagic file info functions
- wrap libmagic in a tiny wrapper that provides gir typeinfo
- now you can call these libmagic functions from Emacs, and the xwgir
functions can figure out how to convert elisp data to the data needed by
the library.
- but now your friends using gir from python etc can also benefit your

I think this is the right aproach, but it does not exclude a plain FFI

Joakim Verona

reply via email to

[Prev in Thread] Current Thread [Next in Thread]