From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: DSO-style FFI Date: Tue, 08 Oct 2013 15:42:04 -0400 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <87wqlnv9bn.fsf@flea.lifelogs.com> References: <877gdqrc9u.fsf@flea.lifelogs.com> <87mwmmp05f.fsf@flea.lifelogs.com> <87fvsdpato.fsf@flea.lifelogs.com> <8738oc20xk.fsf@flea.lifelogs.com> <87d2ngzlyl.fsf_-_@flea.lifelogs.com> <87siwcxda7.fsf@flea.lifelogs.com> <87zjqjfz36.fsf@fleche.redhat.com> Reply-To: emacs-devel@gnu.org NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1381261343 27889 80.91.229.3 (8 Oct 2013 19:42:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 8 Oct 2013 19:42:23 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 08 21:42:27 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 1VTdAo-0000nB-6W for ged-emacs-devel@m.gmane.org; Tue, 08 Oct 2013 21:42:26 +0200 Original-Received: from localhost ([::1]:38658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTdAn-0002q7-P8 for ged-emacs-devel@m.gmane.org; Tue, 08 Oct 2013 15:42:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35281) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTdAb-0002bj-In for emacs-devel@gnu.org; Tue, 08 Oct 2013 15:42:20 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VTdAU-0007L3-5E for emacs-devel@gnu.org; Tue, 08 Oct 2013 15:42:13 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:37859) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VTdAT-0007KX-Tq for emacs-devel@gnu.org; Tue, 08 Oct 2013 15:42:06 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1VTdAR-0000ag-Qj for emacs-devel@gnu.org; Tue, 08 Oct 2013 21:42:03 +0200 Original-Received: from c-98-229-61-72.hsd1.ma.comcast.net ([98.229.61.72]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Oct 2013 21:42:03 +0200 Original-Received: from tzz by c-98-229-61-72.hsd1.ma.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 08 Oct 2013 21:42:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: emacs-devel@gnu.org Original-Lines: 29 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: c-98-229-61-72.hsd1.ma.comcast.net X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" Mail-Copies-To: never User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:Zoh70n3dzQRe0VmpkUA24z9bzUo= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:164019 Archived-At: On Tue, 08 Oct 2013 11:32:13 -0600 Tom Tromey wrote: Stefan> Well, it doesn't exist for Emacs, so you won't be able to use until you Stefan> write it. AFAIK it's been usable for a decade in XEmacs. Tom> This approach seems very weird to me. Tom> I don't understand why it is preferable to a libffi-based FFI. Tom> The main difficulty I see is that now you're either promising an Tom> internal Emacs ABI -- hard to do -- or you're requiring recompilations Tom> whenever Emacs changes -- hard on users. Would any kind of FFI help with data formats? I don't think so, right? The foreign function has to take Emacs Lisp_Objects (maybe just strings and numbers) and package its return data in a Lisp_Object. So how do we handle that glue with libffi or anything else without promising some minimal internal Emacs ABI? Stefan> One issue will be compatibility of various kinds of dl_open Stefan> mechanisms on various OSes, but you should find lots of help for Stefan> that here, so the first version can focus on supporting only Stefan> GNU/Linux. Tom> GNU already has libltdl. I don't know much about libltdl but it seems fairly simple, except for the requirement to name all exported symbols _modulename_LTX_* which is a bit annoying. Ted