Feed of "Zhu Zihao" https://codeberg.org/readevalprintloop Tue, 30 Jun 2026 11:50:30 +0200 readevalprintloop commented on issue guile/guile#217 https://codeberg.org/guile/guile/issues/217#issuecomment-18200261 `(format #t "~." 'a)` segfaults with JIT enable on x86_64 platform <p dir="auto">It seems that this issue was introduced in 624dd8a17a.</p> <![CDATA[`(format #t "~." 'a)` segfaults with JIT enable on x86_64 platform

It seems that this issue was introduced in 624dd8a17a.

]]>
readevalprintloop 163380485: https://codeberg.org/guile/guile/issues/217#issuecomment-18200261 Sun, 28 Jun 2026 09:54:12 +0200
readevalprintloop commented on issue guile/guile#217 https://codeberg.org/guile/guile/issues/217#issuecomment-18199559 `(format #t "~." 'a)` segfaults with JIT enable on x86_64 platform <p dir="auto">With the help of GDB I found the machine code causes segfault</p> <![CDATA[`(format #t "~." 'a)` segfaults with JIT enable on x86_64 platform

With the help of GDB I found the machine code causes segfault

]]>
readevalprintloop 163377092: https://codeberg.org/guile/guile/issues/217#issuecomment-18199559 Sun, 28 Jun 2026 09:40:09 +0200
readevalprintloop opened issue guile/guile#217 https://codeberg.org/guile/guile/issues/217 217#`(format #t "~." 'a)` segfaults with JIT enable on x86_64 platform# <![CDATA[

Tested on 3.0.11 and 3.0.10, 3.0.9 still works.

$ export GUILE_JIT_THRESHOLD=1

$ guile

GNU Guile 3.0.11
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)> (format #t "~." 'a)
Segmentation fault

Expected behavior

$ export GUILE_JIT_THRESHOLD=-1

$ guile

GNU Guile 3.0.11
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)> (format #t "~." 'a)

FORMAT: error with call: (format #t "~.<===" ===>a )
        unknown control character `.'
FORMAT: INTERNAL ERROR IN FORMAT-ERROR!
        destination: #t
        format string: "~."
        format args: (a)
        error args:  (#f "error in format" () #f)
ice-9/boot-9.scm:1705:22: In procedure raise-exception:
error in format

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(guile-user) [1]> 
]]>
readevalprintloop 163371176: https://codeberg.org/guile/guile/issues/217 Sun, 28 Jun 2026 09:14:15 +0200
readevalprintloop commented on issue guile/guile#210 https://codeberg.org/guile/guile/issues/210#issuecomment-18067433 `read-syntax` does not annotate vector elements as syntax objects <p dir="auto">Noted that in R6RS, a vector is composite syntax object like pair while a bytevector is considered as an atom.</p> <![CDATA[`read-syntax` does not annotate vector elements as syntax objects

Noted that in R6RS, a vector is composite syntax object like pair while a bytevector is considered as an atom.

]]>
readevalprintloop 162046673: https://codeberg.org/guile/guile/issues/210#issuecomment-18067433 Thu, 25 Jun 2026 18:36:55 +0200
readevalprintloop commented on issue scheme/r7rs#365 https://codeberg.org/scheme/r7rs/issues/365#issuecomment-17920505 Strict IEEE arithmetic <p dir="auto">Noted that, <code>+nan.0</code> and <code>+inf.0</code> don&#39;t support SFDL[E] suffix, so there&#39;s no portable way to express NaN and Infinity in different precision.</p> <![CDATA[Strict IEEE arithmetic

Noted that, +nan.0 and +inf.0 don't support SFDL[E] suffix, so there's no portable way to express NaN and Infinity in different precision.

]]>
readevalprintloop 160444385: https://codeberg.org/scheme/r7rs/issues/365#issuecomment-17920505 Tue, 23 Jun 2026 05:03:53 +0200
readevalprintloop commented on issue scheme/r7rs#361 https://codeberg.org/scheme/r7rs/issues/361#issuecomment-17901383 Behavior of `equal?` on record types <p dir="auto">I guess the reason that R6RS uses a stricter semantic is they also specified <code>equal-hash</code>. The semantics of this procedure are closely related to the semantics of <code>equal?</code> itself.</p> <![CDATA[Behavior of `equal?` on record types

I guess the reason that R6RS uses a stricter semantic is they also specified equal-hash. The semantics of this procedure are closely related to the semantics of equal? itself.

]]>
readevalprintloop 160266713: https://codeberg.org/scheme/r7rs/issues/361#issuecomment-17901383 Mon, 22 Jun 2026 20:35:26 +0200
readevalprintloop commented on issue guile/guile#208 https://codeberg.org/guile/guile/issues/208#issuecomment-17845892 Questions about compiler warnings and how to increase strictness: `#:use-module` and unused things <p dir="auto"><a href="/jjba23" class="mention" rel="nofollow">@jjba23</a> wrote in <a href="https://codeberg.org/guile/guile/issues/208#issuecomment-17836643" class="ref-issue" rel="nofollow">#208 (comment)</a>:</p> <![CDATA[Questions about compiler warnings and how to increase strictness: `#:use-module` and unused things

@jjba23 wrote in #208 (comment):

]]>
readevalprintloop 159709235: https://codeberg.org/guile/guile/issues/208#issuecomment-17845892 Sun, 21 Jun 2026 21:20:14 +0200
readevalprintloop commented on issue scheme/r7rs#370 https://codeberg.org/scheme/r7rs/issues/370#issuecomment-17588312 `(unspecified)` as an alias to things like `(when #f #f)` et al. <p dir="auto">I want to show an example how the nondeterminism characteristic of &#34;unspecified value&#34; provides flexibility for implementation to optimize for performance.</p> <![CDATA[`(unspecified)` as an alias to things like `(when #f #f)` et al.

