guile-user
[Top][All Lists]
Advanced

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

Re: new sqlite binding


From: Neil Jerram
Subject: Re: new sqlite binding
Date: Fri, 03 Dec 2010 18:35:01 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Andy Wingo <address@hidden> writes:

> But I would like to mention the downside of the dynamic FFI
> approach: with the static FFI you get typechecking by the C
> compiler, but with the dynamic FFI you're on your own.

Interesting point, thanks.

> I suppose you could also use the C compiler to at least check that the
> function type you declared is correct; if you want to do, at runtime,
>
>    (pointer->procedure int (dynamic-func "foo" (dynamic-link)) (list int32))
>
> you could at least make a compile-time check that
>
>     typedef int (*foo_type) (int32 bar);
>     int main (...)
>     { foo_type bar = foo; return 0; }
>     
> doesn't produce any warnings with -Wall, or something.

Hmm, that's almost as annoying as just writing the C code anyway.

I guess what we want is to validate Scheme FFI code against the relevant
C header file(s).  Hopefully something like SWIG or GCC modularisation
might give us that in the future.

      Neil



reply via email to

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