unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* [PATCH] Fixes for custom-ports
@ 2023-10-29  9:51 Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  2023-11-28 21:01 ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library @ 2023-10-29  9:51 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel


[-- Attachment #1.1: Type: text/plain, Size: 205 bytes --]

Hi,

while playing with current Guile main on Windows, I found some problems
in the implementation of custom-ports that was recently committed.
Please consider the attached patches.

Regards
Jonas

[-- Attachment #1.2: 0001-Fix-loading-of-custom-ports-extension.patch --]
[-- Type: text/x-patch, Size: 800 bytes --]

From b5f1013ad969b6e4e35b36dc63798375ffbecda3 Mon Sep 17 00:00:00 2001
From: Jonas Hahnfeld <hahnjo@hahnjo.de>
Date: Tue, 24 Oct 2023 12:47:21 +0200
Subject: [PATCH 1/2] Fix loading of custom-ports extension

* module/ice-9/custom-ports.scm: Load extension also in expand and eval.
---
 module/ice-9/custom-ports.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/module/ice-9/custom-ports.scm b/module/ice-9/custom-ports.scm
index ba50d238a..07b6ba28a 100644
--- a/module/ice-9/custom-ports.scm
+++ b/module/ice-9/custom-ports.scm
@@ -74,7 +74,7 @@
 (define-custom-port-dispatcher truncate length)
 
 
-(eval-when (load)
+(eval-when (expand load eval)
   (load-extension (string-append "libguile-" (effective-version))
                   "scm_init_custom_ports"))
 
-- 
2.42.0


[-- Attachment #1.3: 0002-Match-on-correct-argument-in-make-custom-port.patch --]
[-- Type: text/x-patch, Size: 920 bytes --]

From 78c97b8a49ba336516e954c6c62e4baa7f429f47 Mon Sep 17 00:00:00 2001
From: Jonas Hahnfeld <hahnjo@hahnjo.de>
Date: Tue, 24 Oct 2023 19:24:22 +0200
Subject: [PATCH 2/2] Match on correct argument in make-custom-port

* module/ice-9/custom-ports.scm (make-custom-port): Match on correct
argument for conversion strategy.
---
 module/ice-9/custom-ports.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/module/ice-9/custom-ports.scm b/module/ice-9/custom-ports.scm
index 07b6ba28a..6010fd94f 100644
--- a/module/ice-9/custom-ports.scm
+++ b/module/ice-9/custom-ports.scm
@@ -146,7 +146,7 @@ methods."
       ((? symbol?)
        (string->symbol (string-upcase (symbol->string encoding))))))
   (define (canonicalize-conversion-strategy conversion-strategy)
-    (match encoding
+    (match conversion-strategy
       ('escape 'escape)
       ('substitute 'substitute)
       (_ 'error)))
-- 
2.42.0


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] Fixes for custom-ports
  2023-10-29  9:51 [PATCH] Fixes for custom-ports Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
@ 2023-11-28 21:01 ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  2024-01-04 10:36   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  2023-11-28 21:11 ` Jean Abou Samra
  2024-01-29 13:46 ` Ludovic Courtès
  2 siblings, 1 reply; 12+ messages in thread
From: Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library @ 2023-11-28 21:01 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 352 bytes --]

On Sun, 2023-10-29 at 10:51 +0100, Jonas Hahnfeld via Developers list
for Guile, the GNU extensibility library wrote:
> Hi,
> 
> while playing with current Guile main on Windows, I found some problems
> in the implementation of custom-ports that was recently committed.
> Please consider the attached patches.

ping...

> Regards
> Jonas


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Fixes for custom-ports
  2023-10-29  9:51 [PATCH] Fixes for custom-ports Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  2023-11-28 21:01 ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
@ 2023-11-28 21:11 ` Jean Abou Samra
  2023-11-29  6:47   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  2024-01-29 13:46 ` Ludovic Courtès
  2 siblings, 1 reply; 12+ messages in thread
From: Jean Abou Samra @ 2023-11-28 21:11 UTC (permalink / raw)
  To: Jonas Hahnfeld, Andy Wingo; +Cc: guile-devel


[-- Attachment #1.1: Type: text/plain, Size: 575 bytes --]

Le dimanche 29 octobre 2023 à 10:51 +0100, Jonas Hahnfeld via Developers list
for Guile, the GNU extensibility library a écrit :
> while playing with current Guile main on Windows, I found some problems
> in the implementation of custom-ports that was recently committed.
> Please consider the attached patches.


Not a Guile maintainer obviously, but: could you explain what the first patch is
for? It's not going to hurt, but I don't see what problem it fixes.

Second patch looks like a no-brainer that any committer passing by could
apply...

Jean




[-- Attachment #1.2: Type: text/html, Size: 1240 bytes --]

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Fixes for custom-ports
  2023-11-28 21:11 ` Jean Abou Samra
@ 2023-11-29  6:47   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  2023-11-29  6:54     ` Jean Abou Samra
  0 siblings, 1 reply; 12+ messages in thread
From: Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library @ 2023-11-29  6:47 UTC (permalink / raw)
  To: Jean Abou Samra, Andy Wingo; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1504 bytes --]

On Tue, 2023-11-28 at 22:11 +0100, Jean Abou Samra wrote:
> Le dimanche 29 octobre 2023 à 10:51 +0100, Jonas Hahnfeld a écrit :
> > while playing with current Guile main on Windows, I found some problems
> > in the implementation of custom-ports that was recently committed.
> > Please consider the attached patches.
> 
> Not a Guile maintainer obviously, but: could you explain what the first
> patch is for? It's not going to hurt, but I don't see what problem it fixes.

Sure: It makes sure that the extension is loaded also when not having a
compiled custom-ports.go. For reference, see the documentation at
https://www.gnu.org/software/guile/manual/html_node/Eval-When.html -
the previously specified (load) only acts when loading a compiled
module. During my tests, when chasing an incompatibility with the
compiled bytecode, I was experimenting with just deleting some bytecode
files. In that case, Guile should transparently fall back to evaluating
the code. Which it did, only that the extension wasn't loaded and it
complained loudly about unavailable symbols. So the solution is to at
least specify (eval) for non-compiled code, but then the documentation
mentions: "When in doubt, use the three conditions (expand load eval),
as in the example above. Other uses of eval-when may void your warranty
or poison your cat." This also matches all other uses of eval-when in
the Guile source code itself. Let me know if I should try to improve
the patch message.

Jonas

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Fixes for custom-ports
  2023-11-29  6:47   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
@ 2023-11-29  6:54     ` Jean Abou Samra
  2023-11-29  7:26       ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  0 siblings, 1 reply; 12+ messages in thread
From: Jean Abou Samra @ 2023-11-29  6:54 UTC (permalink / raw)
  To: Jonas Hahnfeld, Andy Wingo; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1432 bytes --]

Le mercredi 29 novembre 2023 à 07:47 +0100, Jonas Hahnfeld a écrit :
> Sure: It makes sure that the extension is loaded also when not having a
> compiled custom-ports.go. For reference, see the documentation at
> https://www.gnu.org/software/guile/manual/html_node/Eval-When.html -
> the previously specified (load) only acts when loading a compiled
> module. During my tests, when chasing an incompatibility with the
> compiled bytecode, I was experimenting with just deleting some bytecode
> files. In that case, Guile should transparently fall back to evaluating
> the code. Which it did, only that the extension wasn't loaded and it
> complained loudly about unavailable symbols. So the solution is to at
> least specify (eval) for non-compiled code, but then the documentation
> mentions: "When in doubt, use the three conditions (expand load eval),
> as in the example above. Other uses of eval-when may void your warranty
> or poison your cat." This also matches all other uses of eval-when in
> the Guile source code itself. Let me know if I should try to improve
> the patch message.


I was under the impression that all code in Guile itself was assumed
to always be byte-compiled (because of issues like the fact that trying
to evaluate the evaluator would make you chase your own tail).

If it's more consistent with other eval-when uses in Guile, that's
enough reason to apply it, though.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Fixes for custom-ports
  2023-11-29  6:54     ` Jean Abou Samra
@ 2023-11-29  7:26       ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  0 siblings, 0 replies; 12+ messages in thread
From: Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library @ 2023-11-29  7:26 UTC (permalink / raw)
  To: Jean Abou Samra, Andy Wingo; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 610 bytes --]

On Wed, 2023-11-29 at 07:54 +0100, Jean Abou Samra wrote:
> I was under the impression that all code in Guile itself was assumed
> to always be byte-compiled (because of issues like the fact that trying
> to evaluate the evaluator would make you chase your own tail).

For installation probably yes, but empirically it seems that Guile
3.0.9 can survive if you only have ice-9/eval.go, all the rest (even
boot-9.scm) can be evaluated on the fly. It's painfully slow, but it
eliminates one complex piece (bytecode) from the equation, which can be
quite useful during development / debugging.

Jonas

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Fixes for custom-ports
  2023-11-28 21:01 ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
@ 2024-01-04 10:36   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  0 siblings, 0 replies; 12+ messages in thread
From: Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library @ 2024-01-04 10:36 UTC (permalink / raw)
  To: Andy Wingo; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 545 bytes --]

On Tue, 2023-11-28 at 22:01 +0100, Jonas Hahnfeld wrote:
> On Sun, 2023-10-29 at 10:51 +0100, Jonas Hahnfeld via Developers list
> for Guile, the GNU extensibility library wrote:
> > Hi,
> > 
> > while playing with current Guile main on Windows, I found some problems
> > in the implementation of custom-ports that was recently committed.
> > Please consider the attached patches.
> 
> ping...

Another ping, the patches are available from the archives:
https://lists.gnu.org/archive/html/guile-devel/2023-10/msg00050.html

Jonas

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Fixes for custom-ports
  2023-10-29  9:51 [PATCH] Fixes for custom-ports Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  2023-11-28 21:01 ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  2023-11-28 21:11 ` Jean Abou Samra
@ 2024-01-29 13:46 ` Ludovic Courtès
  2024-01-29 21:34   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  2024-02-09  4:47   ` Maxim Cournoyer
  2 siblings, 2 replies; 12+ messages in thread
From: Ludovic Courtès @ 2024-01-29 13:46 UTC (permalink / raw)
  To: Jonas Hahnfeld; +Cc: guile-devel

Jonas Hahnfeld via "Developers list for Guile, the GNU extensibility
library" <guile-devel@gnu.org> skribis:

> From b5f1013ad969b6e4e35b36dc63798375ffbecda3 Mon Sep 17 00:00:00 2001
> From: Jonas Hahnfeld <hahnjo@hahnjo.de>
> Date: Tue, 24 Oct 2023 12:47:21 +0200
> Subject: [PATCH 1/2] Fix loading of custom-ports extension
>
> * module/ice-9/custom-ports.scm: Load extension also in expand and eval.

> From 78c97b8a49ba336516e954c6c62e4baa7f429f47 Mon Sep 17 00:00:00 2001
> From: Jonas Hahnfeld <hahnjo@hahnjo.de>
> Date: Tue, 24 Oct 2023 19:24:22 +0200
> Subject: [PATCH 2/2] Match on correct argument in make-custom-port
> 
> * module/ice-9/custom-ports.scm (make-custom-port): Match on correct
> argument for conversion strategy.

Applied both, thanks!

Ludo'.

PS: As far as I’m concerned, patches sent to bug-guile@gnu.org are less
    likely to be lost because I see them in M-x debbugs.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Fixes for custom-ports
  2024-01-29 13:46 ` Ludovic Courtès
@ 2024-01-29 21:34   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
  2024-02-09  4:47   ` Maxim Cournoyer
  1 sibling, 0 replies; 12+ messages in thread
From: Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library @ 2024-01-29 21:34 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: guile-devel

[-- Attachment #1: Type: text/plain, Size: 1158 bytes --]

On Mon, 2024-01-29 at 14:46 +0100, Ludovic Courtès wrote:
> Jonas Hahnfeld via "Developers list for Guile, the GNU extensibility
> library" <guile-devel@gnu.org> skribis:
> 
> > From b5f1013ad969b6e4e35b36dc63798375ffbecda3 Mon Sep 17 00:00:00 2001
> > From: Jonas Hahnfeld <hahnjo@hahnjo.de>
> > Date: Tue, 24 Oct 2023 12:47:21 +0200
> > Subject: [PATCH 1/2] Fix loading of custom-ports extension
> > 
> > * module/ice-9/custom-ports.scm: Load extension also in expand and eval.
> 
> > From 78c97b8a49ba336516e954c6c62e4baa7f429f47 Mon Sep 17 00:00:00 2001
> > From: Jonas Hahnfeld <hahnjo@hahnjo.de>
> > Date: Tue, 24 Oct 2023 19:24:22 +0200
> > Subject: [PATCH 2/2] Match on correct argument in make-custom-port
> > 
> > * module/ice-9/custom-ports.scm (make-custom-port): Match on correct
> > argument for conversion strategy.
> 
> Applied both, thanks!

Thanks!

> PS: As far as I’m concerned, patches sent to bug-guile@gnu.org are less
>     likely to be lost because I see them in M-x debbugs.

I was trying to follow HACKING which says "Post your patch to
guile-devel@gnu.org;" maybe that needs updating then?

Jonas

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Fixes for custom-ports
  2024-01-29 13:46 ` Ludovic Courtès
  2024-01-29 21:34   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
@ 2024-02-09  4:47   ` Maxim Cournoyer
  2024-02-10 10:08     ` Ludovic Courtès
  1 sibling, 1 reply; 12+ messages in thread
From: Maxim Cournoyer @ 2024-02-09  4:47 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Jonas Hahnfeld, guile-devel

Hi Ludo,

Ludovic Courtès <ludo@gnu.org> writes:

> Jonas Hahnfeld via "Developers list for Guile, the GNU extensibility
> library" <guile-devel@gnu.org> skribis:
>
>> From b5f1013ad969b6e4e35b36dc63798375ffbecda3 Mon Sep 17 00:00:00 2001
>> From: Jonas Hahnfeld <hahnjo@hahnjo.de>
>> Date: Tue, 24 Oct 2023 12:47:21 +0200
>> Subject: [PATCH 1/2] Fix loading of custom-ports extension
>>
>> * module/ice-9/custom-ports.scm: Load extension also in expand and eval.
>
>> From 78c97b8a49ba336516e954c6c62e4baa7f429f47 Mon Sep 17 00:00:00 2001
>> From: Jonas Hahnfeld <hahnjo@hahnjo.de>
>> Date: Tue, 24 Oct 2023 19:24:22 +0200
>> Subject: [PATCH 2/2] Match on correct argument in make-custom-port
>> 
>> * module/ice-9/custom-ports.scm (make-custom-port): Match on correct
>> argument for conversion strategy.
>
> Applied both, thanks!
>
> Ludo'.
>
> PS: As far as I’m concerned, patches sent to bug-guile@gnu.org are less
>     likely to be lost because I see them in M-x debbugs.
>

The contributing documentation mention to send patches to
guile-devel at gnu dot org; should this guidance be changed?

From the HACKING file:

--8<---------------cut here---------------start------------->8---
- If you have put together a change that meets the coding standards
described below, we encourage you to submit it to Guile.  Post your
patch to guile-devel@gnu.org.
--8<---------------cut here---------------end--------------->8---

-- 
Thanks,
Maxim



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Fixes for custom-ports
  2024-02-09  4:47   ` Maxim Cournoyer
@ 2024-02-10 10:08     ` Ludovic Courtès
  2024-02-11 16:41       ` Maxim Cournoyer
  0 siblings, 1 reply; 12+ messages in thread
From: Ludovic Courtès @ 2024-02-10 10:08 UTC (permalink / raw)
  To: Maxim Cournoyer; +Cc: Jonas Hahnfeld, guile-devel

Hi,

Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:

>> PS: As far as I’m concerned, patches sent to bug-guile@gnu.org are less
>>     likely to be lost because I see them in M-x debbugs.
>>
>
> The contributing documentation mention to send patches to
> guile-devel at gnu dot org; should this guidance be changed?
>
> From the HACKING file:
>
> - If you have put together a change that meets the coding standards
> described below, we encourage you to submit it to Guile.  Post your
> patch to guile-devel@gnu.org.

Good idea; I’ve expanded that part, I hope it’s fine for everyone.

Thanks,
Ludo’.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] Fixes for custom-ports
  2024-02-10 10:08     ` Ludovic Courtès
@ 2024-02-11 16:41       ` Maxim Cournoyer
  0 siblings, 0 replies; 12+ messages in thread
From: Maxim Cournoyer @ 2024-02-11 16:41 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: Jonas Hahnfeld, guile-devel

Hi Ludo,

Ludovic Courtès <ludo@gnu.org> writes:

> Hi,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>>> PS: As far as I’m concerned, patches sent to bug-guile@gnu.org are less
>>>     likely to be lost because I see them in M-x debbugs.
>>>
>>
>> The contributing documentation mention to send patches to
>> guile-devel at gnu dot org; should this guidance be changed?
>>
>> From the HACKING file:
>>
>> - If you have put together a change that meets the coding standards
>> described below, we encourage you to submit it to Guile.  Post your
>> patch to guile-devel@gnu.org.
>
> Good idea; I’ve expanded that part, I hope it’s fine for everyone.

Thank you.  I guess I'll now resubmit the SRFI and R7RS-related patches
I had sent last December before I myself forget about them :-).

-- 
Thanks,
Maxim



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-02-11 16:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-29  9:51 [PATCH] Fixes for custom-ports Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
2023-11-28 21:01 ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
2024-01-04 10:36   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
2023-11-28 21:11 ` Jean Abou Samra
2023-11-29  6:47   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
2023-11-29  6:54     ` Jean Abou Samra
2023-11-29  7:26       ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
2024-01-29 13:46 ` Ludovic Courtès
2024-01-29 21:34   ` Jonas Hahnfeld via Developers list for Guile, the GNU extensibility library
2024-02-09  4:47   ` Maxim Cournoyer
2024-02-10 10:08     ` Ludovic Courtès
2024-02-11 16:41       ` Maxim Cournoyer

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).