I want to show an example how the nondeterminism characteristic of "unspecified value" provides flexibility for implementation to optimize for performance.

]]>
readevalprintloop 156890888: https://codeberg.org/scheme/r7rs/issues/370#issuecomment-17588312 Tue, 16 Jun 2026 20:43:38 +0200
readevalprintloop commented on issue scheme/r7rs#365 https://codeberg.org/scheme/r7rs/issues/365#issuecomment-17465501 Strict IEEE arithmetic <p dir="auto">WebAssembly spec add <a href="https://webassembly.github.io/spec/core/exec/numerics.html#floating-point-operations" rel="nofollow">following rules</a> to relax the requirement of IEEE on floating point operations.</p> <![CDATA[Strict IEEE arithmetic

WebAssembly spec add following rules to relax the requirement of IEEE on floating point operations.

]]>
readevalprintloop 155599598: https://codeberg.org/scheme/r7rs/issues/365#issuecomment-17465501 Sun, 14 Jun 2026 20:36:35 +0200
readevalprintloop commented on issue scheme/r7rs#181 https://codeberg.org/scheme/r7rs/issues/181#issuecomment-17462573 Allow any value, not just datums in quotations <p dir="auto">Noted that, many Scheme implements <code>eval</code> by &#34;invoking AOT compiler at runtime&#34;, rather than a true JIT compiler. Therefore, they usually don&#39;t support embedding the references of run-time values.</p> <![CDATA[Allow any value, not just datums in quotations

Noted that, many Scheme implements eval by "invoking AOT compiler at runtime", rather than a true JIT compiler. Therefore, they usually don't support embedding the references of run-time values.

]]>
readevalprintloop 155571089: https://codeberg.org/scheme/r7rs/issues/181#issuecomment-17462573 Sun, 14 Jun 2026 19:36:24 +0200
readevalprintloop commented on issue scheme/r7rs#368 https://codeberg.org/scheme/r7rs/issues/368#issuecomment-17336657 consistency of escaped and non-escaped symbols <p dir="auto"><a href="/jobol" class="mention" rel="nofollow">@jobol</a> wrote in <a href="https://codeberg.org/scheme/r7rs/issues/368#issuecomment-17335682" class="ref-issue" rel="nofollow">#368 (comment)</a>:</p> <![CDATA[consistency of escaped and non-escaped symbols

