v0.19-fixes #1470

Merged
fare merged 9 commits from v0.19-fixes into v0.19-staging 2026-07-12 19:52:32 +00:00
Owner
No description provided.
vyzo requested changes 2026-06-25 09:20:01 +00:00
Dismissed
vyzo left a comment

claude has a tendency to make a mess for no reason, please reign on it.

claude has a tendency to make a mess for no reason, please reign on it.
src/build.sh Outdated
@ -1,6 +1,7 @@
#!/bin/sh
set -eu
cd $(dirname "$0") # Change to this directory
: ${__ORIG_PWD=$PWD}
Owner

wtf

wtf
fare marked this conversation as resolved
src/build.sh Outdated
@ -2,2 +2,3 @@
set -eu
cd $(dirname "$0") # Change to this directory
: ${__ORIG_PWD=$PWD}
cd "$(dirname "$0")" # Change to this directory
Owner

wtf 2.

wtf 2.
fare marked this conversation as resolved
src/build.sh Outdated
@ -74,3 +75,1 @@
if [ "x${GERBIL_BUILD_CORES:-}" != "x" ]; then
echo "--- using ${GERBIL_BUILD_CORES} cores for the build"
fi
notify_cores() {
Owner

why is this an improvement?

why is this an improvement?
Author
Owner

So we can have a ./build.sh run that doesn't change the PWD and doesn't print "using 8 cores", and so ./build.sh run gxi can be used in a script as a regular gxi.

So we can have a ./build.sh run that doesn't change the PWD and doesn't print "using 8 cores", and so ./build.sh run gxi can be used in a script as a regular gxi.
Owner

ugh, i dont think i like this idea.

ugh, i dont think i like this idea.
fare marked this conversation as resolved
@ -116,6 +116,7 @@ namespace: #f
flags ; type-flags
__table::t ; type-super
fields ; type-fields
;; TODO: fix the MOP so we can include __table::t in the precedence-list
Owner

no, this won't happen.

please remove this todo.

no, this won't happen. please remove this todo.
Author
Owner

I'd like to make it happen as part of our MOP: full support for Gambit structures as supers for our classes. Shouldn't be too hard: if it's a Gambit struct, use a table to find a Gerbil-like descriptor to substitute to it to find the missing slots.

I'd like to make it happen as part of our MOP: full support for Gambit structures as supers for our classes. Shouldn't be too hard: if it's a Gambit struct, use a table to find a Gerbil-like descriptor to substitute to it to find the missing slots.
Owner

no, i dont think it should happen.

gambit structs are already integrated with shadow classes, i dont want to mix the two hierarchies at all.
it will make life miserable as we'll have to check the type type everywhere.

so no, please untodo.

no, i dont think it should happen. gambit structs are already integrated with shadow classes, i dont want to mix the two hierarchies at all. it will make life miserable as we'll have to check the type type everywhere. so no, please untodo.
fare marked this conversation as resolved
@ -165,3 +170,1 @@
(&raw-table-test tab)
(&raw-table-seed tab)
(and (&raw-table-lock tab) (__make-inline-lock))))
(let* ((size (raw-table-size-hint->size size-hint))
Owner

wtf. why did it inline this?

wtf. why did it inline this?
fare marked this conversation as resolved
@ -637,2 +647,3 @@
(def (gc-table-new tab (size-hint #f))
(##structure (##structure-type tab) (table-new (&gc-table-gcht tab) size-hint) #f))
(##structure (##structure-type tab)
(__gc-table-new (if (fixnum? size-hint) size-hint 16)
Owner

here too.

here too.
fare marked this conversation as resolved
@ -705,3 +705,1 @@
(char : :char)
(start :~ nonnegative-fixnum? :- :fixnum := 0))
(let ((len (string-length str)))
criterion
Owner

please provide 2 specialized versions for the criterion case and dispatch to them, as we discussed.

please provide 2 specialized versions for the criterion case and dispatch to them, as we discussed.
Owner

in fact, i think it is better to drop this from this pr.

it is not a fix, it is an arbitrary behavioral change.

in fact, i think it is better to drop this from this pr. it is not a fix, it is an arbitrary behavioral change.
fare marked this conversation as resolved
@ -718,3 +729,1 @@
(let* ((len (string-length str))
(start (if (fixnum? start) start (fx- len 1))))
(let lp ((k start))
criterion
Owner

same here.

same here.
fare marked this conversation as resolved
@ -43,0 +44,4 @@
;; In the large-write-unbuffered path (bio.whi==0, want>=buflen) bio.whi
;; is never advanced by __bio-write, so we must do it here or
;; get-memory-output-* will read zero bytes.
(set! mem.whi input-size)
Owner

this blurb comment is just unnecessary, it is obvious why.

please remove it.

this blurb comment is just unnecessary, it is obvious why. please remove it.
fare marked this conversation as resolved
fare force-pushed v0.19-fixes from 1c03237189 to 17ad18a595 2026-06-29 08:49:40 +00:00 Compare
fare force-pushed v0.19-fixes from 0bf66475cd to afe807d8a1 2026-06-29 09:07:18 +00:00 Compare
fare force-pushed v0.19-fixes from afe807d8a1 to 4d663480b0 2026-06-29 09:27:42 +00:00 Compare
vyzo requested changes 2026-06-30 09:14:07 +00:00
Dismissed
vyzo left a comment

you have subtly changed the semantics of end in string-rindex, probably broken some code.

also, you have probably broken all the rules in build.sh with the change of staying out of dir. please don't.

you have subtly changed the semantics of end in string-rindex, probably broken some code. also, you have probably broken all the rules in build.sh with the change of staying out of dir. please don't.
build.sh Outdated
@ -1,6 +1,6 @@
#!/bin/sh
set -e
cd $(dirname "$0")
DIR="$(dirname "$0")"
Owner

I don't like this change at all, you are breaking all my workflows.

also bootstrap build is broken now.

I don't like this change at all, you are breaking all my workflows. also bootstrap build is broken now.
fare marked this conversation as resolved
@ -724,2 +741,2 @@
k
(lp (fx- k 1))))))))
criterion
(end :? :fixnum := #f)
Owner

just this to string-length... -1

just this to string-length... -1
fare marked this conversation as resolved
@ -726,0 +742,4 @@
(end :? :fixnum := #f)
(start :~ nonnegative-fixnum? :- :fixnum := 0))
(cond
((not end) (set! end (string-length str)))
Owner

that looks like an off by 1.

that looks like an off by 1.
fare marked this conversation as resolved
@ -726,0 +744,4 @@
(cond
((not end) (set! end (string-length str)))
((not (and (nonnegative-fixnum? end) (fx<= end (string-length str))))
(error "invalid end for string-index" str end)))
Owner

you can raise-contract-violation-error here, please don't naked error

you can raise-contract-violation-error here, please don't naked error
fare marked this conversation as resolved
@ -726,0 +755,4 @@
(char :- :char)
(start :- :fixnum)
(end :- :fixnum))
(let lp ((k (fx- end 1)))
Owner

that's semantics breaking.

that's semantics breaking.
fare marked this conversation as resolved
fare force-pushed v0.19-fixes from 4d663480b0 to 9bdb00f83b 2026-06-30 13:58:04 +00:00 Compare
fare force-pushed v0.19-fixes from 9bdb00f83b to 0646235f6d 2026-07-01 20:41:16 +00:00 Compare
vyzo requested changes 2026-07-02 23:01:10 +00:00
Dismissed
vyzo left a comment

is it ever going to get it right? the clanker is an idiot when it comes to writing code.

is it ever going to get it right? the clanker is an idiot when it comes to writing code.
@ -79,0 +76,4 @@
(let (port (open-input-string expr))
(let loop ()
(let skip ()
(let (c (peek-char port))
Owner

wtf is this? just read man, it skips whitespace.

claude? its an idiot.

wtf is this? just read man, it skips whitespace. claude? its an idiot.
fare marked this conversation as resolved
@ -116,6 +116,7 @@ namespace: #f
flags ; type-flags
__table::t ; type-super
fields ; type-fields
;; TODO: fix the MOP so we can include __table::t in the precedence-list
Owner

this todo still here...

this todo still here...
fare marked this conversation as resolved
@ -162,14 +163,15 @@ namespace: #f
flags ; type-flags
__gc-table::t ; type-super
fields ; type-fields
;; TODO: fix the MOP so we can include __gc-table::t in the precedence-list
Owner

as i said no, this aint happening.

as i said no, this aint happening.
fare marked this conversation as resolved
@ -713,1 +708,3 @@
(lp (fx+ k 1))))))))
criterion
(start :~ nonnegative-fixnum? :- :fixnum := 0)
(end :? :fixnum := #f))
Owner

default this to string-length, make it always fixnum.

default this to string-length, make it always fixnum.
Author
Owner

Maybe for string-rindex, but string-index SRFI accepts #f and we should support that.

Maybe for string-rindex, but string-index SRFI accepts #f and we should support that.
Owner

then do it in the front end procedure, string-index-right

then do it in the front end procedure, string-index-right
Author
Owner

That is indeed what I am currently doing.

That is indeed what I am currently doing.
@ -714,0 +708,4 @@
criterion
(start :~ nonnegative-fixnum? :- :fixnum := 0)
(end :? :fixnum := #f))
(unless end
Owner

and this if and set! becomes unnecessary

and this if and set! becomes unnecessary
fare marked this conversation as resolved
@ -714,0 +712,4 @@
(set! end (string-length str)))
(cond
((< start 0)
(error "invalid start for string-index" str start))
Owner

ditch the errors, we already have raise-contract-violation-error here.

ditch the errors, we already have raise-contract-violation-error here.
fare marked this conversation as resolved
@ -726,0 +749,4 @@
criterion
(start :? :fixnum := #f)
(end : :fixnum := 0))
(unless start
Owner

same here, no need to initialize with #f and if/set!

same here, no need to initialize with #f and if/set!
fare marked this conversation as resolved
@ -726,0 +753,4 @@
(set! start (fx- (string-length str) 1)))
(cond
((>= start (string-length str))
(error "invalid start for string-rindex" str start))
Owner

ditch error

ditch error
fare marked this conversation as resolved
fare force-pushed v0.19-fixes from 0646235f6d to 02397427da 2026-07-12 11:33:08 +00:00 Compare
vyzo left a comment

almost ready, some minor comments

almost ready, some minor comments
@ -232,3 +244,1 @@
(cond
((agetq key alist) => (cut eq? <> #t))
(else #t)))
(def (all-slots-foo? key transparent?)
Owner

ok, foo is not a good a name.

ok, foo is not a good a name.
fare marked this conversation as resolved
@ -266,3 +278,3 @@
(##fxior type-flag-id type-flag-concrete
(if final? 0 type-flag-extensible)
(if opaque? type-flag-opaque 0)
(if (and opaque? (not (agetq equal: properties))) type-flag-opaque 0)
Owner

that seems semantic breaking, no?

that seems semantic breaking, no?
fare marked this conversation as resolved
@ -714,0 +711,4 @@
(start :~ nonnegative-fixnum? :- :fixnum := 0)
(end :? :fixnum := #f))
(unless end
(set! end (string-length str)))
Owner

let a fresh binding, set! is expensive.

let a fresh binding, set! is expensive.
fare marked this conversation as resolved
fare force-pushed v0.19-fixes from 02397427da to 65fcfe403c 2026-07-12 19:44:57 +00:00 Compare
vyzo approved these changes 2026-07-12 19:50:54 +00:00
vyzo left a comment

alright, lets merge it

alright, lets merge it
fare merged commit d75eb41149 into v0.19-staging 2026-07-12 19:52:32 +00:00
fare referenced this pull request from a commit 2026-07-12 19:52:32 +00:00
fare deleted branch v0.19-fixes 2026-07-12 19:52:32 +00:00
Sign in to join this conversation.
No description provided.