* [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
2023-11-28 21:11 ` Jean Abou Samra
0 siblings, 2 replies; 6+ 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] 6+ 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
1 sibling, 0 replies; 6+ 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] 6+ 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
1 sibling, 1 reply; 6+ 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] 6+ 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; 6+ 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] 6+ 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; 6+ 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] 6+ 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; 6+ 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] 6+ messages in thread
end of thread, other threads:[~2023-11-29 7:26 UTC | newest]
Thread overview: 6+ 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
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
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).