@jobol wrote in #368 (comment):

]]>
readevalprintloop 154247915: https://codeberg.org/scheme/r7rs/issues/368#issuecomment-17336657 Fri, 12 Jun 2026 09:43:14 +0200
readevalprintloop commented on issue scheme/r7rs#368 https://codeberg.org/scheme/r7rs/issues/368#issuecomment-17298260 consistency of escaped and non-escaped symbols <p dir="auto">I think the identifier started with digits are reserved for implementation-defined enhanced numeric literal syntax, such as underscore in number, and units system.</p> <![CDATA[consistency of escaped and non-escaped symbols

I think the identifier started with digits are reserved for implementation-defined enhanced numeric literal syntax, such as underscore in number, and units system.

]]>
readevalprintloop 154060835: https://codeberg.org/scheme/r7rs/issues/368#issuecomment-17298260 Thu, 11 Jun 2026 22:32:25 +0200
readevalprintloop commented on issue scheme/r7rs#11 https://codeberg.org/scheme/r7rs/issues/11#issuecomment-17286086 Safety of utf8->string and friends <p dir="auto"><a href="/phm" class="mention" rel="nofollow">@phm</a> wrote in <a href="https://codeberg.org/scheme/r7rs/issues/11#issuecomment-17284007" class="ref-issue" rel="nofollow">#11 (comment)</a>:</p> <![CDATA[Safety of utf8->string and friends

@phm wrote in #11 (comment):

]]>
readevalprintloop 153945035: https://codeberg.org/scheme/r7rs/issues/11#issuecomment-17286086 Thu, 11 Jun 2026 18:05:48 +0200
readevalprintloop commented on issue scheme/r7rs#11 https://codeberg.org/scheme/r7rs/issues/11#issuecomment-17258501 Safety of utf8->string and friends <p dir="auto"><a href="/johnwcowan" class="mention" rel="nofollow">@johnwcowan</a> wrote in <a href="https://codeberg.org/scheme/r7rs/issues/11#issuecomment-17227433" class="ref-issue" rel="nofollow">#11 (comment)</a>:</p> <![CDATA[Safety of utf8->string and friends

@johnwcowan wrote in #11 (comment):

]]>
readevalprintloop 153691334: https://codeberg.org/scheme/r7rs/issues/11#issuecomment-17258501 Thu, 11 Jun 2026 09:46:07 +0200
readevalprintloop commented on issue scheme/r7rs#11 https://codeberg.org/scheme/r7rs/issues/11#issuecomment-17207867 Safety of utf8->string and friends <blockquote> <p dir="auto">This is itself both ambiguous (How many replacement characters are inserted if two initial bytes erroneously follow one another? How many if multiple continuation bytes appear without an initial byte? How many bytes are &#39;ignored&#39; in those cases?)</p> </blockquote> <p dir="auto">If we are in favor of deterministic behavior, the subsection &#34;U+FFFD Substitution of Maximal Subparts&#34; of section 3.9 &#34;Unicoding Encoding Forms&#34; in <a href="https://www.unicode.org/versions/Unicode15.0.0/ch03.pdf" rel="nofollow">Unicode Core Specification</a> wrote that</p> <blockquote> <p dir="auto">An increasing number of implementations are adopting the handling of ill-formed subsequences as specified in the W3C standard for encoding to achieve consistent U+FFFD replacements. See:</p> <ul dir="auto"> <li><a href="http://www.w3.org/TR/encoding/" rel="nofollow">http://www.w3.org/TR/encoding/</a></li> </ul> </blockquote> <p dir="auto">In particular, the decoder of UTF-8 is described in <a href="https://encoding.spec.whatwg.org/#utf-8-decoder" rel="nofollow">https://encoding.spec.whatwg.org/#utf-8-decoder</a></p> <p dir="auto">BTW, Unicode Technical Committee had proposed to change the guidance for the preferred numbers of replacement character, but they finally retract those changes. It was <a href="https://hsivonen.fi/broken-utf-8/" rel="nofollow">this post</a> that described the status quo of the insertion of replacement characters and prompted the Unicode Technical Committee to retract those decisions</p> <![CDATA[Safety of utf8->string and friends

