* Removing program-arities export
@ 2024-12-29 11:16 Skyler via Developers list for Guile, the GNU extensibility library
2025-01-05 18:07 ` Maxime Devos
0 siblings, 1 reply; 3+ messages in thread
From: Skyler via Developers list for Guile, the GNU extensibility library @ 2024-12-29 11:16 UTC (permalink / raw)
To: guile-devel@gnu.org
Hello,
I am working on a patch for a bug I recently found in guile. The `program-arities` function is exported from the `(system vm program)` module and documented in the manual, but it is no longer defined (it was removed in commit 1c33be992e8120abd20add8021e4d91d226f5b6a). It is only used in the `program-arity function`, which is not called anywhere in the Guile repository (and calling it with valid inputs results in an error due to the `program-arities` being undefined). See the shell session at the end of this email for details.
Removing those functions is simple, but the `arity:` accessors have more users, and since they're just pattern-matching on a list I'm concerned that they have been used for the new functions (eg, find-program-arity) so I'm not sure if it's safe to just remove them. In particular, `arity->arguments-alist` uses them unconditionally. However, `arity->arguments-alist` only has two callers, `program-arguments-alist` and `program-arguments-alists` (that's not a typo, the second one is pluralized), which call it conditionally. The conditions are different but both require that the given code passes the `primitive-code?` predicate. These functions are called from a few different places so it'll take a little more time to figure out if it's safe to remove them (or possibly just remove the logic conditioned by `primitive-code?`, if that is no longer in use, and leaving the rest of the function intact).
In solidarity,
Skyler
user@foreign-guix /d/shm> cat channels.scm
%default-channels
user@foreign-guix /d/shm> guix time-machine --channels=./channels.scm -- shell --container --nesting guile-next guile-readline
user@foreign-guix /dev/shm [env]$ guix describe
guix 4a4a8c9
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: 4a4a8c9d2621d4871c4b9c8857bfb0e6e53d7e56
user@foreign-guix /dev/shm [env]$ guile -q
GNU Guile 3.0.9-0.3b76a30
Copyright (C) 1995-2024 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
scheme@(guile-user)> (module-variable (resolve-module '(system vm program)) 'program-arities)
$1 = #<variable 734b7c40e940 value: #<undefined>>
scheme@(guile-user)> (use-modules (system vm program))
scheme@(guile-user)> (program-arity car #f)
ice-9/boot-9.scm:1676:22: In procedure raise-exception:
Unbound variable: program-arities
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Removing program-arities export
2024-12-29 11:16 Removing program-arities export Skyler via Developers list for Guile, the GNU extensibility library
@ 2025-01-05 18:07 ` Maxime Devos
2025-01-06 11:01 ` Skyler via Developers list for Guile, the GNU extensibility library
0 siblings, 1 reply; 3+ messages in thread
From: Maxime Devos @ 2025-01-05 18:07 UTC (permalink / raw)
To: Skyler, guile-devel@gnu.org
[-- Attachment #1: Type: text/plain, Size: 852 bytes --]
>It is only used in the `program-arity function`, which is not called anywhere in the Guile repository (and calling it with valid inputs results in an error due to the `program-arities` being undefined).
This is untrue, it (i.e. program-arities) is also used in the manual.
>Removing those functions is simple, but the `arity:` accessors have more users, […]
It shouldn’t be removed, rather a replacement should be provided somewhere.
Regardless of the changes to the VM, compiled procedures still exist, and by definition that’s what a ‘program’ is, so ‘programs’ still exist, and hence many of the procedures in that module still make sense, including program-arities. In particular, arity information is still recorded (in .guile.arities), so it should be made / kept accessible somewhere.
Best regards,
Maxime Devos
[-- Attachment #2: Type: text/html, Size: 2333 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: Removing program-arities export
2025-01-05 18:07 ` Maxime Devos
@ 2025-01-06 11:01 ` Skyler via Developers list for Guile, the GNU extensibility library
0 siblings, 0 replies; 3+ messages in thread
From: Skyler via Developers list for Guile, the GNU extensibility library @ 2025-01-06 11:01 UTC (permalink / raw)
To: Maxime Devos; +Cc: guile-devel@gnu.org
[-- Attachment #1: Type: text/plain, Size: 1547 bytes --]
On Sunday, January 5th, 2025 at 6:07 PM, Maxime Devos <maximedevos@telenet.be> wrote:
>>It is only used in the `program-arity function`, which is not called anywhere in the Guile repository (and calling it with valid inputs results in an error due to the `program-arities` being undefined).
>
> This is untrue, it (i.e. program-arities) is also used in the manual.
Fair point.
>>Removing those functions is simple, but the `arity:` accessors have more users, […]
>
> It shouldn’t be removed, rather a replacement should be provided somewhere.
>
> Regardless of the changes to the VM, compiled procedures still exist, and by definition that’s what a ‘program’ is, so ‘programs’ still exist, and hence many of the procedures in that module still make sense, including program-arities. In particular, arity information is still recorded (in .guile.arities), so it should be made / kept accessible somewhere.
I agree that this information should be available. I should have explicated my assumption that the similarly-named function "find-program-arities" was a suitable replacement. It is defined in "system/vm/debug.scm" and references .guile.arities. I will interrogate this assumption more thoroughly before submitting a patch, the email was meant as an early notification that this is something that I'm starting to look at in case someone else is already looking at it. I am fine with changing the direction of the patch if that turns out to make sense (perhaps by turning program-arities an alias for find-program-arities).
>
[-- Attachment #2: Type: text/html, Size: 2938 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-01-06 11:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-29 11:16 Removing program-arities export Skyler via Developers list for Guile, the GNU extensibility library
2025-01-05 18:07 ` Maxime Devos
2025-01-06 11:01 ` Skyler via Developers list for Guile, the GNU extensibility library
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).