I think it would be cool to have a foreign function interface that
could work both dynamically, by calling functions using libffi, and
statically, by generating stubs. Then you could hack around in
dynamic mode, and then flip a switch and generate C code for speed, or
simplicity of distribution.
> Yep, but my machine is already fast enough that performance isn't an
> issue any more (since the main hit is in initialization), and it's two
> years old.
Are you sure? libffi does stuff at run-time, on every function call.
I would guess that whether the overhead is negligible depends on how
heavily you're calling the foreign functions.