This is itself both ambiguous (How many replacement characters are inserted if two initial bytes erroneously follow one another? How many if multiple continuation bytes appear without an initial byte? How many bytes are 'ignored' in those cases?)

If we are in favor of deterministic behavior, the subsection "U+FFFD Substitution of Maximal Subparts" of section 3.9 "Unicoding Encoding Forms" in Unicode Core Specification wrote that

An increasing number of implementations are adopting the handling of ill-formed subsequences as specified in the W3C standard for encoding to achieve consistent U+FFFD replacements. See:

In particular, the decoder of UTF-8 is described in https://encoding.spec.whatwg.org/#utf-8-decoder

BTW, Unicode Technical Committee had proposed to change the guidance for the preferred numbers of replacement character, but they finally retract those changes. It was this post that described the status quo of the insertion of replacement characters and prompted the Unicode Technical Committee to retract those decisions

]]>
readevalprintloop 153256583: https://codeberg.org/scheme/r7rs/issues/11#issuecomment-17207867 Wed, 10 Jun 2026 16:57:13 +0200
readevalprintloop commented on issue scheme/r7rs#365 https://codeberg.org/scheme/r7rs/issues/365#issuecomment-17163998 Strict IEEE arithmetic <p dir="auto">Here&#39;s a short survey about subnormal numbers in practice.</p> <![CDATA[Strict IEEE arithmetic

Here's a short survey about subnormal numbers in practice.

]]>
readevalprintloop 152804741: https://codeberg.org/scheme/r7rs/issues/365#issuecomment-17163998 Tue, 09 Jun 2026 22:18:10 +0200
readevalprintloop commented on issue scheme/r7rs#367 https://codeberg.org/scheme/r7rs/issues/367#issuecomment-17161772 Extend the list of procedures that propagate the exactness <p dir="auto">Thanks! I ought to check the errata list of R7RS but forget to do so...</p> <![CDATA[Extend the list of procedures that propagate the exactness

Thanks! I ought to check the errata list of R7RS but forget to do so...

]]>
readevalprintloop 152784638: https://codeberg.org/scheme/r7rs/issues/367#issuecomment-17161772 Tue, 09 Jun 2026 21:48:06 +0200
readevalprintloop opened issue scheme/r7rs#367 https://codeberg.org/scheme/r7rs/issues/367 367#The specification of feature flag `exact-closed` is unclear.# <![CDATA[

The Appendix B "Standard Feature Identifiers" of R7RS-small specified exact-closed feature as "All algebraic operations except / produce exact values given exact inputs."

The definition of "algebraic operations" is unclear. For example, sqrt, which calculate the square root of a number, should be considered as an "algebraic operation" in the sense of math. However, it's allowed to return inexact result on exact inputs.

Comparing with R6RS, the latter give a explicit list of operations that propagate the exactness in 11.7.1 "Propagation of exactness and inexactness".

]]>
readevalprintloop 152745146: https://codeberg.org/scheme/r7rs/issues/367 Tue, 09 Jun 2026 20:35:39 +0200
readevalprintloop commented on issue scheme/r7rs#275 https://codeberg.org/scheme/r7rs/issues/275#issuecomment-16846664 Require IEEE 754 as the floating point standard in the large language <p dir="auto">On the 2026-06-08 meeting, WG basically agree that implementation must support NaN, +-Infinity, +-0.0 for floating point numbers.</p> <![CDATA[Require IEEE 754 as the floating point standard in the large language

