Skip to content

Eliscript 0.0.2

Choose a tag to compare

@liuchong liuchong released this 22 Oct 06:37
· 62 commits to master since this release
v0.0.2
7901f00

Eliscript 0.0.2

This release completes the four-stage JavaScript self-hosted compiler fixed point (stage0 -> stage1 -> stage2 -> stage3), ships the multi-target backends emitting JavaScript ES modules, standalone WebAssembly binaries, and native ARM64 executables from a shared intermediate representation, and adds the standalone pure-browser hot-reload compiler (eliscript/browser/loader and eliscript/browser).

Install

npm install eliscript
npx eliscript --help

Requires Node >= 24.0.0 (or Bun >= 1.4.0). The published tarball (4.7 MB packed, 32.2 MB unpacked) carries the stage-3 self-hosted compiler (dist/bootstrap/compiler.mjs), the single-file browser compiler and hot-reload loader (dist/browser/compiler.js, dist/browser/loader.js), the runtime, the standard library, and the multi-target backend adapters, so consumers need neither Emacs nor a local bootstrap step.

For zero-build in-browser compilation and hot reload, load dist/browser/loader.js directly in HTML:

<script defer src="https://unpkg.com/eliscript@0.0.2/dist/browser/loader.js"
        data-eliscript="./app.eli"></script>

<script type="text/eliscript">
(module inline-app
  (import "eliscript/platform/browser" query set-text!)
  (let ((heading (query document "h1")))
    (when heading
      (set-text! heading "Compiled live in the browser"))))
</script>

What is in this release

  • Four-stage self-hosted compiler: Complete stage0 -> stage1 -> stage2 -> stage3 JavaScript self-hosting bootstrap chain (tools/backends/), where stage2 and stage3 produce byte-identical compiler artifacts across all 13 compiler modules (dist/stage3-release.json, dist/compiler-artifact.json).
  • Multi-target backends (JavaScript, WASM, Native ARM64): Shared portable compiler frontend (reader -> expander -> analyzer -> lower -> IR) with three backend code generators (bootstrap/backends/) emitting standard ES modules, standalone WebAssembly modules (.wasm), and native ARM64 executables (arm64-macos and arm64-linux) backed by the linear-memory managed runtime (bootstrap/runtime/).
  • Pure browser hot-reload compiler: Single-file browser compiler bundle (eliscript/browser/compiler, 367 KB minified), in-memory compile host (eliscript/browser exporting createEliscriptHost, runSource, and mountEliscriptScripts), module worker (eliscript/browser/worker.mjs), and standalone <script> hot-reload loader (eliscript/browser/loader, 101 KB minified) that compiles inline <script type="text/eliscript">, external <script type="text/eliscript" src="...">, and data-eliscript="..." attributes directly in the browser via Blob ESM URLs.
  • Language: Modules with import and export; defmacro with gensym and source-location preservation; defprotocol, defrecord, and deftype; defmulti / defmethod; multi-arity functions; destructuring; loop / recur and general automatic tail-call optimization; cond, case, try / catch / finally, async / await; and JavaScript interop (js-call, js-get, js-set!, js-new, js-obj, js-array).
  • Data: Persistent lists, HAMT maps and sets, persistent vectors and queues, transient builders, structural equality and hashing, metadata, zippers, tree walk, sorted collections, lazy sequences, and transducers.
  • Runtime: Host-free runtime (runtime/) and 30 standard-library modules (stdlib/*), with explicit capability packages (platform/browser, platform/worker, platform/http).
  • Emacs integration & CLI: eliscript-mode and eliscript-repl in editor/, backed by a persistent framing worker (tools/worker/); command-line entry points eliscript, eliscript-build, eliscript-check, eliscript-format, eliscript-eval, eliscript-watch, and eliscript-compiler.

Evidence

  • All 35 core acceptance criteria (AC-01 through AC-35) are Accepted at 100.0% (contracts/acceptance-criteria.json).
  • Four-stage JavaScript self-hosting fixed point (stage0 -> stage1 -> stage2 -> stage3) verified with byte-identical stage2 and stage3 product closures.
  • Clean consumer package installation (tests/release-package-install-selfhosted.test.mjs) verified across shared three-output user programs (javascript, wasm, and native) using the packaged stage3 CLI and installed runtimes.
  • Documentation site, API index, specifications, and interactive browser playground published at https://liuchong.org/eliscript/ and compiled live in the browser via docs/pages/loader.eli.

Known gaps

  • All compiler hosts in 0.0.2 are JavaScript (node, bun, and browser); self-hosted standalone WASM and native compiler binary hosts are outside 0.0.2.
  • Deep 12,000-step persistent zipper stress on standalone WASM and native binary targets remains performance-unqualified in 0.0.2; functional verification uses the bounded small runtime profile (STAGE3_FUNCTIONAL_RUNTIME_PROFILE=small) with performance acceptance explicitly deferred (ELISCRIPT_DEFER_PERFORMANCE_ACCEPTANCE=1).
  • linux-x64 compatibility cells in contracts/compatibility-matrix.json remain optional.
  • Proving-ground application specs (specs/10 through specs/14) remain In progress.

License

GPL-3.0-or-later. See LICENSE.