RFC on plans to implement a c2ffi->cffi generator

Luís Oliveira luismbo at gmail.com
Fri Dec 11 17:26:23 UTC 2015


On Fri, Dec 11, 2015 at 5:09 PM, Attila Lendvai <attila at lendvai.name> wrote:
> are you saying that the json output could be converted to some sexp
> form with a macro on the top, so that the macro could expand into the
> cffi definitions? and this file should be the one that gets checked in
> to the repos, not the json file? (as opposed to generating a
> standalone tmp lisp file from the json file holding the cffi
> definitions in the ASDF fasl cache; which is done already)

No need for the macro on the top, that macro could be defined a priori
somewhere else in cffi-c2ffi.


> cl-json itself reads it into alists, so it shouldn't be hard... but
> what would we gain? one slight drawback would be that M-. would take
> us to the big toplevel macro, not the actual cffi definition.

So if the resulting spec file looked something like

   ;; spec file starts here
   (cffi-c2ffi:definition foo ...)
   (cffi-c2ffi:definition bar ...)
   (cffi-c2ffi:definition baz ...)
   ;; spec file ends here

Then M-. takes us to one of the definitions and the actual CFFI
definition would be a macroexpansion away.

What do we gain? I'm not sure. I think this way is more lispy and less
complex, but that's just a gut feeling at this point.

Cheers,

-- 
Luís Oliveira
http://kerno.org/~luis/



More information about the cffi-devel mailing list