From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Skyler Ferris via "Developers list for Guile, the GNU extensibility library" Newsgroups: gmane.lisp.guile.devel Subject: RE: Removing program-arities export Date: Wed, 08 Jan 2025 11:23:14 +0000 Message-ID: References: <20250105190726.xW7S2D00948vBLV06W7S96@albert.telenet-ops.be> Reply-To: Skyler Ferris Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11548"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "guile-devel@gnu.org" To: Maxime Devos Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Wed Jan 08 14:43:09 2025 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 1tVWKy-0002qd-HA for guile-devel@m.gmane-mx.org; Wed, 08 Jan 2025 14:43:08 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tVWKb-0001qR-3L; Wed, 08 Jan 2025 08:42:45 -0500 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 1tVU9r-00009d-JJ for guile-devel@gnu.org; Wed, 08 Jan 2025 06:23:31 -0500 Original-Received: from mail-0201.mail-europe.com ([51.77.79.158]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tVU9p-00008W-CK for guile-devel@gnu.org; Wed, 08 Jan 2025 06:23:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skyler-ferris.me; s=protonmail2; t=1736335400; x=1736594600; bh=c4fh4ce2q6wFyT9hfBEWHcvWpBs3+YlzHYvV7ERsRks=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector:List-Unsubscribe:List-Unsubscribe-Post; b=TJf57mZDAmp917ymKAhN1ncnyDz8QBDsn/K6BU3wQYmJp4AG8snQMsnbZXm60UyJB iUfUaWUk5u1M7mBnOPhcR2jHFKOQK73x3+IdGHR6KpA2GewPjwuSY/Ub6BTxcdRIhP yb1Ebk7z3WuzexkEE3Bh2YUA9su0vLmLT4sQYPSld15Ee2fj/rTXzITZTT8/Ri1M6T XNFs20ykEaS8gEWqB3HJ8BKhJuCaPrj/VclIH2THKaDIqdr+MIc9LvqTNn5DVyENcB SGlBdmqOqzPMr2TfMYFvdsZ45y4XXF1SHFsGXzYMZsMsU+C6jZ+xqPbz6YuovZ3ZD6 8x7u41bllxb8A== In-Reply-To: Feedback-ID: 112111505:user:proton X-Pm-Message-ID: 45b6a4f0127825d21f0af315e418e2b5cf27076b Received-SPF: pass client-ip=51.77.79.158; envelope-from=dev@skyler-ferris.me; helo=mail-0201.mail-europe.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 08 Jan 2025 08:42:39 -0500 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 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-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22864 Archived-At: (switching to the correct sending address; I was previously sending from sk= yvine due to a misconfiguration in my client) It looks like there are 2 potential candidates for aliasing, but both of th= em have some problems. When aliasing to "find-program-arities" I am unable = to get the arity of any procedure which passes the "primitive-code?" predic= ate; it just returns #f. When aliasing to "program-arguments-alists" I get = results for primitive code, but they are not accurate. For example, try cal= ling it on the "count" procedure from SRFI 1. It is using the "fallback" he= lper which hardcodes unknown values for missing information. Also, the alis= ts it returns do not provide the information needed for "arity:start" and "= arity:end". I believe that program-arguments-alists is the intended replacement for pro= gram-arities, based on this timeline of relevant commits: - eb2bc00fb3863986927f0bade97487209b6d6a5b (16 May 2013): Added program-arg= uments-alist, commit message states "New helper, implemented also for RTL p= rocedures." - 27337b6373954e1a975d97d0bf06b5c03d65b64d (18 October 2013): Added fallbac= k logic, commit message states "Fix up various arity-related things for pri= mitives, which don't use ELF arity info." - 8bd261baaa96eba005517eef5fb8d5d08f22720a (also 18 October 2013): Exported= program-arguments-alist, commit message states "Export this interface. Fa= ll back to grovelling through procedure-minimum-arity if the program has no= arities, as might be the case for continuations." - (1c33be992e8120abd20add8021e4d91d226f5b6a, 8 November 2013): Removed prog= ram-arities implementation, commit message states "Remove old program code.= " The header of the commit states "Remove stack programs, objcode, and the = old VM." I have 2 concerns that I want to address. The first concern is the bad user= experience created by calling a procedure which is advertised in the manua= l only to be told that it does not exist. I consider this to be an urgent p= roblem and would like to find a path to fix this quickly. Based on the abov= e I still believe that removing program-arity (and updating the manual acco= rdingly) makes sense. However, if we want to keep this as a separate interf= ace I could do something like throw an error that explicitly states "this i= s currently unimplemented, we are aware of the problem and are looking at i= t." I don't have a strong opinion about keeping it or removing it. I just w= ant to make sure that callers have a good experience with whatever APIs exi= st. The second concern is ensuring that arity information is available for all = procedures. However, I would like to delay that discussion until after I sp= end more time studying how different programming languages handle arguments= .