Investigate JSON/LL1 import closure and empty std reexports in separate linking #1516

Open
opened 2026-11-05 05:52:03 +00:00 by guangtao · 6 comments

Two isolated findings from profiling fresh-process imports of gerbil-poo:

  1. JSON and LL1 import the :std/io facade and load an otherwise unnecessary
    socket/tempfile/crypto dependency closure for these consumers.
  2. Separately linking a pure reexport under std/ requests an object file that
    is not produced for the empty static Scheme unit. This blocks a normal
    compiled consumer of some narrowed standard-library interfaces.

No compiler/package source patch has been installed or submitted. This issue
records reproducible findings and a candidate direction, not release acceptance.

Results actually obtained after applying the isolated patches

The before/after results below are measured outcomes after applying the patches
shown in this issue. They are not projections from image counts or the Lean
model. The patches remain isolated; these are not results from an adopted
compiler release or the unchanged POO PR's CI.

Dependency patch: complete fresh-process wall time and tail both improved in
each measured order/profile.
Positive percentages mean less elapsed time;
compilation is excluded. All timings use the same installed compiler, while
only the source-built JSON/LL1 dependency arm changes.

Consumer / order Before median (s) After median (s) Median reduction Before P90 (s) After P90 (s) P90 reduction
MOP / forward 2.118 1.543 27.1% 2.567 1.891 26.3%
MOP / inverse 2.267 1.586 30.0% 2.505 1.811 27.7%
FUN / forward 2.584 1.870 27.6% 3.422 2.285 33.2%
FUN / inverse 2.334 1.604 31.3% 2.904 1.752 39.7%
IO / forward 2.228 1.572 29.4% 2.733 1.705 37.6%
IO / inverse 2.251 1.634 27.4% 2.697 1.923 28.7%
Typed testing / forward 2.655 1.831 31.0% 3.011 2.131 29.2%
Typed testing / inverse 2.508 1.819 27.5% 2.832 1.877 33.7%
Combined / forward 2.566 1.832 28.6% 3.249 1.933 40.5%
Combined / inverse 2.601 1.866 28.3% 2.847 2.061 27.6%

The first real operation was included as a separate anti-deferral control:

JSON consumer process: import, first roundtrip, 64 warm roundtrips, exit Before median / P90 After median / P90
Forward 2.347 / 2.717 s 1.610 / 2.043 s
Inverse 2.204 / 2.479 s 1.535 / 1.752 s

Within those processes, the paired median of the inner import-through-first-JSON
interval fell by 342 ms forward and 412 ms inverse. The JSON operation itself
stayed around 0.3 ms. The gain is import/startup work, with the complete MOP
retained; it is not parsing throughput or work deferred until first use.

Separate-link patch: a reproducible build failure becomes a working linked
consumer.
This patch has a correctness result, not a separately measured
runtime speedup:

Control Before driver patch After driver patch
Minimal std/import-check pure-reexport executable Link fails, exit 70; missing std__import-check__public.o (also reproduced with installed 2591dcd) Builds and exits 0 with REEXPORT-LINKED-OK, external module search disabled
Source-built standard JSON, original and narrowed arms Not claimed as a matched timing comparison Both build and exit 0 with STD-JSON-LINKED-OK
Source-built POO JSON, original and narrowed arms Not claimed as a matched timing comparison Both build and exit 0 with POO-JSON-LINKED-OK
Official JSON + LL1 tests 38 cases pass in each arm with installed compiler 38 cases pass in each arm with isolated rebuilt compiler

The four linked JSON consumers perform actual nested false/null round trips.
Seven generated public interfaces retain their exports/bindings. Full compiler
CI, complete POO release acceptance, resource qualification and arbitrary
initializer-effect equivalence are still outstanding as described below.

