Repository navigation
Eliscript 0.0.2
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 --helpRequires 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 -> stage3JavaScript self-hosting bootstrap chain (tools/backends/), wherestage2andstage3produce 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-macosandarm64-linux) backed by the linear-memory managed runtime (bootstrap/runtime/). - Pure browser hot-reload compiler: Single-file browser compiler bundle (
eliscript/browser/compiler,367 KBminified), in-memory compile host (eliscript/browserexportingcreateEliscriptHost,runSource, andmountEliscriptScripts), module worker (eliscript/browser/worker.mjs), and standalone<script>hot-reload loader (eliscript/browser/loader,101 KBminified) that compiles inline<script type="text/eliscript">, external<script type="text/eliscript" src="...">, anddata-eliscript="..."attributes directly in the browser via Blob ESM URLs. - Language: Modules with
importandexport;defmacrowithgensymand source-location preservation;defprotocol,defrecord, anddeftype;defmulti/defmethod; multi-arity functions; destructuring;loop/recurand 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-modeandeliscript-replineditor/, backed by a persistent framing worker (tools/worker/); command-line entry pointseliscript,eliscript-build,eliscript-check,eliscript-format,eliscript-eval,eliscript-watch, andeliscript-compiler.
Evidence
- All 35 core acceptance criteria (
AC-01throughAC-35) areAcceptedat100.0%(contracts/acceptance-criteria.json). - Four-stage JavaScript self-hosting fixed point (
stage0 -> stage1 -> stage2 -> stage3) verified with byte-identicalstage2andstage3product closures. - Clean consumer package installation (
tests/release-package-install-selfhosted.test.mjs) verified across shared three-output user programs (javascript,wasm, andnative) using the packagedstage3CLI 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.2are JavaScript (node,bun, and browser); self-hosted standalone WASM and native compiler binary hosts are outside0.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-x64compatibility cells incontracts/compatibility-matrix.jsonremain optional.- Proving-ground application specs (
specs/10throughspecs/14) remainIn progress.
License
GPL-3.0-or-later. See LICENSE.