From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Linas Vepstas Newsgroups: gmane.lisp.guile.user Subject: Re: new sqlite binding Date: Mon, 6 Dec 2010 22:46:33 -0600 Message-ID: References: <87r5e51u4n.fsf@ossau.uklinux.net> <877hfqemcq.fsf@ossau.uklinux.net> Reply-To: linasvepstas@gmail.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1291697228 21661 80.91.229.12 (7 Dec 2010 04:47:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 7 Dec 2010 04:47:08 +0000 (UTC) Cc: Andy Wingo , guile-user To: Neil Jerram Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Dec 07 05:47:02 2010 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PPpSA-0002dI-3S for guile-user@m.gmane.org; Tue, 07 Dec 2010 05:47:02 +0100 Original-Received: from localhost ([127.0.0.1]:34331 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPpS9-0003sd-FZ for guile-user@m.gmane.org; Mon, 06 Dec 2010 23:47:01 -0500 Original-Received: from [140.186.70.92] (port=45689 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PPpS5-0003ql-9P for guile-user@gnu.org; Mon, 06 Dec 2010 23:46:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PPpS3-00079W-Cx for guile-user@gnu.org; Mon, 06 Dec 2010 23:46:57 -0500 Original-Received: from mail-fx0-f41.google.com ([209.85.161.41]:39122) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PPpS3-00078Y-7w for guile-user@gnu.org; Mon, 06 Dec 2010 23:46:55 -0500 Original-Received: by fxm8 with SMTP id 8so711671fxm.0 for ; Mon, 06 Dec 2010 20:46:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:reply-to :in-reply-to:references:from:date:message-id:subject:to:cc :content-type:content-transfer-encoding; bh=AufxCZJcB/o3I3meepmE5BlDm+modqOn2BkJxA2VUYU=; b=VFcXiirV1WNDZy2mg2f/gcRXAIrTZPY8CGzCoTSzMXN/UxYGGZ9s+dxyL7KAwLuDt9 LwzuznkOhUs/bbqYo4i7vzC70UxGXdqc/NRXC8ViFLvOAWP7qIzDmRqhEJwHyMRN2xmP 2LcxbSttq6+yvebiBA8lfhB4M+9u+bFqrKcxo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type:content-transfer-encoding; b=FQruhndxZItWIitxfIPI8DtKCVUCOn3c5s3+b6H7IrhQszDojpAQt5HzqyxWeQsS27 RNDFQ9ILGbgMWoobj4KP4Q0z1KBogWD0MsxHHxKxzvAVXEmki7b0plKjPMsazNf7rAiL iQ4jAHJo1FAnsPkjIfy0Jo/FeNDSfmFfxXpmA= Original-Received: by 10.223.122.196 with SMTP id m4mr2073317far.123.1291697213545; Mon, 06 Dec 2010 20:46:53 -0800 (PST) Original-Received: by 10.223.147.198 with HTTP; Mon, 6 Dec 2010 20:46:33 -0800 (PST) In-Reply-To: <877hfqemcq.fsf@ossau.uklinux.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8296 Archived-At: On 3 December 2010 12:35, Neil Jerram wrote: > Andy Wingo 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, >> >> =C2=A0 =C2=A0(pointer->procedure int (dynamic-func "foo" (dynamic-link))= (list int32)) >> >> you could at least make a compile-time check that >> >> =C2=A0 =C2=A0 typedef int (*foo_type) (int32 bar); >> =C2=A0 =C2=A0 int main (...) >> =C2=A0 =C2=A0 { foo_type bar =3D 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). =C2=A0Hopefully something like SWIG or GCC modularisati= on > 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