Migrate chez-* refs to jerboa-* + jerbuild prelude auto-except
ober
689f7025eba5b6bc9e47667cd2276b1145ecb8f7
--- a/Makefile +++ b/Makefile @@ -30,11 +30,11 @@ CHEZ_INSTALL_FLAGS = \ --as-is LIBDIRS = lib # Base directory for chez-* repos (legacy C FFI — see `make native` for Rust backend) -CHEZ_EXT_DIR ?= $(HOME)/src +JERBOA_EXT_DIR ?= $(HOME)/src # External chez-* library paths for legacy wrapper modules -CHEZ_EXT_LIBDIRS = $(CHEZ_EXT_DIR)/chez-https/src:$(CHEZ_EXT_DIR)/chez-ssl/src:$(CHEZ_EXT_DIR)/chez-zlib/src:$(CHEZ_EXT_DIR)/chez-pcre2:$(CHEZ_EXT_DIR)/chez-leveldb:$(CHEZ_EXT_DIR)/chez-epoll/src:$(CHEZ_EXT_DIR)/chez-inotify/src:$(CHEZ_EXT_DIR)/chez-crypto/src:$(CHEZ_EXT_DIR)/chez-sqlite/src:$(CHEZ_EXT_DIR)/chez-postgresql/src +JERBOA_EXT_LIBDIRS = $(JERBOA_EXT_DIR)/jerboa-https/src:$(JERBOA_EXT_DIR)/jerboa-ssl/src:$(JERBOA_EXT_DIR)/chez-zlib/src:$(JERBOA_EXT_DIR)/jerboa-pcre2:$(JERBOA_EXT_DIR)/chez-leveldb:$(JERBOA_EXT_DIR)/chez-epoll/src:$(JERBOA_EXT_DIR)/jerboa-inotify/src:$(JERBOA_EXT_DIR)/jerboa-crypto/src:$(JERBOA_EXT_DIR)/jerboa-sqlite/src:$(JERBOA_EXT_DIR)/chez-postgresql/src # Shared object paths for legacy FFI-based chez-* libraries -CHEZ_EXT_LDPATH = $(CHEZ_EXT_DIR)/chez-ssl:$(CHEZ_EXT_DIR)/chez-zlib:$(CHEZ_EXT_DIR)/chez-pcre2:$(CHEZ_EXT_DIR)/chez-leveldb:$(CHEZ_EXT_DIR)/chez-epoll:$(CHEZ_EXT_DIR)/chez-inotify:$(CHEZ_EXT_DIR)/chez-crypto:$(CHEZ_EXT_DIR)/chez-sqlite:$(CHEZ_EXT_DIR)/chez-postgresql +JERBOA_EXT_LDPATH = $(JERBOA_EXT_DIR)/jerboa-ssl:$(JERBOA_EXT_DIR)/chez-zlib:$(JERBOA_EXT_DIR)/jerboa-pcre2:$(JERBOA_EXT_DIR)/chez-leveldb:$(JERBOA_EXT_DIR)/chez-epoll:$(JERBOA_EXT_DIR)/jerboa-inotify:$(JERBOA_EXT_DIR)/jerboa-crypto:$(JERBOA_EXT_DIR)/jerboa-sqlite:$(JERBOA_EXT_DIR)/chez-postgresql PURE_AUDIT_ROOT ?= $(HOME)/mine PURE_AUDIT_ARGS ?= --summary --discover $(PURE_AUDIT_ROOT) TYPED_SOURCES ?= tests/fixtures/typed/valid-split-tree.ss @@ -883,34 +883,34 @@ test-regex-all: test-rawstring test-regex test-rx test-peg test-wrappers: @echo "--- Wrapper module tests ---" - @$(SCHEME) --libdirs "$(LIBDIRS):$(CHEZ_EXT_LIBDIRS)" --script tests/test-wrappers.ss 2>/dev/null || echo " yaml: SKIP (library not found)" - @LD_LIBRARY_PATH="$(CHEZ_EXT_LDPATH):$$LD_LIBRARY_PATH" \ - $(SCHEME) --libdirs "$(LIBDIRS):$(CHEZ_EXT_LIBDIRS)" --script tests/test-wrapper-zlib.ss 2>/dev/null \ - || echo " zlib: SKIP (requires chez_zlib_shim.so)" - @ln -sf $(CHEZ_EXT_DIR)/chez-ssl/chez_ssl_shim.so ./chez_ssl_shim.so 2>/dev/null; \ - LD_LIBRARY_PATH="$(CHEZ_EXT_LDPATH):$$LD_LIBRARY_PATH" \ - $(SCHEME) --libdirs "$(LIBDIRS):$(CHEZ_EXT_LIBDIRS)" --script tests/test-wrapper-ssl.ss 2>/dev/null \ - && $(SCHEME) --libdirs "$(LIBDIRS):$(CHEZ_EXT_LIBDIRS)" --script tests/test-wrapper-request.ss 2>/dev/null; \ - rm -f ./chez_ssl_shim.so \ - || echo " ssl/request: SKIP (requires chez_ssl_shim.so)" - @LD_LIBRARY_PATH="$(CHEZ_EXT_LDPATH):$$LD_LIBRARY_PATH" CHEZ_PCRE2_LIB="$(CHEZ_EXT_DIR)/chez-pcre2" \ - $(SCHEME) --libdirs "$(LIBDIRS):$(CHEZ_EXT_LIBDIRS)" --script tests/test-wrapper-pcre2.ss 2>/dev/null \ + @$(SCHEME) --libdirs "$(LIBDIRS):$(JERBOA_EXT_LIBDIRS)" --script tests/test-wrappers.ss 2>/dev/null || echo " yaml: SKIP (library not found)" + @LD_LIBRARY_PATH="$(JERBOA_EXT_LDPATH):$$LD_LIBRARY_PATH" \ + $(SCHEME) --libdirs "$(LIBDIRS):$(JERBOA_EXT_LIBDIRS)" --script tests/test-wrapper-zlib.ss 2>/dev/null \ + || echo " zlib: SKIP (requires jerboa_zlib_shim.so)" + @ln -sf $(JERBOA_EXT_DIR)/jerboa-ssl/jerboa_ssl_shim.so ./jerboa_ssl_shim.so 2>/dev/null; \ + LD_LIBRARY_PATH="$(JERBOA_EXT_LDPATH):$$LD_LIBRARY_PATH" \ + $(SCHEME) --libdirs "$(LIBDIRS):$(JERBOA_EXT_LIBDIRS)" --script tests/test-wrapper-ssl.ss 2>/dev/null \ + && $(SCHEME) --libdirs "$(LIBDIRS):$(JERBOA_EXT_LIBDIRS)" --script tests/test-wrapper-request.ss 2>/dev/null; \ + rm -f ./jerboa_ssl_shim.so \ + || echo " ssl/request: SKIP (requires jerboa_ssl_shim.so)" + @LD_LIBRARY_PATH="$(JERBOA_EXT_LDPATH):$$LD_LIBRARY_PATH" JERBOA_PCRE2_LIB="$(JERBOA_EXT_DIR)/jerboa-pcre2" \ + $(SCHEME) --libdirs "$(LIBDIRS):$(JERBOA_EXT_LIBDIRS)" --script tests/test-wrapper-pcre2.ss 2>/dev/null \ || echo " pcre2: SKIP (requires pcre2_shim.so)" - @LD_LIBRARY_PATH="$(CHEZ_EXT_LDPATH):$$LD_LIBRARY_PATH" \ - $(SCHEME) --libdirs "$(LIBDIRS):$(CHEZ_EXT_LIBDIRS)" --script tests/test-wrapper-epoll.ss 2>/dev/null \ - || echo " epoll: SKIP (requires chez_epoll_shim.so)" - @LD_LIBRARY_PATH="$(CHEZ_EXT_LDPATH):$$LD_LIBRARY_PATH" \ - $(SCHEME) --libdirs "$(LIBDIRS):$(CHEZ_EXT_LIBDIRS)" --script tests/test-wrapper-inotify.ss 2>/dev/null \ - || echo " inotify: SKIP (requires chez_inotify_shim.so)" - @LD_LIBRARY_PATH="$(CHEZ_EXT_LDPATH):$$LD_LIBRARY_PATH" \ - $(SCHEME) --libdirs "$(LIBDIRS):$(CHEZ_EXT_LIBDIRS)" --script tests/test-wrapper-crypto.ss 2>/dev/null \ - || echo " crypto: SKIP (requires chez_crypto_shim.so)" - @LD_LIBRARY_PATH="$(CHEZ_EXT_LDPATH):$$LD_LIBRARY_PATH" \ - $(SCHEME) --libdirs "$(LIBDIRS):$(CHEZ_EXT_LIBDIRS)" --script tests/test-wrapper-sqlite.ss 2>/dev/null \ - || echo " sqlite: SKIP (requires chez_sqlite_shim.so)" - @LD_LIBRARY_PATH="$(CHEZ_EXT_LDPATH):$$LD_LIBRARY_PATH" \ - $(SCHEME) --libdirs "$(LIBDIRS):$(CHEZ_EXT_LIBDIRS)" --script tests/test-wrapper-postgresql.ss 2>/dev/null \ - || echo " postgresql: SKIP (requires chez_pg_shim.so)" + @LD_LIBRARY_PATH="$(JERBOA_EXT_LDPATH):$$LD_LIBRARY_PATH" \ + $(SCHEME) --libdirs "$(LIBDIRS):$(JERBOA_EXT_LIBDIRS)" --script tests/test-wrapper-epoll.ss 2>/dev/null \ + || echo " epoll: SKIP (requires jerboa_epoll_shim.so)" + @LD_LIBRARY_PATH="$(JERBOA_EXT_LDPATH):$$LD_LIBRARY_PATH" \ + $(SCHEME) --libdirs "$(LIBDIRS):$(JERBOA_EXT_LIBDIRS)" --script tests/test-wrapper-inotify.ss 2>/dev/null \ + || echo " inotify: SKIP (requires jerboa_inotify_shim.so)" + @LD_LIBRARY_PATH="$(JERBOA_EXT_LDPATH):$$LD_LIBRARY_PATH" \ + $(SCHEME) --libdirs "$(LIBDIRS):$(JERBOA_EXT_LIBDIRS)" --script tests/test-wrapper-crypto.ss 2>/dev/null \ + || echo " crypto: SKIP (requires jerboa_crypto_shim.so)" + @LD_LIBRARY_PATH="$(JERBOA_EXT_LDPATH):$$LD_LIBRARY_PATH" \ + $(SCHEME) --libdirs "$(LIBDIRS):$(JERBOA_EXT_LIBDIRS)" --script tests/test-wrapper-sqlite.ss 2>/dev/null \ + || echo " sqlite: SKIP (requires jerboa_sqlite_shim.so)" + @LD_LIBRARY_PATH="$(JERBOA_EXT_LDPATH):$$LD_LIBRARY_PATH" \ + $(SCHEME) --libdirs "$(LIBDIRS):$(JERBOA_EXT_LIBDIRS)" --script tests/test-wrapper-postgresql.ss 2>/dev/null \ + || echo " postgresql: SKIP (requires jerboa_pg_shim.so)" test-features: test-phase2 test-phase3 --- a/docs/actor-model.md +++ b/docs/actor-model.md @@ -222,7 +222,7 @@ To convert a time object to a float without SRFI-19: │ (std misc channel) — bounded channels + select │ │ (std misc thread) — Gambit thread API │ │ (std task) — task groups + futures │ -│ (std net ssl) — TCP+TLS via chez-ssl (legacy) │ +│ (std net ssl) — TCP+TLS via jerboa-ssl (legacy) │ │ (jerboa core) — match, def, defstruct │ └──────────────────────────────────────────────────────┘ ``` @@ -3426,13 +3426,13 @@ Implementation checklist: **File**: `lib/std/actor/transport.sls` **Test**: `tests/test-actor-transport.ss` -**Dependencies**: `core.sls`, `(std net ssl)` (chez-ssl fd-based TCP — legacy, no Rust replacement yet) +**Dependencies**: `core.sls`, `(std net ssl)` (jerboa-ssl fd-based TCP — legacy, no Rust replacement yet) Implementation checklist: - [x] `message->bytes` serializes to 4-byte-length-prefixed fasl bytevector - [x] `bytes->message` deserializes from framed bytevector - [x] `read-exact-into-buf` handles partial TCP reads (loops until N bytes received) -- [x] `read-framed-message` / `write-framed-message` fd-based (chez-ssl API) +- [x] `read-framed-message` / `write-framed-message` fd-based (jerboa-ssl API) - [x] `start-node!` sets node-id and cookie parameters - [x] `node-id->host+port` parses from right (IPv6 safe) - [x] Connection pool with `make-hashtable` (string keys) + write-mutex per connection @@ -3451,9 +3451,9 @@ Implementation checklist: remote `(id node)` branches took 2 args. Fixed remote to take 3 args `(id node 'remote)` so `case-lambda` dispatch works correctly. -**Note**: TCP integration uses `(std net ssl)` / `chez-ssl` fd-based API (legacy — no Rust replacement yet): +**Note**: TCP integration uses `(std net ssl)` / `jerboa-ssl` fd-based API (legacy — no Rust replacement yet): `tcp-connect`, `tcp-listen`, `tcp-accept`, `tcp-read`, `tcp-write`, `tcp-close`. -Run tests from the `chez-ssl` directory (or with full .so path) so `chez_ssl_shim.so` loads. +Run tests from the `jerboa-ssl` directory (or with full .so path) so `jerboa_ssl_shim.so` loads. --- @@ -3547,7 +3547,7 @@ JSON would require explicit conversion for every message type. ### Why cookie authentication instead of TLS client certs? Cookie auth (shared secret) is simpler to set up and sufficient for a trusted -private network. TLS via chez-ssl (legacy) can be layered on top for encryption without +private network. TLS via jerboa-ssl (legacy) can be layered on top for encryption without changing the authentication model. ### Why monitors instead of links for supervision? --- a/docs/architecture-split.md +++ b/docs/architecture-split.md @@ -4,7 +4,7 @@ Last updated: 2026-03-22. ## The Problem -Jerboa has 489 stdlib modules with actors, structured concurrency, channels, contracts, custodians, error conditions, and more. But companion libraries like `chez-ssh` are written as pure R6RS — they can't use any of it. They're writing 2006-era Scheme on a 2026-era platform. +Jerboa has 489 stdlib modules with actors, structured concurrency, channels, contracts, custodians, error conditions, and more. But companion libraries like `jerboa-ssh` are written as pure R6RS — they can't use any of it. They're writing 2006-era Scheme on a 2026-era platform. Why? Because chez-* libraries were designed for the broader Chez Scheme community. But jerboa is a personal project — the only consumers are jerboa, jerboa-emacs, and Claude. The "portability to stock Chez" constraint costs real capability for zero benefit. @@ -72,23 +72,23 @@ These entries should be split over time into two groups: | chez-* (legacy) | Rust replacement | Jerboa module | |------------------|-----------------|---------------| -| chez-crypto (OpenSSL) | ring | `(std crypto native-rust)` | +| jerboa-crypto (OpenSSL) | ring | `(std crypto native-rust)` | | chez-zlib (libz) | flate2 | `(std compress native-rust)` | -| chez-pcre2 (libpcre2) | regex (NFA, ReDoS-immune) | `(std regex-native)` | -| chez-sqlite (libsqlite3) | rusqlite (bundled) | `(std db sqlite-native)` | +| jerboa-pcre2 (libpcre2) | regex (NFA, ReDoS-immune) | `(std regex-native)` | +| jerboa-sqlite (libsqlite3) | rusqlite (bundled) | `(std db sqlite-native)` | | chez-postgresql (libpq) | rust-postgres | `(std db postgresql-native)` | | chez-epoll (syscalls) | libc (Rust) | `(std os epoll-native)` | -| chez-inotify (syscalls) | libc (Rust) | `(std os inotify-native)` | +| jerboa-inotify (syscalls) | libc (Rust) | `(std os inotify-native)` | | — (landlock-shim.c) | libc (Rust) | `(std os landlock-native)` | ### Still chez-* only (no Rust replacement yet) | Library | C Library | What It Does | |---------|-----------|-------------| -| chez-ssl | OpenSSL | `ssl-connect`, `ssl-read`, `ssl-write` — direct SSL_* calls (rustls-ffi planned) | +| jerboa-ssl | OpenSSL | `ssl-connect`, `ssl-read`, `ssl-write` — direct SSL_* calls (rustls-ffi planned) | | chez-leveldb | LevelDB | `leveldb-open`, `leveldb-put`, `leveldb-get` — direct C API | -| chez-scintilla | Scintilla | Editor widget message passing — direct Scintilla API | -| chez-qt | Qt6 | Widget creation, signals/slots — direct Qt C++ shim | +| jerboa-scintilla | Scintilla | Editor widget message passing — direct Scintilla API | +| jerboa-qt | Qt6 | Widget creation, signals/slots — direct Qt C++ shim | ### Correctly placed in chez-* (pure Scheme, no jerboa needed) @@ -100,19 +100,19 @@ These entries should be split over time into two groups: | Library | Replacement | Notes | |---------|------------|-------| -| chez-yaml | `(std text yaml)` — pure Scheme | Roundtrip support (preserves comments, key ordering, scalar styles). No C dependency. Eliminates libyaml attack surface. | +| jerboa-yaml | `(std text yaml)` — pure Scheme | Roundtrip support (preserves comments, key ordering, scalar styles). No C dependency. Eliminates libyaml attack surface. | ### Migrated to jerboa (completed) | Library | FFI shim in chez-* | Logic in jerboa | |---------|-------------------|----------------| -| **chez-ssh** | `(chez-ssh crypto)` — 21 FFI bindings for TCP, SHA-256, HMAC, Curve25519, ChaCha20-Poly1305, AES-256-CTR, Ed25519. `(chez-ssh)` — agent key management FFI | `(std net ssh)` — 10 modules: wire format, transport, kex, auth, channel, session, SFTP, known-hosts, port forwarding, high-level client (3,132 lines) | +| **jerboa-ssh** | `(jerboa-ssh crypto)` — 21 FFI bindings for TCP, SHA-256, HMAC, Curve25519, ChaCha20-Poly1305, AES-256-CTR, Ed25519. `(jerboa-ssh)` — agent key management FFI | `(std net ssh)` — 10 modules: wire format, transport, kex, auth, channel, session, SFTP, known-hosts, port forwarding, high-level client (3,132 lines) | ### Should migrate logic to jerboa | Library | FFI shim stays in chez-* | Logic moves to jerboa | |---------|-------------------------|----------------------| -| **chez-https** | Could stay as-is (it's already pure Scheme over chez-ssl) — but connection pooling, retry, redirect following would benefit from jerboa | HTTP client with connection reuse, redirect following, retry → `(std net http)` using `(std misc pool)`, `(std misc retry)`, error conditions | +| **jerboa-https** | Could stay as-is (it's already pure Scheme over jerboa-ssl) — but connection pooling, retry, redirect following would benefit from jerboa | HTTP client with connection reuse, redirect following, retry → `(std net http)` using `(std misc pool)`, `(std misc retry)`, error conditions | ### Future libraries: where to put them @@ -132,7 +132,7 @@ For libraries with both FFI and logic, use two layers: ``` chez-foo/ ← FFI shim, pure R6RS - chez_foo_shim.c ← C glue code + jerboa_foo_shim.c ← C glue code foo.sls ← foreign-procedure declarations + minimal wrappers jerboa/lib/std/ ← application logic, full jerboa platform @@ -150,7 +150,7 @@ The chez-* layer exports raw operations. The jerboa layer adds: Example for SSH: ```scheme -;; chez-ssh exports (low-level, pure R6RS): +;; jerboa-ssh exports (low-level, pure R6RS): (ssh-connect host port) → raw socket handle (ssh-auth-publickey handle ...) → error code (ssh-channel-open handle) → raw channel handle @@ -176,7 +176,7 @@ SRFIs are a special case. They are standards-defined APIs that should be usable |----------|--------| | Is it `foreign-procedure` calls? | chez-* | | Is it a standards compliance layer (R7RS, SRFIs)? | chez-* | -| Is it a pure parser with no resource/concurrency needs? | chez-* (like chez-yaml) | +| Is it a pure parser with no resource/concurrency needs? | chez-* (like jerboa-yaml) | | Does it manage connections, sessions, or state? | jerboa | | Does it need concurrency, retry, or pooling? | jerboa | | Does it have a public API that should be contract-checked? | jerboa | --- a/docs/jerboa-code-typed-static-plan.md +++ b/docs/jerboa-code-typed-static-plan.md @@ -130,7 +130,7 @@ Avoid these as the first pilot: network boundaries. - `src/jcode/ui/tui-ffi.ss`: terminal FFI and C shim work should remain a separate audited boundary. -- `vendor/chez-sqlite`: SQLite is a deliberate native database boundary. +- `vendor/jerboa-sqlite`: SQLite is a deliberate native database boundary. - `vendor/jerboa-websearch/wasm`: handwritten Rust/WASM, but better tackled after the project attachment path exists. --- a/docs/libraries.md +++ b/docs/libraries.md @@ -24,10 +24,10 @@ Gerbil has ~438 `:std/*` modules. Jerboa currently implements 51. This document | Library | Wraps | Jerboa Modules | |---------|-------|---------------| -| [chez-ssl](https://git.sr.ht/~lisp/chez-ssl) | OpenSSL TLS/TCP | `(std net ssl)` | -| [chez-https](https://git.sr.ht/~lisp/chez-https) | HTTP client+server | `(std net request)`, `(std net httpd)` | +| [jerboa-ssl](https://git.sr.ht/~lisp/jerboa-ssl) | OpenSSL TLS/TCP | `(std net ssl)` | +| [jerboa-https](https://git.sr.ht/~lisp/jerboa-https) | HTTP client+server | `(std net request)`, `(std net httpd)` | | [chez-zlib](https://git.sr.ht/~lisp/chez-zlib) | zlib compression | `(std compress zlib)` | -| [chez-pcre2](https://git.sr.ht/~lisp/chez-pcre2) | PCRE2 regex | `(std pcre2)` | +| [jerboa-pcre2](https://git.sr.ht/~lisp/jerboa-pcre2) | PCRE2 regex | `(std pcre2)` | | [chez-leveldb](https://git.sr.ht/~lisp/chez-leveldb) | LevelDB | `(std db leveldb)` | ### Completed (New) @@ -35,16 +35,16 @@ Gerbil has ~438 `:std/*` modules. Jerboa currently implements 51. This document | Library | Wraps | Jerboa Modules | Status | |---------|-------|---------------|--------| | [chez-epoll](https://git.sr.ht/~lisp/chez-epoll) | Linux epoll | `(std os epoll)` | Done | -| [chez-inotify](https://git.sr.ht/~lisp/chez-inotify) | Linux inotify | `(std os inotify)` | Done | -| [chez-crypto](https://git.sr.ht/~lisp/chez-crypto) | OpenSSL EVP | `(std crypto cipher)`, `(std crypto hmac)`, `(std crypto pkey)`, `(std crypto kdf)`, `(std crypto etc)` | Done | -| [chez-sqlite](https://git.sr.ht/~lisp/chez-sqlite) | SQLite3 | `(std db sqlite)` | Done | +| [jerboa-inotify](https://git.sr.ht/~lisp/jerboa-inotify) | Linux inotify | `(std os inotify)` | Done | +| [jerboa-crypto](https://git.sr.ht/~lisp/jerboa-crypto) | OpenSSL EVP | `(std crypto cipher)`, `(std crypto hmac)`, `(std crypto pkey)`, `(std crypto kdf)`, `(std crypto etc)` | Done | +| [jerboa-sqlite](https://git.sr.ht/~lisp/jerboa-sqlite) | SQLite3 | `(std db sqlite)` | Done | | [chez-postgresql](https://git.sr.ht/~lisp/chez-postgresql) | libpq | `(std db postgresql)` | Done | ### Replaced (No Longer Needed) | Library | Replaced By | Notes | |---------|------------|-------| -| [chez-yaml](https://git.sr.ht/~lisp/chez-yaml) | Pure Scheme `(std text yaml)` | Roundtrip support: preserves comments, key ordering, scalar styles. No C dependency. 58 tests. | +| [jerboa-yaml](https://git.sr.ht/~lisp/jerboa-yaml) | Pure Scheme `(std text yaml)` | Roundtrip support: preserves comments, key ordering, scalar styles. No C dependency. 58 tests. | ## Pure Scheme Modules (No External Deps) --- a/docs/native-rust.md +++ b/docs/native-rust.md @@ -68,12 +68,12 @@ Replacing them with a single Rust shared library (`libjerboa_native.so`) provide | Library | Shim | Module | Purpose | |----------------------------|-----------------|---------------------|-----------------------------| | **libz.so** | chez-zlib | `std/compress/zlib` | Deflate/inflate compression | -| **libpcre2-8.so** | chez-pcre2 | `std/pcre2` | Perl-compatible regex | -| **libsqlite3.so** | chez-sqlite | `std/db/sqlite` | SQLite database | +| **libpcre2-8.so** | jerboa-pcre2 | `std/pcre2` | Perl-compatible regex | +| **libsqlite3.so** | jerboa-sqlite | `std/db/sqlite` | SQLite database | | **libpq.so** | chez-postgresql | `std/db/postgresql` | PostgreSQL client | | **libleveldb.so** | chez-leveldb | `std/db/leveldb` | LevelDB key-value store | -| ~~**libyaml.so**~~ | ~~chez-yaml~~ | `std/text/yaml` | ~~YAML parsing~~ — **Eliminated**: now pure Scheme with roundtrip support | -| **libcurl.so** (or libssl) | chez-https | `std/net/request` | HTTPS client | +| ~~**libyaml.so**~~ | ~~jerboa-yaml~~ | `std/text/yaml` | ~~YAML parsing~~ — **Eliminated**: now pure Scheme with roundtrip support | +| **libcurl.so** (or libssl) | jerboa-https | `std/net/request` | HTTPS client | ### Custom C Code @@ -87,7 +87,7 @@ Replacing them with a single Rust shared library (`libjerboa_native.so`) provide | Shim | Module | Purpose | |-------------------|------------------|---------------------------------| | chez-epoll | `std/os/epoll` | Event polling (direct syscalls) | -| chez-inotify | `std/os/inotify` | File watching (direct syscalls) | +| jerboa-inotify | `std/os/inotify` | File watching (direct syscalls) | | liburing-ffi.so.2 | `std/os/iouring` | io_uring async I/O | --- @@ -161,7 +161,7 @@ pub extern "C" fn jerboa_inflate( **This swap is no longer needed.** `(std text yaml)` is now a pure Scheme implementation with full roundtrip support (preserves comments, key ordering, scalar styles, block/flow collection styles). No C dependency, no FFI — the entire libyaml attack surface has been eliminated without needing a Rust replacement. The pure Scheme implementation provides: -- Simple API: `yaml-load`, `yaml-dump` (backward-compatible with old chez-yaml interface) +- Simple API: `yaml-load`, `yaml-dump` (backward-compatible with old jerboa-yaml interface) - Roundtrip API: `yaml-read`, `yaml-write` (returns/consumes AST nodes with comment and style metadata) - Node manipulation: `yaml-mapping-ref`, `yaml-mapping-set!`, `yaml-ref`, `yaml-set!` - Security: `*yaml-max-input-size*` (1MB) and `*yaml-max-depth*` (512) limits @@ -170,7 +170,7 @@ The pure Scheme implementation provides: | Current | Replacement | Notes | |---------|-------------|-------| -| libsqlite3 (via chez-sqlite) | **rusqlite** | Bundles SQLite source or links system lib. Parameterized queries by default. | +| libsqlite3 (via jerboa-sqlite) | **rusqlite** | Bundles SQLite source or links system lib. Parameterized queries by default. | | libpq (via chez-postgresql) | **rust-postgres** | Pure Rust PostgreSQL client. TLS via rustls. No C dependency. | | libleveldb (via chez-leveldb) | **rusty-leveldb** or **sled** | rusty-leveldb is API-compatible; sled is pure Rust with different (better) API | @@ -181,7 +181,7 @@ The pure Scheme implementation provides: | landlock-shim.c | **landlock** crate | Clean Rust API for Landlock ABI v1-v4 | | liburing-ffi.so.2 | **io-uring** crate | Safe wrapper over kernel interface | | chez-epoll shim | Rust `epoll` wrapper or **mio** | mio abstracts over epoll/kqueue/IOCP | -| chez-inotify shim | **inotify** crate | Safe wrapper | +| jerboa-inotify shim | **inotify** crate | Safe wrapper | --- @@ -710,7 +710,7 @@ Jerboa should become the source for new safe native Jerboa code. We are in **Phase 1** (parallel installation). The Rust implementations are complete for crypto, compression, regex, databases (SQLite, PostgreSQL), and OS integration (epoll, inotify, landlock). However, the "default" modules (e.g., `(std db sqlite)`, `(std crypto cipher)`) still import from chez-* C libraries. The Rust-backed modules are available as separate imports (e.g., `(std db sqlite-native)`, `(std crypto native-rust)`). -**TLS is deferred** — `(std net ssl)` still requires chez-ssl / OpenSSL. The rustls-ffi integration is planned but not yet implemented due to the complexity of stateful TLS session management. +**TLS is deferred** — `(std net ssl)` still requires jerboa-ssl / OpenSSL. The rustls-ffi integration is planned but not yet implemented due to the complexity of stateful TLS session management. ### Phase 1: Parallel Installation (CURRENT) @@ -720,7 +720,7 @@ Both C libraries and the Rust library are available as separate modules. New cod ;; Preferred — uses Rust ring via libjerboa_native.so (import (std crypto native-rust)) -;; Legacy — uses OpenSSL via chez-crypto +;; Legacy — uses OpenSSL via jerboa-crypto (import (std crypto cipher)) ``` --- a/docs/regex.md +++ b/docs/regex.md @@ -354,7 +354,7 @@ Five backends exist with incompatible APIs. A user must pick one and learn its n - SRFI-115 (the good SRE syntax) compiles to the *slowest* backend (pregexp) - No named/composable pattern system - `regex-native` requires manual `regex-free` for cleanup -- PCRE2 is unavailable in standard builds (requires `chez-pcre2` library) +- PCRE2 is unavailable in standard builds (requires `jerboa-pcre2` library) --- @@ -1218,7 +1218,7 @@ Work through this in strict order — each tier depends on the previous: **SRFI-115 is the bridge** — the SRE s-expression syntax in `(std srfi srfi-115)` is the right abstraction. Extend it rather than reinventing. -**PCRE2 is optional** — `(std pcre2)` requires `chez-pcre2` which is an external library not guaranteed to be installed. Never make it a hard dependency of `(std regex)`. The pregexp fallback must always work. +**PCRE2 is optional** — `(std pcre2)` requires `jerboa-pcre2` which is an external library not guaranteed to be installed. Never make it a hard dependency of `(std regex)`. The pregexp fallback must always work. **`regex-native` requires `libjerboa_native.so`** — detect availability at load time with `guard`. The facade must work without it. --- a/docs/security-reference.md +++ b/docs/security-reference.md @@ -380,7 +380,7 @@ Available via `(std crypto native-rust)`. Useful when AES-NI hardware is unavail ### scrypt KDF -Available via both `(std crypto kdf)` (wraps `chez-crypto` — legacy) and `(std crypto native-rust)` (`rust-scrypt` — recommended). +Available via both `(std crypto kdf)` (wraps `jerboa-crypto` — legacy) and `(std crypto native-rust)` (`rust-scrypt` — recommended). ### Password hashing -- `(std crypto password)` @@ -489,12 +489,12 @@ The cross-build scripts in `jerboa-lsp` and `jerboa-awk` patch `$jerboa-home/lib - `/Users/user/mine/jerboa/lib/std/compiler/pattern.ss:316` -### High: `chez-inotify` exposes unchecked FFI buffer reads +### High: `jerboa-inotify` exposes unchecked FFI buffer reads -`chez_inotify_shim.c` casts `buf + offset` to `struct inotify_event *` without a buffer length or alignment check. A caller can read past the end of the buffer. The `read` wrapper also treats `EINTR` as a hard error instead of retrying. +`jerboa_inotify_shim.c` casts `buf + offset` to `struct inotify_event *` without a buffer length or alignment check. A caller can read past the end of the buffer. The `read` wrapper also treats `EINTR` as a hard error instead of retrying. -- `/Users/user/mine/chez-inotify/chez_inotify_shim.c:33` -- `/Users/user/mine/chez-inotify/chez_inotify_shim.c:66` +- `/Users/user/mine/jerboa-inotify/jerboa_inotify_shim.c:33` +- `/Users/user/mine/jerboa-inotify/jerboa_inotify_shim.c:66` ### High: `jerboa-wafter` has shell injection in the Wireshark converter --- a/docs/status.md +++ b/docs/status.md @@ -362,16 +362,16 @@ Most chez-* C FFI libraries have been superseded by the Rust native backend (see | Library | Integration | |---------|------------| -| **chez-qt** | Add to `CHEZ_EXT_LIBDIRS`, create `(std gui qt)` wrapper | -| **chez-scintilla** | Already used by jerboa-emacs; expose via `(std gui scintilla)` | +| **jerboa-qt** | Add to `JERBOA_EXT_LIBDIRS`, create `(std gui qt)` wrapper | +| **jerboa-scintilla** | Already used by jerboa-emacs; expose via `(std gui scintilla)` | | **chez-r7rs** | Add to library path for `(scheme base)` etc. | -`chez-ssh` is done — protocol logic split into `(std net ssh ...)` (10 modules, 3,132 lines), FFI stays in `(chez-ssh crypto)`. +`jerboa-ssh` is done — protocol logic split into `(std net ssh ...)` (10 modules, 3,132 lines), FFI stays in `(jerboa-ssh crypto)`. ### Complete Rust Native Migration Move remaining modules from chez-* to Rust native: -- **TLS**: `(std net ssl)` still uses chez-ssl / OpenSSL — need rustls-ffi integration +- **TLS**: `(std net ssl)` still uses jerboa-ssl / OpenSSL — need rustls-ffi integration - **LevelDB**: `(std db leveldb)` still uses chez-leveldb — need rusty-leveldb or sled - **Default imports**: Main modules (e.g., `(std db sqlite)`) still import from chez-* — need to rewire to `-native` modules --- a/jerbuild.ss +++ b/jerbuild.ss @@ -690,13 +690,13 @@ with-input-from-string with-output-to-string iota 1+ 1- partition make-date make-time - getenv thread? make-mutex mutex? mutex-name)) + meta atom?)) ((jerboa prelude clean) . (make-hash-table hash-table? sort sort! printf fprintf format path-extension path-absolute? with-input-from-string with-output-to-string iota 1+ 1- partition make-date make-time - getenv thread? make-mutex mutex? mutex-name)))) + meta atom?)))) ;; Chez Scheme built-in names that may be redefined in user code. ;; Only these will be auto-excluded when a local definition shadows them. @@ -738,9 +738,85 @@ (define (chez-export? sym) (and (symbol? sym) (memq sym (chez-exports)) #t)) +(define *prelude-exports-cache* #f) + +(define (find-prelude-lib-dir) + ;; Probe known locations for the prelude's parent lib/ dir so we can seed + ;; library-directories at transpile time. Returns the dir path or #f. + (let loop ([candidates + (list (let ([v (getenv "JERBOA_HOME")]) (and v (string-append v "/lib"))) + (let ([v (getenv "JERBUILD_BUNDLE_DIR")]) (and v (string-append v "/lib"))) + (let ([v (getenv "HOME")]) (and v (string-append v "/mine/jerboa/lib"))))]) + (cond + [(null? candidates) #f] + [(and (car candidates) + (or (file-exists? (string-append (car candidates) "/jerboa/prelude.sls")) + (file-exists? (string-append (car candidates) "/jerboa/prelude.ss")))) + (car candidates)] + [else (loop (cdr candidates))]))) + +(define (prelude-exports) + ;; Symbols actually exported by (jerboa prelude). Computed once and cached. + ;; Used by apply-prelude-except to wrap (jerboa prelude) imports with + ;; (except ...) when the user's library locally defines a name that prelude + ;; already exports (would otherwise be a duplicate-definition error). + ;; + ;; If `(environment '(jerboa prelude))` fails because library-directories + ;; isn't seeded (transpile mode takes no --libdirs flag), find the prelude + ;; on disk via JERBOA_HOME / JERBUILD_BUNDLE_DIR / $HOME/mine/jerboa, add + ;; it to library-directories, and retry. + (or *prelude-exports-cache* + (let ([syms + (or (guard (e [#t #f]) + (environment-symbols (environment '(jerboa prelude)))) + (let ([dir (find-prelude-lib-dir)]) + (when dir + (library-directories (cons dir (library-directories)))) + (guard (e [#t '()]) + (environment-symbols (environment '(jerboa prelude))))))]) + (set! *prelude-exports-cache* syms) + syms))) + +(define (collect-only-imported-names imports) + ;; Collect symbols brought in via (only LIB sym ...) imports. These + ;; compete with prelude exports for the same names, so they must be + ;; excepted from prelude to avoid duplicate-definition errors. + (let loop ([imps imports] [acc '()]) + (cond + [(null? imps) acc] + [(and (pair? (car imps)) (eq? (caar imps) 'only) (pair? (cdar imps))) + (loop (cdr imps) (append (cddar imps) acc))] + [else (loop (cdr imps) acc)]))) + +(define (apply-prelude-except imports local-defs) + ;; For each bare (jerboa prelude) / (jerboa prelude clean) import, if the + ;; user has locally defined OR explicitly (only ...)-imported any names + ;; that prelude also exports, replace with + ;; (except (jerboa prelude) <conflict names...>). Leaves explicit + ;; (except ...) and non-prelude imports untouched. + (let* ([pre-syms (prelude-exports)] + [only-syms (collect-only-imported-names imports)] + [candidates (append local-defs only-syms)]) + (if (null? pre-syms) + imports + (map (lambda (imp) + (cond + [(equal? imp '(jerboa prelude)) + (let ([conflicts (filter (lambda (n) (memq n pre-syms)) candidates)]) + (if (null? conflicts) imp `(except (jerboa prelude) ,@conflicts)))] + [(equal? imp '(jerboa prelude clean)) + (let ([conflicts (filter (lambda (n) (memq n pre-syms)) candidates)]) + (if (null? conflicts) imp `(except (jerboa prelude clean) ,@conflicts)))] + [else imp])) + imports)))) + (define (collect-local-defs body-forms) - ;; Collect top-level symbol names defined in body-forms that shadow chezscheme. - ;; Only returns symbols actually exported by chezscheme (to avoid invalid except clauses). + ;; Collect ALL top-level names defined via def/define/defstruct in body. + ;; Callers filter per-target-library: chez-export? for chezscheme excepts, + ;; intersection with prelude-exports for prelude excepts. Returning the + ;; unfiltered list is required because a name like `string-prefix?` is + ;; exported by (jerboa prelude) but NOT chezscheme — pre-filtering by + ;; chez-export? hides that conflict from apply-prelude-except. ;; Handles: (def name ...), (def (name ...) ...), (define name ...), ;; (define (name ...) ...), (defstruct name ...) (let loop ([forms body-forms] [names '()]) @@ -763,9 +839,7 @@ [(eq? head 'defstruct) (if (pair? second) (car second) second)] [else #f])]) - (if (and sym (chez-export? sym)) - (cons sym names) - names))) + (if sym (cons sym names) names))) names)))))) (define (compute-exclusions translated-imports) @@ -1437,12 +1511,17 @@ (append import-exclusions local-defs) eq?))] + ;; Wrap (jerboa prelude) with (except ...) when user-defined + ;; names collide with prelude exports (prevents duplicate- + ;; definition errors in the generated library body). + [with-autos+pe (apply-prelude-except with-autos local-defs)] + ;; Build final import list: (except (chezscheme) ...) first [pre-final (cons (if (null? exclusions) '(chezscheme) `(except (chezscheme) ,@exclusions)) - with-autos)] + with-autos+pe)] ;; Resolve inter-library conflicts (e.g. srfi-13 vs misc/string) [final-imports (resolve-inter-library-conflicts pre-final)] --- a/lib/jerboa/cache.ss +++ b/lib/jerboa/cache.ss @@ -33,7 +33,7 @@ ;; ========== Hashing ========== ;; Simple string hash using Chez's built-in (not cryptographic, but fast) - ;; For production, this should use SHA-256 from chez-crypto + ;; For production, this should use SHA-256 from jerboa-crypto ;; FNV-1a hash producing a 128-bit hex string for cache keys (def (string-hash-256 str) (let ([len (string-length str)]) --- a/lib/std/compress/zlib.ss +++ b/lib/std/compress/zlib.ss @@ -1,6 +1,6 @@ #!chezscheme ;;; :std/compress/zlib -- Compression (wraps chez-zlib) -;;; Requires: chez_zlib_shim.so (zlib) +;;; Requires: jerboa_zlib_shim.so (zlib) (library (std compress zlib) (export --- a/lib/std/crypto/cipher.ss +++ b/lib/std/crypto/cipher.ss @@ -1,5 +1,5 @@ #!chezscheme -;;; :std/crypto/cipher -- Symmetric encryption (wraps chez-crypto) +;;; :std/crypto/cipher -- Symmetric encryption (wraps jerboa-crypto) (library (std crypto cipher) (export @@ -9,7 +9,7 @@ encrypt-init! encrypt-update! encrypt-final! decrypt-init! decrypt-update! decrypt-final!) - (import (only (chez-crypto) + (import (only (jerboa-crypto) encrypt decrypt cipher-key-length cipher-iv-length cipher-block-size make-cipher-ctx free-cipher-ctx --- a/lib/std/crypto/etc.ss +++ b/lib/std/crypto/etc.ss @@ -1,9 +1,9 @@ #!chezscheme -;;; :std/crypto/etc -- Crypto utilities (wraps chez-crypto) +;;; :std/crypto/etc -- Crypto utilities (wraps jerboa-crypto) (library (std crypto etc) (export random-bytes random-bytes! crypto-error-string) - (import (only (chez-crypto) random-bytes random-bytes! crypto-error-string)) + (import (only (jerboa-crypto) random-bytes random-bytes! crypto-error-string)) ) ;; end library --- a/lib/std/crypto/hmac.ss +++ b/lib/std/crypto/hmac.ss @@ -1,9 +1,9 @@ #!chezscheme -;;; :std/crypto/hmac -- HMAC message authentication (wraps chez-crypto) +;;; :std/crypto/hmac -- HMAC message authentication (wraps jerboa-crypto) (library (std crypto hmac) (export hmac hmac-md5 hmac-sha1 hmac-sha256 hmac-sha384 hmac-sha512) - (import (only (chez-crypto) hmac hmac-md5 hmac-sha1 hmac-sha256 hmac-sha384 hmac-sha512)) + (import (only (jerboa-crypto) hmac hmac-md5 hmac-sha1 hmac-sha256 hmac-sha384 hmac-sha512)) ) ;; end library --- a/lib/std/crypto/kdf.ss +++ b/lib/std/crypto/kdf.ss @@ -1,9 +1,9 @@ #!chezscheme -;;; :std/crypto/kdf -- Key derivation functions (wraps chez-crypto) +;;; :std/crypto/kdf -- Key derivation functions (wraps jerboa-crypto) (library (std crypto kdf) (export scrypt) - (import (only (chez-crypto) scrypt)) + (import (only (jerboa-crypto) scrypt)) ) ;; end library --- a/lib/std/crypto/pkey.ss +++ b/lib/std/crypto/pkey.ss @@ -1,9 +1,9 @@ #!chezscheme -;;; :std/crypto/pkey -- Public key cryptography (wraps chez-crypto) +;;; :std/crypto/pkey -- Public key cryptography (wraps jerboa-crypto) (library (std crypto pkey) (export ed25519-keygen ed25519-sign ed25519-verify) - (import (only (chez-crypto) ed25519-keygen ed25519-sign ed25519-verify)) + (import (only (jerboa-crypto) ed25519-keygen ed25519-sign ed25519-verify)) ) ;; end library --- a/lib/std/db/postgresql.ss +++ b/lib/std/db/postgresql.ss @@ -1,6 +1,6 @@ #!chezscheme ;;; :std/db/postgresql -- PostgreSQL database (wraps chez-postgresql) -;;; Requires: chez_pg_shim.so, libpq.so.5 +;;; Requires: jerboa_pg_shim.so, libpq.so.5 (library (std db postgresql) (export --- a/lib/std/db/sqlite.ss +++ b/lib/std/db/sqlite.ss @@ -1,6 +1,6 @@ #!chezscheme -;;; :std/db/sqlite -- SQLite3 database (wraps chez-sqlite) -;;; Requires: chez_sqlite_shim.so, libsqlite3.so +;;; :std/db/sqlite -- SQLite3 database (wraps jerboa-sqlite) +;;; Requires: jerboa_sqlite_shim.so, libsqlite3.so (library (std db sqlite) (export @@ -21,6 +21,6 @@ SQLITE_ROW SQLITE_DONE SQLITE_OK SQLITE_INTEGER SQLITE_FLOAT SQLITE_TEXT SQLITE_BLOB SQLITE_NULL) - (import (chez-sqlite)) + (import (jerboa-sqlite)) ) ;; end library --- a/lib/std/net/httpd.ss +++ b/lib/std/net/httpd.ss @@ -1,6 +1,6 @@ #!chezscheme ;;; :std/net/httpd -- HTTP server (wraps chez-httpd) -;;; Requires: chez-https (for chez-httpd), chez-ssl (with chez_ssl_shim.so) +;;; Requires: jerboa-https (for chez-httpd), jerboa-ssl (with jerboa_ssl_shim.so) (library (std net httpd) (export @@ -16,6 +16,6 @@ http-respond-chunk-begin http-respond-chunk http-respond-chunk-end http-respond-file) - (import (chez-httpd)) + (import (jerboa-https httpd)) ) ;; end library --- a/lib/std/net/ssh/auth.ss +++ b/lib/std/net/ssh/auth.ss @@ -3,7 +3,7 @@ ;;; ;;; Supports: publickey (ed25519), password, keyboard-interactive ;;; -;;; FFI operations imported from (chez-ssh crypto). +;;; FFI operations imported from (jerboa-ssh crypto). ;;; Uses (std net ssh conditions) for structured error hierarchy. (library (std net ssh auth) @@ -18,7 +18,7 @@ (std net ssh wire) (std net ssh transport) (std net ssh conditions) - (chez-ssh crypto) + (jerboa-ssh crypto) (only (jerboa core) def)) ;; bytevector-append is in (chezscheme) core — no shim needed. --- a/lib/std/net/ssh/client.ss +++ b/lib/std/net/ssh/client.ss @@ -68,7 +68,7 @@ (std misc pool) (std contract) (std misc state-machine) - (chez-ssh crypto) + (jerboa-ssh crypto) (only (jerboa core) def defstruct try catch finally)) ;; ---- Connection lifecycle state machine ---- --- a/lib/std/net/ssh/forward.ss +++ b/lib/std/net/ssh/forward.ss @@ -2,7 +2,7 @@ ;;; (std net ssh forward) — SSH port forwarding (RFC 4254 §7) ;;; ;;; Local (-L) and remote (-R) port forwarding. -;;; Uses (chez-ssh crypto) for TCP listen/accept/read/write/close. +;;; Uses (jerboa-ssh crypto) for TCP listen/accept/read/write/close. ;;; Uses (std net ssh conditions) for structured error hierarchy. ;;; Uses (std fiber) for green-thread-based forwarding (replaces fork-thread). ;;; Uses (std misc guardian-pool) for listen fd cleanup on GC. @@ -35,7 +35,7 @@ (std net ssh conditions) (std fiber) (std misc guardian-pool) - (chez-ssh crypto) + (jerboa-ssh crypto) (only (jerboa core) def defstruct try catch finally)) ;; ---- Guardian pool for listen fds ---- --- a/lib/std/net/ssh/kex.ss +++ b/lib/std/net/ssh/kex.ss @@ -4,7 +4,7 @@ ;;; Implements curve25519-sha256 key exchange (RFC 8731), ;;; algorithm negotiation, and key derivation (RFC 4253 §7.2). ;;; -;;; FFI operations imported from (chez-ssh crypto). +;;; FFI operations imported from (jerboa-ssh crypto). ;;; Uses (std net ssh conditions) for structured error hierarchy. (library (std net ssh kex) @@ -21,7 +21,7 @@ (std net ssh wire) (std net ssh transport) (std net ssh conditions) - (chez-ssh crypto) + (jerboa-ssh crypto) (only (jerboa core) def)) ;; ---- Helpers ---- --- a/lib/std/net/ssh/known-hosts.ss +++ b/lib/std/net/ssh/known-hosts.ss @@ -4,7 +4,7 @@ ;;; Reads/writes OpenSSH known_hosts format. ;;; Supports plain hostnames and hashed entries. ;;; -;;; Uses (chez-ssh crypto) for SHA-256 hashing only. +;;; Uses (jerboa-ssh crypto) for SHA-256 hashing only. (library (std net ssh known-hosts) (export @@ -20,7 +20,7 @@ (only (jerboa core) def try catch finally)) ;; base64-encode/decode and sha256-bytevector come from (chezscheme) core - ;; (Phases 66/67, Round 12). No more need for chez-ssh crypto FFI. + ;; (Phases 66/67, Round 12). No more need for jerboa-ssh crypto FFI. ;; ---- Fingerprint ---- --- a/lib/std/net/ssh/transport.ss +++ b/lib/std/net/ssh/transport.ss @@ -4,7 +4,7 @@ ;;; TCP connect, version exchange, packet framing (encrypt/decrypt), ;;; sequence numbers, and rekey support. ;;; -;;; FFI operations are imported from (chez-ssh crypto). +;;; FFI operations are imported from (jerboa-ssh crypto). ;;; Uses (std net ssh conditions) for structured error hierarchy. ;;; Uses (std misc guardian-pool) for TCP fd cleanup on GC. @@ -89,7 +89,7 @@ (std net ssh wire) (std net ssh conditions) (std misc guardian-pool) - (chez-ssh crypto) + (jerboa-ssh crypto) (only (jerboa core) def defstruct try catch finally)) ;; ---- Constants ---- --- a/lib/std/net/ssl.ss +++ b/lib/std/net/ssl.ss @@ -1,6 +1,6 @@ #!chezscheme -;;; :std/net/ssl -- TLS/TCP networking (wraps chez-ssl) -;;; Requires: chez_ssl_shim.so (OpenSSL) +;;; :std/net/ssl -- TLS/TCP networking (wraps jerboa-ssl) +;;; Requires: jerboa_ssl_shim.so (OpenSSL) (library (std net ssl) (export @@ -14,6 +14,6 @@ ssl-server-ctx ssl-server-ctx-free ssl-server-accept conn-wrap conn-write conn-write-string conn-read) - (import (chez-ssl)) + (import (jerboa-ssl)) ) ;; end library --- a/lib/std/net/tcp-raw.ss +++ b/lib/std/net/tcp-raw.ss @@ -1,8 +1,8 @@ #!chezscheme -;;; (std net tcp-raw) — Raw fd-based TCP, chez-ssl compatible API +;;; (std net tcp-raw) — Raw fd-based TCP, jerboa-ssl compatible API ;;; ;;; Provides tcp-connect, tcp-listen, tcp-accept, tcp-close, tcp-read, tcp-write -;;; with the same signatures as (chez-ssl)'s plain TCP functions. +;;; with the same signatures as (jerboa-ssl)'s plain TCP functions. ;;; No external library dependency — uses POSIX sockets via Chez FFI. (library (std net tcp-raw) @@ -95,7 +95,7 @@ (error 'make-sockaddr-in "invalid address" address))) buf)) - ;; ========== API (chez-ssl compatible) ========== + ;; ========== API (jerboa-ssl compatible) ========== (def (tcp-connect host port) ;; Returns fd (integer), not ports --- a/lib/std/os/epoll.ss +++ b/lib/std/os/epoll.ss @@ -1,6 +1,6 @@ #!chezscheme ;;; :std/os/epoll -- Linux epoll (wraps chez-epoll) -;;; Requires: chez_epoll_shim.so +;;; Requires: jerboa_epoll_shim.so (library (std os epoll) (export --- a/lib/std/os/inotify-native.ss +++ b/lib/std/os/inotify-native.ss @@ -1,7 +1,7 @@ #!chezscheme ;;; (std os inotify-native) — Linux inotify via Rust/libc ;;; -;;; Replaces chez-inotify dependency with Rust native implementation. +;;; Replaces jerboa-inotify dependency with Rust native implementation. (library (std os inotify-native) (export --- a/lib/std/os/inotify.ss +++ b/lib/std/os/inotify.ss @@ -1,6 +1,6 @@ #!chezscheme -;;; :std/os/inotify -- Linux filesystem event monitoring (wraps chez-inotify) -;;; Requires: chez_inotify_shim.so +;;; :std/os/inotify -- Linux filesystem event monitoring (wraps jerboa-inotify) +;;; Requires: jerboa_inotify_shim.so (library (std os inotify) (export @@ -17,6 +17,6 @@ IN_DONT_FOLLOW IN_EXCL_UNLINK IN_MASK_ADD IN_ONESHOT IN_ONLYDIR IN_IGNORED IN_ISDIR IN_Q_OVERFLOW IN_UNMOUNT) - (import (chez-inotify)) + (import (jerboa-inotify)) ) ;; end library --- a/lib/std/pcre2.ss +++ b/lib/std/pcre2.ss @@ -1,5 +1,5 @@ #!chezscheme -;;; :std/pcre2 -- PCRE2 regular expressions (wraps chez-pcre2) +;;; :std/pcre2 -- PCRE2 regular expressions (wraps jerboa-pcre2) ;;; Requires: pcre2_shim.so (libpcre2-8) (library (std pcre2) @@ -28,6 +28,6 @@ PCRE2_EXTENDED PCRE2_UTF PCRE2_UCP PCRE2_ANCHORED PCRE2_UNGREEDY PCRE2_LITERAL) - (import (chez-pcre2 pcre2)) + (import (jerboa-pcre2 pcre2)) ) ;; end library --- a/support/jerboa-embed.c +++ b/support/jerboa-embed.c @@ -16,13 +16,13 @@ struct jerboa_instance { }; /* Global init tracking — Chez can only be initialized once per process */ -static int chez_initialized = 0; +static int jerboa_initialized = 0; jerboa_t *jerboa_new(const jerboa_config_t *config) { jerboa_t *j = calloc(1, sizeof(jerboa_t)); if (!j) return NULL; - if (!chez_initialized) { + if (!jerboa_initialized) { Sscheme_init(NULL); if (config && config->boot_file) { @@ -34,7 +34,7 @@ jerboa_t *jerboa_new(const jerboa_config_t *config) { } Sbuild_heap(NULL, NULL); - chez_initialized = 1; + jerboa_initialized = 1; } /* Set up library directories */ --- a/tests/test-actor-transport.ss +++ b/tests/test-actor-transport.ss @@ -2,7 +2,7 @@ ;;; Tests for (std actor transport) — distributed actor transport ;;; ;;; Part A: serialization-only tests (no network needed) -;;; Part B: localhost round-trip tests (requires chez_ssl_shim.so) +;;; Part B: localhost round-trip tests (requires jerboa_ssl_shim.so) (import (chezscheme) (std actor core) (std actor transport) (std net ssl)) @@ -87,11 +87,11 @@ (define (try-load-ssl) (guard (exn [#t #f]) - (load-shared-object "/home/jafourni/mine/chez-ssl/chez_ssl_shim.so") + (load-shared-object "/home/jafourni/mine/jerboa-ssl/jerboa_ssl_shim.so") #t)) (if (not (try-load-ssl)) - (printf " [skip] chez_ssl_shim.so not available — skipping TCP tests~%") + (printf " [skip] jerboa_ssl_shim.so not available — skipping TCP tests~%") (let ([test-port 19571] [test-cookie "test-cookie-abc"]) --- a/tests/test-phase6-supply.ss +++ b/tests/test-phase6-supply.ss @@ -96,7 +96,7 @@ (test "sbom: add component" (let ([s (make-sbom "myapp" "1.0.0")]) - (sbom-add-component! s (make-component "chez-ssl" "1.2.0" 'library)) + (sbom-add-component! s (make-component "jerboa-ssl" "1.2.0" 'library)) (= (length (sbom-components s)) 1))) (test "sbom: component with hash and license"