Environment and observation boundary

  • macOS 26.6.1, arm64; published Gerbil 1cfb032, Darwin provider patch
    618d76f9eb72, GCC 16. The separate-link failure also reproduces with the
    installed 2591dcd provider (f5cedd8168cb). It is not claimed here for every
    unpatched platform or compiler revision.
  • Compiler and package artifacts fixed before/after each study; compilation
    excluded from runtime comparisons. Standard JSON/LL1 sources were rebuilt
    in both arms. Original installed files were not edited.
  • Ordinary direct imports in fresh processes, no tracing during timing,
    alternating AB/BA plus inverse arm assignment and A/A/B/B controls.
  • Eight measured pairs per order/profile. Report complete process wall time
    separately from the inner import interval. The P90 below is nearest-rank
    for this small local sample, not a portable latency guarantee.

1. Dependency-closure finding

Candidate source changes use existing standard-library owners:

Source Current import Candidate import
std/encoding/json/reader.ss :std/io :std/io/interface
std/encoding/json/writer.ss :std/io :std/io/interface
std/encoding/json/io.ss :std/io :std/io/interface
std/encoding/json/util.ss :std/io (only-in :std/io/util with-buffered-reader with-buffered-writer)
std/text/parser/ll1.ss :std/io :std/io/bio/api, (only-in :std/io/interface/bio BufferedReader), (only-in :std/io/util with-buffered-reader)

Narrowing JSON alone did not remove the optional closure: LL1 still reached the
same facade. With both routes narrowed, the combined consumer's registry
observation fell from 157 to 129 phase-expansion images and 123 to 94 evaluation
images, with no added images in those observations. These phase observations
are not a count of distinct physical files across the whole process lifetime.

Validation so far:

  • Unmodified official JSON and LL1 suites passed in both source-built arms:
    38 cases each, via gerbil test, including explicit success/error-marker
    checks rather than relying on process exit alone.
  • Seven generated .ssi interfaces compare equal after omitting only their
    direct import declarations. Headers, exports, runtime/syntax binding
    declarations and loader calls are retained. The public JSON facade, API and
    environment interfaces are byte-identical.
  • All seven changed direct graph edges have phase-zero routes in the original
    dependency graph. A small Lean model establishes reachability containment
    and optional-region exclusion under those premises. It does not prove
    arbitrary initializer-effect equivalence, compiler correctness or wall time.
  • Sampled runs were used only for attribution; their timing was not pooled
    with the untraced pairs. Earlier POO-only import/C4/load-path candidates
    without stable whole-process/tail gains were rejected.

Use a fresh ordinary package directory and output prefix. The std/ prefix is
essential to this reproduction: the same source under an ordinary user-package
prefix links successfully.

gerbil.pkg:

(package: std/import-check)

value.ss:

prelude: :gerbil/base
(export echo)
;; Return the supplied value without another library dependency.
(def (echo value) value)

public.ss:

prelude: :gerbil/base
(import ./value)
(export (import: ./value))

main.ss:

