unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Neil Jerram <neil@ossau.uklinux.net>
To: Andy Wingo <wingo@pobox.com>
Cc: guile-user <guile-user@gnu.org>
Subject: Re: new sqlite binding
Date: Fri, 03 Dec 2010 18:35:01 +0000	[thread overview]
Message-ID: <877hfqemcq.fsf@ossau.uklinux.net> (raw)
In-Reply-To: <m34oazzwfe.fsf@unquote.localdomain> (Andy Wingo's message of "Mon, 29 Nov 2010 21:50:29 +0100")

Andy Wingo <wingo@pobox.com> 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	other threads:[~2010-12-03 18:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25 14:12 new sqlite binding Andy Wingo
2010-11-27  6:20 ` Linas Vepstas
2010-11-28 11:51   ` Neil Jerram
2010-11-28 16:08     ` Linas Vepstas
2010-11-29 21:11       ` Andy Wingo
2010-11-29 20:50     ` Andy Wingo
2010-12-03 18:35       ` Neil Jerram [this message]
2010-12-07  4:46         ` Linas Vepstas
2010-12-07  9:50           ` Neil Jerram
2010-11-29 20:43   ` Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877hfqemcq.fsf@ossau.uklinux.net \
    --to=neil@ossau.uklinux.net \
    --cc=guile-user@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).