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: Why not zlib-compress-region? Date: Fri, 27 Jun 2014 18:07:38 -0400 Message-ID: References: <53AC0D17.9020604@yandex.ru> <53AD8EA8.9090805@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1403906882 16724 80.91.229.3 (27 Jun 2014 22:08:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 27 Jun 2014 22:08:02 +0000 (UTC) Cc: =?windows-1252?Q?Aur=E9lien?= Aptel , Leo Liu , Emacs development discussions To: Dmitry Antipov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 28 00:07:56 2014 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 1X0eJI-0000pP-By for ged-emacs-devel@m.gmane.org; Sat, 28 Jun 2014 00:07:56 +0200 Original-Received: from localhost ([::1]:52709 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0eJH-0003jt-Pd for ged-emacs-devel@m.gmane.org; Fri, 27 Jun 2014 18:07:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44822) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0eJ8-0003bW-EM for emacs-devel@gnu.org; Fri, 27 Jun 2014 18:07:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0eJ2-0001au-2s for emacs-devel@gnu.org; Fri, 27 Jun 2014 18:07:46 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:57995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0eJ1-0001ac-Vj for emacs-devel@gnu.org; Fri, 27 Jun 2014 18:07:40 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwY7gw/APYEXF3SCJQEBAQECAVYjEAsOJhIUGA0kiAQIDdIMF456B4Q4BKkZgWqDTCE X-IPAS-Result: ArYGAIDvNVNLd+D9/2dsb2JhbABZgwY7gw/APYEXF3SCJQEBAQECAVYjEAsOJhIUGA0kiAQIDdIMF456B4Q4BKkZgWqDTCE X-IronPort-AV: E=Sophos;i="4.97,753,1389762000"; d="scan'208";a="69779359" Original-Received: from 75-119-224-253.dsl.teksavvy.com (HELO ceviche.home) ([75.119.224.253]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 27 Jun 2014 18:07:38 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id 8F8F666302; Fri, 27 Jun 2014 18:07:38 -0400 (EDT) In-Reply-To: <53AD8EA8.9090805@yandex.ru> (Dmitry Antipov's message of "Fri, 27 Jun 2014 19:32:56 +0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 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:172784 Archived-At: >> Of course, there's Dave Love's >> http://www.loveshack.ukfsn.org/emacs/dynamic-loading/ > IIUC this is a completely different thing. Dave's approach is to > dlopen() specially designed shared objects to add pre-defined > DEFVARs and DEFUNs; FFI is about _generating_ DEFUNs "on the fly" > from _any_ (well, almost any) shared object. It's not that different. In either case, you need some glue which describes how to construct the arguments to pass to those dl-loaded functions and what to do with their return value. In the case of Dave's approach, this glue is written in C. In more modern FFIs (or in Christopher Wellons's approach), this is written in some DSL. Writing the glue in C has its advantages: more people know C than know the binding-DSL, and C lets you do "anything" whereas the typical binding DSL always has various limitations as to which kinds of objects it supports, etc... Of course, writing the glue in C means it needs to be passed to a C compiler, which means that the user who wants to use a package that uses such glue will need to have a C compiler installed. A non issue under GNU/Linux, but a point of friction under W32. Stefan