From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: Dynamic FFI vs Static FFI (was Re: About Guile crypto support) Date: Tue, 12 Feb 2013 14:52:56 +0100 Message-ID: <87fw11wsef.fsf@gnu.org> References: <1359896146.2754.19.camel@Renee-desktop.suse> <871ucvof60.fsf@gnu.org> <1360032192.2754.61.camel@Renee-desktop.suse> <87mwvisqwj.fsf@gnu.org> <878v6yojxg.fsf@gnu.org> <87sj55bjxz.fsf@gnu.org> <1360576299.5068.20.camel@Renee-desktop.suse> <87pq06x9ms.fsf_-_@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1360677204 21200 80.91.229.3 (12 Feb 2013 13:53:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Feb 2013 13:53:24 +0000 (UTC) Cc: Andy Wingo , guile-devel@gnu.org, Greg Troxel To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Feb 12 14:53:40 2013 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1U5GIe-0001h5-MY for guile-devel@m.gmane.org; Tue, 12 Feb 2013 14:53:32 +0100 Original-Received: from localhost ([::1]:55994 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5GIL-0002CY-Cd for guile-devel@m.gmane.org; Tue, 12 Feb 2013 08:53:13 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:40930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5GIH-0002CE-US for guile-devel@gnu.org; Tue, 12 Feb 2013 08:53:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U5GIF-0004yl-Rq for guile-devel@gnu.org; Tue, 12 Feb 2013 08:53:09 -0500 Original-Received: from [2a01:e0b:1:123:ca0a:a9ff:fe03:271e] (port=51123 helo=xanadu.aquilenet.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U5GIF-0004xN-LJ for guile-devel@gnu.org; Tue, 12 Feb 2013 08:53:07 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id EDF4DC26D; Tue, 12 Feb 2013 14:52:57 +0100 (CET) Original-Received: from xanadu.aquilenet.fr ([127.0.0.1]) by localhost (xanadu.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 43FTmfRmvQ+T; Tue, 12 Feb 2013 14:52:57 +0100 (CET) Original-Received: from pluto (unknown [193.50.110.135]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id 96BE8272A; Tue, 12 Feb 2013 14:52:57 +0100 (CET) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 24 =?utf-8?Q?Pluvi=C3=B4se?= an 221 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87pq06x9ms.fsf_-_@tines.lan> (Mark H. Weaver's message of "Tue, 12 Feb 2013 02:40:43 -0500") User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2a01:e0b:1:123:ca0a:a9ff:fe03:271e X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15734 Archived-At: Mark H Weaver skribis: > It seems to me that the dynamic FFI performs, at run time, the same jobs > that a C compiler performs at compile time. If at some point we add > support for accessing preprocessor macros and type definitions (which > seems important), then we'll need the header files as well. So it makes > sense to me that a full-featured dynamic FFI fundamentally depends on > information that's only available in the *-dev packages. I don=E2=80=99t think you would parse header files at run-time. I=E2=80=99= d rather do this at macro expansion time. Overall, I think it=E2=80=99s good to pay attention to what popular distros= do, while at the same time keeping in mind that we=E2=80=99re not bound by their policies, and could very well come up with use cases that are hindered by these policies. > At some point, it might make sense to create a more static FFI that > works more like a C compiler does, splitting the job into compile-time > and run-time phases. This static FFI would be strictly less powerful > than the dynamic FFI, in a similar sense to how syntactic record APIs > are less powerful than procedural ones. However, the static FFI would > be sufficient in most cases, and would have some advantages. In my mind the =E2=80=9Cstatic FFI=E2=80=9D is the C API, and the dynamic F= FI is (system foreign). To me, the main advantage of the latter is its simplicity of use and deployment. Thanks, Ludo=E2=80=99.