From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.devel Subject: Re: Emacs ffi Date: Thu, 15 Aug 2024 16:32:29 -0400 Message-ID: References: <864j7qhup6.fsf@gnu.org> <87a5hi0yts.fsf@valhala.localdomain> <86y152ge0b.fsf@gnu.org> <86jzgjfwqp.fsf@gnu.org> <87sev78arx.fsf@gmail.com> <86le0z89u1.fsf@gnu.org> <87o75v87n1.fsf@gmail.com> <86frr786k7.fsf@gnu.org> <86frr66s0o.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16085"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: suhailsingh247@gmail.com, gerd.moellmann@gmail.com, nicolas@n16f.net, arthur.miller@live.com, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 15 22:33:12 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1seh9j-0003xZ-Sl for ged-emacs-devel@m.gmane-mx.org; Thu, 15 Aug 2024 22:33:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1seh97-0007Zj-J7; Thu, 15 Aug 2024 16:32:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1seh95-0007Z4-Kr for emacs-devel@gnu.org; Thu, 15 Aug 2024 16:32:31 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1seh95-00032G-3i; Thu, 15 Aug 2024 16:32:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=+OlVm9L4w6HVTCX8PGKNysqfnjZEr9HySjuBu63gptM=; b=rpdYdsi8q+GiXp0HOA+O jgUlPmZo61JB2ql83nuMlaRud2YIUMJg228cGNlXPC97PDvYZVSQnPNJv6BVuR6lSPYiTwEk7UyOM QuSiiVgPbwp4YdyIvHbfV57tBLCpA0GCgwSONkV8UmmgT6N8AXaCsJEwousu28/QRyOkN3nfpHvHV i7RoALPmyBJXd2PLld4RPYF7jPCl0HB7CIY6lVBLFR06ahh4rhRB1rMetP8jq1ILAh25KBQkF1dLY DkiZsIlGllJCBbNCRR1CR01o+635s1/pJnamraJ3Q1ZBrgq1QHEUGomBLJHhDRA0yMjm++jnQ+47x FvgYQLQN43EuXQ==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1seh94-0000lm-0D; Thu, 15 Aug 2024 16:32:30 -0400 In-Reply-To: <86frr66s0o.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 15 Aug 2024 12:43:03 +0300") X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322791 Archived-At: Eli Zaretskii writes: >> From: Andrea Corallo >> Cc: Suhail Singh , gerd.moellmann@gmail.com, >> nicolas@n16f.net, arthur.miller@live.com, emacs-devel@gnu.org >> Date: Thu, 15 Aug 2024 05:31:49 -0400 >> >> Eli Zaretskii writes: >> >> > The way we do it when loading modules requires the _loaded_ library to >> > declare itself compatible, by exporting a symbol of a certain name. >> > That is an action by the library we load, not by the Lisp program >> > which loads it. >> >> But we could do the same for our hypothetical ffi machinery, that is: >> `define-ffi-library' could fail if the shared library is not exporting >> the predetermined symbol we expect no? > > Of course. But how many such libraries do that? Dunno, ATM very few if not zero I guess. > You are in effect > talking about libraries specifically written or adapted for this > hypothetical FFI machinery that is Emacs- or at least GNU-specific. > Whereas the main motivation behind the request is to allow loading > arbitrary libraries out there that already exist and definitely don't > export any such symbols. At the very least, the interested individual > will have to fork the library, verify it has a GPL-compatible license, > modify its code to export such a symbol, and then rebuild it. Maybe over time libraries interested to e used by Emacs could accept the simple patch necessary to define end export the symbol? > So, while this arrangement is definitely possible and okay for Emacs, > I very much doubt that it will be practical enough to be of use. > Nevertheless, if someone submits such an implementation of such FFI > machinery, I see no obstacles to accepting it (except the usual: clean > code, good documentation, etc.). Okay thanks, we are on the same page on this. Andrea