On the 2026-06-08 meeting, WG basically agree that implementation must support NaN, +-Infinity, +-0.0 for floating point numbers.

]]>
readevalprintloop 152208530: https://codeberg.org/scheme/r7rs/issues/275#issuecomment-16846664 Mon, 08 Jun 2026 21:41:20 +0200
readevalprintloop opened issue guile/guile#197 https://codeberg.org/guile/guile/issues/197 197#Incorrect behavior of `utfN->string` in `(rnrs bytevectors)`# <![CDATA[

R6RS Standard Libraries 2.6 "Operation on strings"

If an invalid or incomplete character encoding is encountered, then the replacement character U+FFFD is appended to the string being generated, an appropriate number of bytes are ignored, and decoding continues with the following bytes.

Current implementation will raise decode-error exception on invalid character instead of replacing with U+FFFD.

(use-modules (rnrs) ((ice-9 iconv) #:prefix iconv:))

(utf8->string #u8(172 27 10 83 34))
;; Throw to key `decoding-error' with args `("scm_from_utf8_stringn" "input locale conversion error" 0 #vu8(172 27 10 83 34))'.

(define (real-utf8->string bv) (iconv:bytevector->string bv "UTF-8" 'substitute))
(real-utf8->string #u8(172 27 10 83 34))
;; => "�\x1b\nS\""
]]>
readevalprintloop 151852550: https://codeberg.org/guile/guile/issues/197 Mon, 08 Jun 2026 10:39:05 +0200
readevalprintloop commented on issue scheme/r7rs#362 https://codeberg.org/scheme/r7rs/issues/362#issuecomment-16817132 Incorrect behavior of `utfN->string` in `(rnrs bytevectors)`. <p dir="auto">I post this to the wrong place, sorry.</p> <![CDATA[Incorrect behavior of `utfN->string` in `(rnrs bytevectors)`.

I post this to the wrong place, sorry.

]]>
readevalprintloop 151851905: https://codeberg.org/scheme/r7rs/issues/362#issuecomment-16817132 Mon, 08 Jun 2026 10:37:37 +0200
readevalprintloop closed issue scheme/r7rs#362 https://codeberg.org/scheme/r7rs/issues/362#issuecomment-16817126 Incorrect behavior of `utfN->string` in `(rnrs bytevectors)`. <![CDATA[Incorrect behavior of `utfN->string` in `(rnrs bytevectors)`.]]> readevalprintloop 151851485: https://codeberg.org/scheme/r7rs/issues/362#issuecomment-16817126 Mon, 08 Jun 2026 10:37:10 +0200 readevalprintloop opened issue scheme/r7rs#362 https://codeberg.org/scheme/r7rs/issues/362 362#Incorrect behavior of `utfN->string` in `(rnrs bytevectors)`.# <![CDATA[

R6RS Standard Libraries 2.6 "Operation on strings"

If an invalid or incomplete character encoding is encountered, then the replacement character U+FFFD is appended to the string being generated, an appropriate number of bytes are ignored, and decoding continues with the following bytes.

Current implementation will raise decode-error exception on invalid character instead of replacing with U+FFFD.

(use-modules (rnrs) ((ice-9 iconv) #:prefix iconv:))

(utf8->string #u8(172 27 10 83 34))
;; Throw to key `decoding-error' with args `("scm_from_utf8_stringn" "input locale conversion error" 0 #vu8(172 27 10 83 34))'.

(define (real-utf8->string bv) (iconv:bytevector->string bv "UTF-8" 'substitute))
(real-utf8->string #u8(172 27 10 83 34))

;; => "�\x1b\nS\""
]]>
readevalprintloop 151842923: https://codeberg.org/scheme/r7rs/issues/362 Mon, 08 Jun 2026 10:17:23 +0200
readevalprintloop commented on issue guile/guile#196 https://codeberg.org/guile/guile/issues/196#issuecomment-16694060 Encoding error when throwing from port write <p dir="auto">I think this is the same kind error of <a href="https://codeberg.org/guile/guile/issues/92" class="ref-issue" rel="nofollow">#92</a></p> <![CDATA[Encoding error when throwing from port write

I think this is the same kind error of #92

]]>
readevalprintloop 150991604: https://codeberg.org/guile/guile/issues/196#issuecomment-16694060 Sat, 06 Jun 2026 20:31:23 +0200
readevalprintloop closed issue guile/guile#157 https://codeberg.org/guile/guile/issues/157#issuecomment-16667600 `fldiv{,0}`, `flmod{,0}` doesn't accept non-integer float arguments <![CDATA[`fldiv{,0}`, `flmod{,0}` doesn't accept non-integer float arguments]]> readevalprintloop 150716603: https://codeberg.org/guile/guile/issues/157#issuecomment-16667600 Sat, 06 Jun 2026 10:46:28 +0200 readevalprintloop commented on issue guile/guile#192 https://codeberg.org/guile/guile/issues/192#issuecomment-16298570 Hash of an immutable bytevector/vector is different from their mutable variants with same contents. <p dir="auto">Also tested on 3.0.9.</p> <![CDATA[Hash of an immutable bytevector/vector is different from their mutable variants with same contents.

Also tested on 3.0.9.

]]>
readevalprintloop 147724256: https://codeberg.org/guile/guile/issues/192#issuecomment-16298570 Mon, 01 Jun 2026 17:05:14 +0200
readevalprintloop commented on issue guile/guile#177 https://codeberg.org/guile/guile/issues/177#issuecomment-16293068 Better hashing of types <blockquote> <p dir="auto">Not be associative with container content</p> </blockquote> <![CDATA[Better hashing of types

Not be associative with container content

]]>
readevalprintloop 147665705: https://codeberg.org/guile/guile/issues/177#issuecomment-16293068 Mon, 01 Jun 2026 15:52:37 +0200
readevalprintloop created pull request guile/guile#193 https://codeberg.org/guile/guile/pulls/193 193#WIP: Improve the hash function on struct and containers.# <![CDATA[

In past, Guile use bitwise-exclusive-or (XOR) to combine hash for
containers for structures from their the hash of their child element.

However, XOR is not a good combiner due to its associativity and
commutativity. Associativity would lead '((A . B) . C) and '(A . (B .
C)) to the same hash, and commutativity would lead '(A . B)
and '(B . A) to the same hash.

Another pitfall of XOR is, the hash of '(T . T) will be zero for all T
because x ^ x == 0.

This patch introduce a new hash combiner suggested in
https://stackoverflow.com/a/27952689 to solve the problems above.

  • libguile/hash.c (combine_hash): New function.
    (scm_i_struct_hash): Use 'combine_hash' to combine hashes.
    (scm_raw_ihash): Ditto.
]]>
readevalprintloop 147664601: https://codeberg.org/guile/guile/pulls/193 Mon, 01 Jun 2026 15:50:24 +0200
readevalprintloop pushed to hash-combine at readevalprintloop/guile https://codeberg.org/readevalprintloop/guile/commit/819ed019fb883afd5e4e6afd38ae94fed928eb64 <a href="https://codeberg.org/readevalprintloop/guile/commit/819ed019fb883afd5e4e6afd38ae94fed928eb64">819ed019fb883afd5e4e6afd38ae94fed928eb64</a> Improve the hash function on struct and containers. <![CDATA[819ed019fb883afd5e4e6afd38ae94fed928eb64 Improve the hash function on struct and containers.]]> readevalprintloop 147664343: https://codeberg.org/readevalprintloop/guile/commit/819ed019fb883afd5e4e6afd38ae94fed928eb64 Mon, 01 Jun 2026 15:49:51 +0200 readevalprintloop created branch hash-combine in readevalprintloop/guile https://codeberg.org/readevalprintloop/guile/src/branch/hash-combine readevalprintloop 147664340: https://codeberg.org/readevalprintloop/guile/src/branch/hash-combine Mon, 01 Jun 2026 15:49:51 +0200