From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: Linking to libraries in the ELF? Date: Tue, 09 Mar 2021 22:04:05 +0100 Message-ID: <875z202g56.fsf@pobox.com> References: <875z3fr9yf.fsf@telenet.be> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21580"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) Cc: guile-devel@gnu.org To: Maxime Devos Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Tue Mar 09 22:25:24 2021 Return-path: Envelope-to: guile-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 1lJjr1-0005U7-IX for guile-devel@m.gmane-mx.org; Tue, 09 Mar 2021 22:25:23 +0100 Original-Received: from localhost ([::1]:38378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lJjr0-0000nO-Ht for guile-devel@m.gmane-mx.org; Tue, 09 Mar 2021 16:25:22 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lJjWg-00059s-HU for guile-devel@gnu.org; Tue, 09 Mar 2021 16:04:24 -0500 Original-Received: from fanzine.igalia.com ([178.60.130.6]:50875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lJjWe-0007lb-C7 for guile-devel@gnu.org; Tue, 09 Mar 2021 16:04:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=fRSjrAG7M59mVvHbmFvqFO3GGxxjfnw0kgbdjeMOBkE=; b=gprygSZGx0GokcYLSGvxQncgjl0llsyQ546s8D9T6gXYTncWA9aV0n8E4SXqNxZ0tHwJEdYO7LNSHvstfCWUVA+dvPNIB1XFB3uH+/3zUoSgiOrCv4E+smJdU2jLL4t+2v9yjuANlbVXs1zwN+0qRcAFd6bYDaM0ZeAlqWfFYKWxnIvz8KU3/WU/sIYSyrPIzTLdHdamdavIWk41xDtsd7G1h8pyO3JqGu/EoQlF+jqaV6RldkvCB3a9LPQNFqsVKsok9H6KhY+aLCdiZAtxQdy7BwNUebPbVgQcPJtW8+zTs8JULMXESYfozFFNtr58t49AXHswdIzo92cg+WNTRg==; Original-Received: from 82-65-63-215.subs.proxad.net ([82.65.63.215] helo=sparrow) by fanzine.igalia.com with esmtpsa (Cipher TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim) id 1lJjWa-00019c-8A; Tue, 09 Mar 2021 22:04:16 +0100 In-Reply-To: <875z3fr9yf.fsf@telenet.be> (Maxime Devos's message of "Fri, 29 Jan 2021 17:20:40 +0100") Received-SPF: neutral client-ip=178.60.130.6; envelope-from=wingo@pobox.com; helo=fanzine.igalia.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.io gmane.lisp.guile.devel:20702 Archived-At: On Fri 29 Jan 2021 17:20, Maxime Devos writes: > I've got this crazy idea a few days ago, about the FFI interface. > When a program written in C is compiled with some shared libraries, > these libraries are referred to in special [insert ELF terminology > here] of the binary. I wonder if it would be reasonable and feasible > to do something similar for compiles guile modules? These sections of executables or shared libraries are actually *interpreted* by the system dynamic library loader, ld.so. Guile has its own loader, independent of ld.so, and so can implement this -- or do more flexible things. In any case we probably shouldn't tie ourselves to the particular implementation of a particular loader. Of course, dynamic-link was... not a great interface. But with the recent changes in git I think it can be fine (see "Foreign Libraries" in the manual). For the FFI the bigger problem IMO is generating faster foreign procedure bindings -- i.e. farther on the compilation-vs-interpretation scale. Cheers, Andy