From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: FFI again Date: Sat, 05 Oct 2013 20:07:06 +0300 Message-ID: <83bo337ikl.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1380992850 8291 80.91.229.3 (5 Oct 2013 17:07:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Oct 2013 17:07:30 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Oct 05 19:07:33 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 1VSVKG-0001uu-Pv for ged-emacs-devel@m.gmane.org; Sat, 05 Oct 2013 19:07:32 +0200 Original-Received: from localhost ([::1]:52466 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSVKG-0003Cc-BE for ged-emacs-devel@m.gmane.org; Sat, 05 Oct 2013 13:07:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48887) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSVK7-0003Bb-KQ for emacs-devel@gnu.org; Sat, 05 Oct 2013 13:07:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VSVK1-0002R3-AZ for emacs-devel@gnu.org; Sat, 05 Oct 2013 13:07:23 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:44719) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VSVK1-0002Q4-2P for emacs-devel@gnu.org; Sat, 05 Oct 2013 13:07:17 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0MU700E00GJAM100@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Sat, 05 Oct 2013 20:07:15 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0MU700EL8GW3EWA0@a-mtaout21.012.net.il>; Sat, 05 Oct 2013 20:07:15 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 X-Received-From: 80.179.55.169 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:163885 Archived-At: > From: Stefan Monnier > Date: Sat, 05 Oct 2013 12:11:26 -0400 > > I think a "cheapish" way to do that is to make it possible for an ELPA > package to come with a .c file that exports a "syms_of_module" function > that can call things like defsubsr. > > Installing such an ELPA package would require running a C compiler, > obviously (unless we also provide some pre-compiled versions for > particular target systems?). And we'd need to add some function that > can load the resulting compiled object (along with the .so libraries it > depends on, since in many cases the whole purpose would be to call > functions in those .so libs). On Windows, having a foreign library call any of the functions implemented within Emacs will require us to produce an import library, as part of building Emacs. It's easy to do that, and GNU Make in its latest pretest already does something similar, but I thought I'd mention that anyway. When the .c file in question is linked into a shared library, the import library will have to be passed to the linker as one of the command-line arguments.