From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.user Subject: Re: new sqlite binding Date: Fri, 03 Dec 2010 18:35:01 +0000 Message-ID: <877hfqemcq.fsf@ossau.uklinux.net> References: <87r5e51u4n.fsf@ossau.uklinux.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1291401319 25639 80.91.229.12 (3 Dec 2010 18:35:19 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 3 Dec 2010 18:35:19 +0000 (UTC) Cc: guile-user To: Andy Wingo Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Dec 03 19:35:15 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 1POaTR-0001Oo-RI for guile-user@m.gmane.org; Fri, 03 Dec 2010 19:35:13 +0100 Original-Received: from localhost ([127.0.0.1]:45815 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POaTR-0005ub-9Z for guile-user@m.gmane.org; Fri, 03 Dec 2010 13:35:13 -0500 Original-Received: from [140.186.70.92] (port=47243 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POaTM-0005uB-E9 for guile-user@gnu.org; Fri, 03 Dec 2010 13:35:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1POaTL-0002RU-9i for guile-user@gnu.org; Fri, 03 Dec 2010 13:35:08 -0500 Original-Received: from mail3.uklinux.net ([80.84.72.33]:53562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1POaTL-0002QW-50 for guile-user@gnu.org; Fri, 03 Dec 2010 13:35:07 -0500 Original-Received: from arudy (unknown [78.149.200.254]) by mail3.uklinux.net (Postfix) with ESMTP id 5F9E81F6B43; Fri, 3 Dec 2010 18:35:05 +0000 (GMT) Original-Received: from neil-laptop (neil-laptop [192.168.11.7]) by arudy (Postfix) with ESMTP id 5413E38013; Fri, 3 Dec 2010 18:35:02 +0000 (GMT) In-Reply-To: (Andy Wingo's message of "Mon, 29 Nov 2010 21:50:29 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6 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:8288 Archived-At: 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, > > (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