From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: FFI again Date: Mon, 07 Oct 2013 00:58:42 -0400 Message-ID: References: <87iox9luwa.fsf@uwakimon.sk.tsukuba.ac.jp> <87hactlmx0.fsf@uwakimon.sk.tsukuba.ac.jp> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1381121943 23729 80.91.229.3 (7 Oct 2013 04:59:03 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Oct 2013 04:59:03 +0000 (UTC) Cc: joakim@verona.se, emacs-devel@gnu.org To: "Stephen J. Turnbull" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 07 06:59:06 2013 Return-path: Envelope-to: ged-emacs-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 1VT2uO-0004zH-Ov for ged-emacs-devel@m.gmane.org; Mon, 07 Oct 2013 06:59:04 +0200 Original-Received: from localhost ([::1]:57376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT2uO-0004BV-GG for ged-emacs-devel@m.gmane.org; Mon, 07 Oct 2013 00:59:04 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT2uF-00049f-Cl for emacs-devel@gnu.org; Mon, 07 Oct 2013 00:59:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VT2u4-0007Ur-9u for emacs-devel@gnu.org; Mon, 07 Oct 2013 00:58:55 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:28327) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VT2u4-0007Un-5O for emacs-devel@gnu.org; Mon, 07 Oct 2013 00:58:44 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFHO+K8t/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOkeoFegxM X-IPAS-Result: Av4EABK/CFHO+K8t/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="34903656" Original-Received: from 206-248-175-45.dsl.teksavvy.com (HELO fmsmemgm.homelinux.net) ([206.248.175.45]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 07 Oct 2013 00:55:07 -0400 Original-Received: by fmsmemgm.homelinux.net (Postfix, from userid 20848) id F1AF4AE4CB; Mon, 7 Oct 2013 00:58:42 -0400 (EDT) In-Reply-To: <87hactlmx0.fsf@uwakimon.sk.tsukuba.ac.jp> (Stephen J. Turnbull's message of "Mon, 07 Oct 2013 13:34:03 +0900") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:163938 Archived-At: > That's not FFI. Are you confusing runtime loading of DSOs with a > foreign function interface (FFI)? No, I'm not, but indeed what I propose is a kind of middle ground: in normal FFI you describe the external library's ABI in some kind of domain specific language (DSL) that is then interpreted/compiled into wrappers to massage the data in a form understandable by the host language. So what I propose is to use "runtime loading of DSO" as a poor man's FFI where the DSL of the FFI is C and where the compilation of this "DSL" is handled by a C compiler. The only technical difference between what I propose and typical "runtime loading of DSOs" is that the system also handles running the C compiler, so you can download the TedZ-OpenPGP package from ELPA and install it (provided you have a C compiler on your machine). Stefan