RFC: INLINE defcfun and auto FTYPE declarations [with patch]

Luís Oliveira luismbo at gmail.com
Mon Nov 6 15:38:22 UTC 2017


Hi Andrzej,

On Wed, Nov 1, 2017 at 10:43 PM, Andrzej Walczak
<andrzejwalczak at google.com> wrote:
> Recently we have migrated one of our largest projects from our home-grown
> foreign-function interface implementation to CFFI.
> The project is almost 1M LOC with almost 1K of foreign-functions.

Cool! That's interesting to know!


> The attached patch contains a proposal that we would like to share.
> Please, let us know about any modification necessary that would make this
> patch useful for a larger community.

The idea of automatically inlining DEFCFUNs when SPACE > 2 > DEBUG is
interesting. If we go down that route, we'd better be consistent
across lisps, but I wonder if there's such a thing is possible when
the optimisations vary so much across Lisps. Are CL otimisation
declarations the best way to control the optimisation? I'm skeptical.
I'm also a bit worried about using SBCL internals.

I'm curious to know the purpose of the declarations. Are you mostly
taking advantage of SBCL's declarations-as-assertions behaviour or are
you looking for some sort of optimisation? Do you have any examples
showing how they help?

Cheers,

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



More information about the cffi-devel mailing list