diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5dbd411..d0036df 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -29,14 +29,16 @@ jobs: uses: actions/cache@v4 with: path: /opt/chez - key: chez-${{ runner.os }}-v10.4.1 + key: chez-${{ runner.os }}-v10.4.1-x11off - name: Build Chez Scheme from source if: steps.cache-chez.outputs.cache-hit != 'true' run: | git clone --depth 1 --branch v10.4.1 https://github.com/cisco/ChezScheme.git /tmp/chez-src cd /tmp/chez-src - ./configure --installprefix=/opt/chez --threads + # --disable-x11: the expression editor's X11 clipboard isn't needed and + # would pull an X11 build/link dep. + ./configure --installprefix=/opt/chez --threads --disable-x11 make -j"$(nproc)" sudo make install sudo chown -R "$USER" /opt/chez diff --git a/README.md b/README.md index 092c07e..c935ac1 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,27 @@ $ bin/joltc -e '(/ 1 2)' 1/2 ``` +## Compile a binary + +`bin/joltc build` ahead-of-time compiles a project into a single self-contained +executable — the runtime, `clojure.core`, the standard library, the app, and its +`deps.edn` dependencies are linked in, so the result needs no Chez install, no +JVM, and no source on disk to run. + +```bash +bin/joltc build -m myapp.core -o myapp # compile myapp.core's -main into ./myapp +./myapp arg1 arg2 # runs anywhere; args reach -main +``` + +Modes trade dynamism for speed: the default (release) build uses the proven code +generator; `--opt` also runs the inference + scalar-replacement passes over the +closed-world program; `--dev` is unoptimized. + +This needs Chez's kernel development files (`libkernel.a`, `scheme.h`) and a C +compiler. They come with a from-source Chez install; a distro `chezscheme` +package ships only the runtime, so `build` won't link a binary there. +RFC 0007 (`docs/rfc/`) covers the design and the three-mode model. + ## Architecture A small Chez runtime (`host/chez/*.ss`: value model, persistent collections, seqs,