prelude: :gerbil/base
(import ./public (only-in :gerbil/runtime/loader set-load-path!))
(export main)
;; Exercise the linked facade without any external module search.
(def (main . _)
  (set-load-path! [])
  (unless (eq? (echo #f) #f) (error "linked reexport oracle"))
  (displayln "REEXPORT-LINKED-OK"))

build.ss:

#!/usr/bin/env -S gxi -:max-heap=2G,debug=q
(import :std/build-script (only-in :std/make pkg-config-libs))
(export main)
(defbuild-script
  (append '("value" "public")
    (list (list 'exe: "main" bin: "reexport-control"
                "-cc-options" "-O2"
                "-ld-options" (pkg-config-libs "openssl")))))

Make build.ss executable and invoke standard gerbil build with a fresh
GERBIL_PATH and the established GERBIL_BUILD_CORES/2 GiB settings.

Observed linker error:

ld: file cannot be open()ed, errno=2 (No such file or directory)
.../lib/static/std__import-check__public.o

The compiler's separate-link path maps all libgerbil-scm entries to C/object
paths. The user-library path already filters empty Scheme units with the
existing not-file-empty? helper. The isolated candidate applies that same
filter after fold-libgerbil-runtime-scm, retaining deps and the logical
builtin-modules inventory:

(libgerbil-scm
  (filter not-file-empty?
    (fold-libgerbil-runtime-scm gerbil-staticdir libgerbil-scm)))

With the isolated rebuilt compiler, the minimal executable prints
REEXPORT-LINKED-OK. Both source-built JSON arms and both source-built POO JSON
consumers also link normally and perform a nested false/null roundtrip with
external module search disabled: four successful executable controls. The
38-case official suites were rerun successfully with that compiler as well.

Exact patches used in the isolated experiments

The dependency-only paired measurements above use this five-file standard-library
patch. It changes the dependency owner imported; it adds no loader or cache:

--- a/src/std/encoding/json/reader.ss
+++ b/src/std/encoding/json/reader.ss
@@ -3,7 +3,7 @@
 ;;; © vyzo
 ;;; json reader
 (import :std/error
-        :std/io
+        :std/io/interface
         :std/io/bio/api
         :std/list/walist
         :std/encoding/hex
--- a/src/std/encoding/json/writer.ss
+++ b/src/std/encoding/json/writer.ss
@@ -3,7 +3,7 @@
 ;;; © vyzo
 ;;; json writer
 (import :std/error
-        :std/io
+        :std/io/interface
         :std/serde/serialize
         :std/format
         :std/format/ioutil
--- a/src/std/encoding/json/io.ss
+++ b/src/std/encoding/json/io.ss
@@ -2,7 +2,7 @@
 ;;; -*- Gerbil -*-
 ;;; © vyzo
 ;;; json io interface
-(import :std/io
+(import :std/io/interface
         :std/io/bio/api
         ./env
         ./writer
--- a/src/std/encoding/json/util.ss
+++ b/src/std/encoding/json/util.ss
@@ -4,7 +4,7 @@
 ;;; json utilities
 (import :std/error
         :std/format/ioutil
-        :std/io
+        (only-in :std/io/util with-buffered-reader with-buffered-writer)
         :std/io/bio/api
         :std/iter
         :std/list/alist
--- a/src/std/text/parser/ll1.ss
+++ b/src/std/text/parser/ll1.ss
@@ -17,7 +17,9 @@
 (import
   (for-syntax :std/number/misc)
   :std/error
-  :std/io
+  :std/io/bio/api
+  (only-in :std/io/interface/bio BufferedReader)
+  (only-in :std/io/util with-buffered-reader)
   (only-in :std/text/parser/base ParseError? raise-parse-error)
   :std/iter
   :std/vector/u8vector

The linked correctness controls additionally use this driver patch against the
published Darwin-provider source baseline. The logical builtin-module inventory
stays unchanged; only empty physical Scheme units are omitted from link inputs:

--- a/src/gerbil/compiler/driver.ss
+++ b/src/gerbil/compiler/driver.ss
@@ -250,7 +250,8 @@
            (deps             (find-runtime-module-deps ctx))
            (libgerbil-deps   (filter libgerbil-module? deps))
            (libgerbil-scm    (map find-static-module-file libgerbil-deps))
-           (libgerbil-scm    (fold-libgerbil-runtime-scm gerbil-staticdir libgerbil-scm))
+           (libgerbil-scm    (filter not-file-empty?
+                                    (fold-libgerbil-runtime-scm gerbil-staticdir libgerbil-scm)))
            (libgerbil-c      (map replace-extension-with-c libgerbil-scm))
            (libgerbil-o      (map replace-extension-with-object libgerbil-scm))
            (src-deps         (filter userlib-module? deps))

Remaining acceptance and limits

  • Full compiler regression/CI and full POO acceptance with a qualified compiler
    release remain outstanding; the current POO CI does not validate this patch.
  • The isolated compiler bootstrap retained the 2 GiB Scheme heap setting, but
    one C frontend exceeded 2 GiB RSS. It is not evidence of a whole-build 2 GiB
    process-RSS qualification.
  • Generated-interface equality and targeted regressions do not establish that
    every initializer effect of every removed module is unobservable in arbitrary
    external programs. Review the dependency/API boundary before adoption.
  • Build time, dyld/OS waits, GC and process wall are distinct observations.
    No system safety settings, priorities, loader, cache layer or MOP split was
    introduced. Raw local logs, failed controls, source identities and the exact
    five-file candidate patch are retained outside tracked sources; no benchmark
    archives or generated bulk data are proposed for Git.

The builds and regressions use the existing
standard build template and
gerbil test; no alternate compiler or test runner is proposed.

Two isolated findings from profiling fresh-process imports of `gerbil-poo`: 1. JSON and LL1 import the `:std/io` facade and load an otherwise unnecessary socket/tempfile/crypto dependency closure for these consumers. 2. Separately linking a pure reexport under `std/` requests an object file that is not produced for the empty static Scheme unit. This blocks a normal compiled consumer of some narrowed standard-library interfaces. No compiler/package source patch has been installed or submitted. This issue records reproducible findings and a candidate direction, not release acceptance. ### Results actually obtained after applying the isolated patches The before/after results below are measured outcomes after applying the patches shown in this issue. They are not projections from image counts or the Lean model. The patches remain isolated; these are not results from an adopted compiler release or the unchanged POO PR's CI. **Dependency patch: complete fresh-process wall time and tail both improved in each measured order/profile.** Positive percentages mean less elapsed time; compilation is excluded. All timings use the same installed compiler, while only the source-built JSON/LL1 dependency arm changes. | Consumer / order | Before median (s) | After median (s) | Median reduction | Before P90 (s) | After P90 (s) | P90 reduction | | --- | --- | --- | --- | --- | --- | --- | | MOP / forward | 2.118 | 1.543 | 27.1% | 2.567 | 1.891 | 26.3% | | MOP / inverse | 2.267 | 1.586 | 30.0% | 2.505 | 1.811 | 27.7% | | FUN / forward | 2.584 | 1.870 | 27.6% | 3.422 | 2.285 | 33.2% | | FUN / inverse | 2.334 | 1.604 | 31.3% | 2.904 | 1.752 | 39.7% | | IO / forward | 2.228 | 1.572 | 29.4% | 2.733 | 1.705 | 37.6% | | IO / inverse | 2.251 | 1.634 | 27.4% | 2.697 | 1.923 | 28.7% | | Typed testing / forward | 2.655 | 1.831 | 31.0% | 3.011 | 2.131 | 29.2% | | Typed testing / inverse | 2.508 | 1.819 | 27.5% | 2.832 | 1.877 | 33.7% | | Combined / forward | 2.566 | 1.832 | 28.6% | 3.249 | 1.933 | 40.5% | | Combined / inverse | 2.601 | 1.866 | 28.3% | 2.847 | 2.061 | 27.6% | The first real operation was included as a separate anti-deferral control: | JSON consumer process: import, first roundtrip, 64 warm roundtrips, exit | Before median / P90 | After median / P90 | | --- | --- | --- | | Forward | 2.347 / 2.717 s | 1.610 / 2.043 s | | Inverse | 2.204 / 2.479 s | 1.535 / 1.752 s | Within those processes, the paired median of the inner import-through-first-JSON interval fell by 342 ms forward and 412 ms inverse. The JSON operation itself stayed around 0.3 ms. The gain is import/startup work, with the complete MOP retained; it is not parsing throughput or work deferred until first use. **Separate-link patch: a reproducible build failure becomes a working linked consumer.** This patch has a correctness result, not a separately measured runtime speedup: | Control | Before driver patch | After driver patch | | --- | --- | --- | | Minimal `std/import-check` pure-reexport executable | Link fails, exit 70; missing `std__import-check__public.o` (also reproduced with installed `2591dcd`) | Builds and exits 0 with `REEXPORT-LINKED-OK`, external module search disabled | | Source-built standard JSON, original and narrowed arms | Not claimed as a matched timing comparison | Both build and exit 0 with `STD-JSON-LINKED-OK` | | Source-built POO JSON, original and narrowed arms | Not claimed as a matched timing comparison | Both build and exit 0 with `POO-JSON-LINKED-OK` | | Official JSON + LL1 tests | 38 cases pass in each arm with installed compiler | 38 cases pass in each arm with isolated rebuilt compiler | The four linked JSON consumers perform actual nested false/null round trips. Seven generated public interfaces retain their exports/bindings. Full compiler CI, complete POO release acceptance, resource qualification and arbitrary initializer-effect equivalence are still outstanding as described below. ### Environment and observation boundary - macOS 26.6.1, arm64; published Gerbil `1cfb032`, Darwin provider patch `618d76f9eb72`, GCC 16. The separate-link failure also reproduces with the installed `2591dcd` provider (`f5cedd8168cb`). It is not claimed here for every unpatched platform or compiler revision. - Compiler and package artifacts fixed before/after each study; compilation excluded from runtime comparisons. Standard JSON/LL1 sources were rebuilt in both arms. Original installed files were not edited. - Ordinary direct imports in fresh processes, no tracing during timing, alternating AB/BA plus inverse arm assignment and A/A/B/B controls. - Eight measured pairs per order/profile. Report complete process wall time separately from the inner import interval. The P90 below is nearest-rank for this small local sample, not a portable latency guarantee. ### 1. Dependency-closure finding Candidate source changes use existing standard-library owners: | Source | Current import | Candidate import | | --- | --- | --- | | `std/encoding/json/reader.ss` | `:std/io` | `:std/io/interface` | | `std/encoding/json/writer.ss` | `:std/io` | `:std/io/interface` | | `std/encoding/json/io.ss` | `:std/io` | `:std/io/interface` | | `std/encoding/json/util.ss` | `:std/io` | `(only-in :std/io/util with-buffered-reader with-buffered-writer)` | | `std/text/parser/ll1.ss` | `:std/io` | `:std/io/bio/api`, `(only-in :std/io/interface/bio BufferedReader)`, `(only-in :std/io/util with-buffered-reader)` | Narrowing JSON alone did not remove the optional closure: LL1 still reached the same facade. With both routes narrowed, the combined consumer's registry observation fell from 157 to 129 phase-expansion images and 123 to 94 evaluation images, with no added images in those observations. These phase observations are not a count of distinct physical files across the whole process lifetime. Validation so far: - Unmodified official JSON and LL1 suites passed in both source-built arms: 38 cases each, via `gerbil test`, including explicit success/error-marker checks rather than relying on process exit alone. - Seven generated `.ssi` interfaces compare equal after omitting only their direct import declarations. Headers, exports, runtime/syntax binding declarations and loader calls are retained. The public JSON facade, API and environment interfaces are byte-identical. - All seven changed direct graph edges have phase-zero routes in the original dependency graph. A small Lean model establishes reachability containment and optional-region exclusion under those premises. It does not prove arbitrary initializer-effect equivalence, compiler correctness or wall time. - Sampled runs were used only for attribution; their timing was not pooled with the untraced pairs. Earlier POO-only import/C4/load-path candidates without stable whole-process/tail gains were rejected. ### 2. Minimal separate-link reproduction Use a fresh ordinary package directory and output prefix. The `std/` prefix is essential to this reproduction: the same source under an ordinary user-package prefix links successfully. `gerbil.pkg`: ```scheme (package: std/import-check) ``` `value.ss`: ```scheme prelude: :gerbil/base (export echo) ;; Return the supplied value without another library dependency. (def (echo value) value) ``` `public.ss`: ```scheme prelude: :gerbil/base (import ./value) (export (import: ./value)) ``` `main.ss`: ```scheme prelude: :gerbil/base (import ./public (only-in :gerbil/runtime/loader set-load-path!)) (export main) ;; Exercise the linked facade without any external module search. (def (main . _) (set-load-path! []) (unless (eq? (echo #f) #f) (error "linked reexport oracle")) (displayln "REEXPORT-LINKED-OK")) ``` `build.ss`: ```scheme #!/usr/bin/env -S gxi -:max-heap=2G,debug=q (import :std/build-script (only-in :std/make pkg-config-libs)) (export main) (defbuild-script (append '("value" "public") (list (list 'exe: "main" bin: "reexport-control" "-cc-options" "-O2" "-ld-options" (pkg-config-libs "openssl"))))) ``` Make `build.ss` executable and invoke standard `gerbil build` with a fresh `GERBIL_PATH` and the established `GERBIL_BUILD_CORES`/2 GiB settings. Observed linker error: ```text ld: file cannot be open()ed, errno=2 (No such file or directory) .../lib/static/std__import-check__public.o ``` The compiler's separate-link path maps all `libgerbil-scm` entries to C/object paths. The user-library path already filters empty Scheme units with the existing `not-file-empty?` helper. The isolated candidate applies that same filter after `fold-libgerbil-runtime-scm`, retaining `deps` and the logical `builtin-modules` inventory: ```scheme (libgerbil-scm (filter not-file-empty? (fold-libgerbil-runtime-scm gerbil-staticdir libgerbil-scm))) ``` With the isolated rebuilt compiler, the minimal executable prints `REEXPORT-LINKED-OK`. Both source-built JSON arms and both source-built POO JSON consumers also link normally and perform a nested false/null roundtrip with external module search disabled: four successful executable controls. The 38-case official suites were rerun successfully with that compiler as well. ### Exact patches used in the isolated experiments The dependency-only paired measurements above use this five-file standard-library patch. It changes the dependency owner imported; it adds no loader or cache: ```diff --- a/src/std/encoding/json/reader.ss +++ b/src/std/encoding/json/reader.ss @@ -3,7 +3,7 @@ ;;; © vyzo ;;; json reader (import :std/error - :std/io + :std/io/interface :std/io/bio/api :std/list/walist :std/encoding/hex --- a/src/std/encoding/json/writer.ss +++ b/src/std/encoding/json/writer.ss @@ -3,7 +3,7 @@ ;;; © vyzo ;;; json writer (import :std/error - :std/io + :std/io/interface :std/serde/serialize :std/format :std/format/ioutil --- a/src/std/encoding/json/io.ss +++ b/src/std/encoding/json/io.ss @@ -2,7 +2,7 @@ ;;; -*- Gerbil -*- ;;; © vyzo ;;; json io interface -(import :std/io +(import :std/io/interface :std/io/bio/api ./env ./writer --- a/src/std/encoding/json/util.ss +++ b/src/std/encoding/json/util.ss @@ -4,7 +4,7 @@ ;;; json utilities (import :std/error :std/format/ioutil - :std/io + (only-in :std/io/util with-buffered-reader with-buffered-writer) :std/io/bio/api :std/iter :std/list/alist --- a/src/std/text/parser/ll1.ss +++ b/src/std/text/parser/ll1.ss @@ -17,7 +17,9 @@ (import (for-syntax :std/number/misc) :std/error - :std/io + :std/io/bio/api + (only-in :std/io/interface/bio BufferedReader) + (only-in :std/io/util with-buffered-reader) (only-in :std/text/parser/base ParseError? raise-parse-error) :std/iter :std/vector/u8vector ``` The linked correctness controls additionally use this driver patch against the published Darwin-provider source baseline. The logical builtin-module inventory stays unchanged; only empty physical Scheme units are omitted from link inputs: ```diff --- a/src/gerbil/compiler/driver.ss +++ b/src/gerbil/compiler/driver.ss @@ -250,7 +250,8 @@ (deps (find-runtime-module-deps ctx)) (libgerbil-deps (filter libgerbil-module? deps)) (libgerbil-scm (map find-static-module-file libgerbil-deps)) - (libgerbil-scm (fold-libgerbil-runtime-scm gerbil-staticdir libgerbil-scm)) + (libgerbil-scm (filter not-file-empty? + (fold-libgerbil-runtime-scm gerbil-staticdir libgerbil-scm))) (libgerbil-c (map replace-extension-with-c libgerbil-scm)) (libgerbil-o (map replace-extension-with-object libgerbil-scm)) (src-deps (filter userlib-module? deps)) ``` ### Remaining acceptance and limits - Full compiler regression/CI and full POO acceptance with a qualified compiler release remain outstanding; the current POO CI does not validate this patch. - The isolated compiler bootstrap retained the 2 GiB Scheme heap setting, but one C frontend exceeded 2 GiB RSS. It is not evidence of a whole-build 2 GiB process-RSS qualification. - Generated-interface equality and targeted regressions do not establish that every initializer effect of every removed module is unobservable in arbitrary external programs. Review the dependency/API boundary before adoption. - Build time, dyld/OS waits, GC and process wall are distinct observations. No system safety settings, priorities, loader, cache layer or MOP split was introduced. Raw local logs, failed controls, source identities and the exact five-file candidate patch are retained outside tracked sources; no benchmark archives or generated bulk data are proposed for Git. The builds and regressions use the existing [standard build template](https://gerbil.scheme.org/reference/dev/build) and `gerbil test`; no alternate compiler or test runner is proposed.
Owner
  1. You mention patches, but this is an issue not a PR. Is there a linked PR?
  2. You also mention Gerbil-POO, but this is all Gerbil.
  3. I assume you're hacking on the v0.19-staging branch where work is happening. If not, can you port your work there?
  4. You seem to be reporting bug. Can you provide reproductions, and if possible test cases in a commit that comes before the fixes?

PS: Thanks a lot for contributing!

1. You mention patches, but this is an issue not a PR. Is there a linked PR? 2. You also mention Gerbil-POO, but this is all Gerbil. 3. I assume you're hacking on the v0.19-staging branch where work is happening. If not, can you port your work there? 4. You seem to be reporting bug. Can you provide reproductions, and if possible test cases in a commit that comes before the fixes? PS: Thanks a lot for contributing!
Owner

Also, Gerbil-POO itself was never designed for performance. But if you're interested in Prototype OO and performance, we should be talking, because I have plans.

Also, Gerbil-POO itself was never designed for performance. But if you're interested in Prototype OO and performance, we should be talking, because I have plans.
Author

@fare wrote in #1516 (comment):

  1. You mention patches, but this is an issue not a PR. Is there a linked PR?

    1. You also mention Gerbil-POO, but this is all Gerbil.

    2. I assume you're hacking on the v0.19-staging branch where work is happening. If not, can you port your work there?

    3. You seem to be reporting bug. Can you provide reproductions, and if possible test cases in a commit that comes before the fixes?

PS: Thanks a lot for contributing!

  1. The patch set I mentioned is for Darwin. I haven’t tested it on Linux yet. In my measurements, Gerbil builds on Darwin take roughly 5–10 times as long as comparable Linux builds. Macro expansion is a significant cost on Darwin and has had much less impact in my Linux CI runs. My current patched build appears to be -2–3 times faster on Darwin, but the underlying build bottleneck remains.

  2. Gerbil-POO is one of the projects where I’ve run into this. I use it extensively, and building it on Darwin exposes a Gerbil bottleneck I want to investigate here. Macro expansion is particularly expensive on Darwin and contributes substantially to the slow build times I’m seeing. In my Linux CI runs, it has had much less impact. I haven’t tested the Darwin patch set on Linux yet. I recently moved from the US to China and don’t have a Linux machine available for local testing.

  3. I’m working on two separate efforts. One focuses on improving the Darwin build experience. The other explores a deeper redesign of SMP, especially the shared heap.

  4. I’ve included some initial reproduction notes in the issue. I’ll run more detailed Linux benchmarks in GitHub Actions to see whether I can reproduce the problem there and establish a comparable baseline. The Darwin slowdown is already visible in my GitHub Actions runs. My agent core will rely heavily on the Gerbil VM, so I want people to be able to build, develop, and run Gerbil efficiently on both Linux and Darwin.

@fare wrote in https://git.cons.io/mighty-gerbils/gerbil/issues/1516#issuecomment-3106: > 1. You mention patches, but this is an issue not a PR. Is there a linked PR? > > 2. You also mention Gerbil-POO, but this is all Gerbil. > > 3. I assume you're hacking on the v0.19-staging branch where work is happening. If not, can you port your work there? > > 4. You seem to be reporting bug. Can you provide reproductions, and if possible test cases in a commit that comes before the fixes? > > > PS: Thanks a lot for contributing! 1. The patch set I mentioned is for Darwin. I haven’t tested it on Linux yet. In my measurements, Gerbil builds on Darwin take roughly 5–10 times as long as comparable Linux builds. Macro expansion is a significant cost on Darwin and has had much less impact in my Linux CI runs. My current [patched](https://github.com/tao3k/gerbil-bazel/tree/main/patches) build appears to be -2–3 times faster on Darwin, but the underlying build bottleneck remains. 2. Gerbil-POO is one of the projects where I’ve run into this. I use it extensively, and building it on Darwin exposes a Gerbil bottleneck I want to investigate here. [Macro expansion](https://github.com/tao3k/gerbil-bazel/tree/main/patches/gerbil-v19-darwin) is particularly expensive on Darwin and contributes substantially to the slow build times I’m seeing. In my Linux CI runs, it has had much less impact. I haven’t tested the Darwin patch set on Linux yet. I recently moved from the US to China and don’t have a Linux machine available for local testing. 3. I’m working on two separate efforts. One focuses on improving the [Darwin build experience](https://github.com/tao3k/gambit/pull/2). The other explores a deeper redesign of [SMP](https://github.com/tao3k/gambit/pull/1), especially the shared heap. 4. I’ve included some initial reproduction notes in the issue. I’ll run more detailed Linux benchmarks in GitHub Actions to see whether I can reproduce the problem there and establish a comparable baseline. The Darwin slowdown is already visible in my GitHub Actions runs. My agent core will rely heavily on the Gerbil VM, so I want people to be able to build, develop, and run Gerbil efficiently on both Linux and Darwin.
Author

@fare wrote in #1516 (comment):

Also, Gerbil-POO itself was never designed for performance. But if you're interested in Prototype OO and performance, we should be talking, because I have plans.

sure, I developed(most with LLM assistant) a full feature of Gerbil-POO -> https://github.com/tao3k/lean-poo . Also inspired by doom and nixosModules, I designed modularPOO

Guix has given the Guile community a shared project to build around, and I think that’s helped Guile thrive in recent years. I’d love to see Gerbil build that same spirit of contribution and go even further.

I’ve already built an agent implementation that can serve as an alternative to tools like Codex and OpenCode. Getting that working has given me confidence that I can help build this ecosystem.

@fare wrote in https://git.cons.io/mighty-gerbils/gerbil/issues/1516#issuecomment-3107: > Also, Gerbil-POO itself was never designed for performance. But if you're interested in Prototype OO and performance, we should be talking, because I have plans. sure, I developed(most with LLM assistant) a full feature of [Gerbil-POO ](https://github.com/tao3k/gerbil-poo) -> https://github.com/tao3k/lean-poo . Also inspired by doom and nixosModules, I designed [modularPOO](https://github.com/tao3k/gebril-yuanxu/tree/refactor/module-feature-ownership) - Pure gerbil-poo project: https://github.com/tao3k/agentic-ai-lab/tree/research/ascent-poo-flow/modules I’d like Gerbil to have a community ecosystem for the AI era, inspired by Doom Emacs and NixOS modules. People could contribute their own modules and combine them to suit the way they work. I’ve already added Nix support and successfully deployed [OpenTofu](https://github.com/tao3k/agentic-ai-lab/tree/research/ascent-poo-flow/modules/services/opentofu#configuration-interface). Guix has given the Guile community a shared project to build around, and I think that’s helped Guile thrive in recent years. I’d love to see Gerbil build that same spirit of contribution and go even further. I’ve already built an [agent implementation](https://github.com/tao3k/marlin-agent-core) that can serve as an alternative to tools like Codex and OpenCode. Getting that working has given me confidence that I can help build this ecosystem. - one of real case project: https://github.com/hardenedlinux/weaver/tree/main
Author

By the way, What do you think if we reintroduce the racket like quick-check to gerbil?

By the way, What do you think if we reintroduce the [racket like quick-check](https://docs.racket-lang.org/quickcheck/index.html) to [gerbil](https://github.com/tao3k/gerbil-poo/blob/master/doc/pbt-design-rfc.md)?
Owner
  • I want to integrate POO, the current objects (in v0.19-staging), interfaces, and more, into a single object system, with the usual optimizations when static, or with static "shape", etc.
  • I want quickcheck, but I also want it in Gerbil core, and I also want it configured with POO or a successor thereof. I understand—all of it, but not necessarily in that order.
- I want to integrate POO, the current objects (in v0.19-staging), interfaces, and more, into a single object system, with the usual optimizations when static, or with static "shape", etc. - I want quickcheck, but I also want it in Gerbil core, and I also want it configured with POO or a successor thereof. I understand—all of it, but not necessarily in that order.
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mighty-gerbils/gerbil#1516
No description provided.