unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Linas Vepstas <linasvepstas@gmail.com>
To: Neil Jerram <neil@ossau.uklinux.net>
Cc: Andy Wingo <wingo@pobox.com>, guile-user <guile-user@gnu.org>
Subject: Re: new sqlite binding
Date: Mon, 6 Dec 2010 22:46:33 -0600	[thread overview]
Message-ID: <AANLkTin3HUt5a3+_8k6A0mck8-PXPtN6ohVt+_A0+maO@mail.gmail.com> (raw)
In-Reply-To: <877hfqemcq.fsf@ossau.uklinux.net>

On 3 December 2010 12:35, Neil Jerram <neil@ossau.uklinux.net> wrote:
> 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.

Would g-wrap work?  I remember g-wrap was written about 10 years ago,
back when swig didn't work so well, and certainly didn't work well with
guile.  But I had the impression that g-wrap went defunct. Not sure.

(what do I know? for all I know, maybe g-wrap morphed into ffi).

--linas



  reply	other threads:[~2010-12-07  4:46 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
2010-12-07  4:46         ` Linas Vepstas [this message]
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=AANLkTin3HUt5a3+_8k6A0mck8-PXPtN6ohVt+_A0+maO@mail.gmail.com \
    --to=linasvepstas@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=neil@ossau.uklinux.net \
    --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).