Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
29b3e65
more triple madness
toshok Oct 8, 2023
bd8a1af
a bunch of runtime clang analyze fixes
toshok Oct 8, 2023
2107e33
more build cruft
toshok Oct 9, 2023
4bbb0e2
lots of build system/triple work
toshok Oct 9, 2023
fe98549
rename build -> mk
toshok Oct 15, 2023
f0ac5fd
add buck2 build system covering the full bootstrap
toshok Jul 7, 2026
165a425
fix three self-hosting miscompiles that broke the stage2 bootstrap
toshok Jul 7, 2026
d60dd53
modernize the llvm dependency: 16.0.6 -> 22.1.8
toshok Jul 7, 2026
b8c7f32
fix conservative GC holes that corrupted the self-hosted compiler
toshok Jul 7, 2026
9e47487
set target triple and datalayout on emitted llvm modules
toshok Jul 7, 2026
0192338
fix parseInt int32 overflow and uint32 conversion of negative doubles
toshok Jul 7, 2026
a16a6a2
fix destructuring in for-of heads
toshok Jul 7, 2026
987e732
fix generator crash on arm64: don't pass a pointer through makecontext
toshok Jul 7, 2026
1b1404d
add //:test-stage{1,2,3} targets that run the test suite via buck2
toshok Jul 7, 2026
bf39a1c
remove the gnumake build system; buck2 covers everything now
toshok Jul 7, 2026
689cf97
add EIRProposal.md: SSA IR to replace the AST+intrinsics middle-end
toshok Jul 7, 2026
ef1a6ad
EIR phase 1: IR core, Braun SSA builder, printer, verifier + lowering…
toshok Jul 7, 2026
a4cd215
EIR: scope analysis, closures/environments, try/catch, loop control flow
toshok Jul 7, 2026
edd64c7
EIR->LLVM emitter behind --ir, with per-function fallback
toshok Jul 8, 2026
0465769
EIR: module-scope interop + self-hosted --ir (ejs-llvm phi support)
toshok Jul 8, 2026
c861e2e
fix two legacy middle-end bugs found while self-hosting the eir sources
toshok Jul 8, 2026
6abd132
eir: module-level interop + broader --ir candidates
toshok Jul 8, 2026
ae6de55
eir: switch, for-of, templates, arrows, update/compound assignment, d…
toshok Jul 8, 2026
d4eda7b
eir: for-in, rest params, regex literals, exported fns as values
toshok Jul 8, 2026
9b95058
eir: namespace/default imports + a let-init scoping fix + --ir bootst…
toshok Jul 9, 2026
776ed27
eir: promote module vars to hidden slots; fix try/finally exception s…
toshok Jul 9, 2026
7366e39
eir: promote function declarations; self-references resolve via slots
toshok Jul 9, 2026
935112a
eir: class promotion, arguments object, object-pattern declarations
toshok Jul 9, 2026
8648a96
eir: try/finally via finalizer duplication
toshok Jul 10, 2026
0cbca71
eir: %-intrinsic lowering + DesugarSpread pre-EIR (phase 2 start)
toshok Jul 10, 2026
3bdbb49
eir: per-iteration loop environments; fix legacy for-in let capture
toshok Jul 10, 2026
e2e7720
eir: classes pre-EIR — construct_super/new_target ops, three class bu…
toshok Jul 10, 2026
ee3f983
eir: generators pre-EIR (coroutine-style); fix class generator methods
toshok Jul 10, 2026
99ada96
eir: destructuring pre-EIR; pattern defaults work now
toshok Jul 10, 2026
1bcc3f4
eir: defaults/rest stay legacy-only (evaluated, documented)
toshok Jul 10, 2026
bb6f22e
eir: arrow lexical `this` natively; fix two legacy arrow-this bugs
toshok Jul 10, 2026
26c4323
eir: toplevel-as-EIR behind --ir-toplevel (phase 3 foundation)
toshok Jul 10, 2026
acf4beb
eir: --dump-after; `--dump-after eir` prints the lowered EIR module
toshok Jul 10, 2026
324a0f8
docs: plans.md — legacy-pipeline removal, optimizations, TypeScript
toshok Jul 10, 2026
afec6e9
eir: HoistFuncDecls pre-EIR; fix fn-scope forward references
toshok Jul 10, 2026
e013171
eir: labeled statements natively; fix legacy labeled-exit label loss
toshok Jul 10, 2026
54079bc
eir: object-literal accessors natively; fix legacy get/set pair loss
toshok Jul 10, 2026
705a4a9
eir+legacy: new Foo(...args) via %constructApply (never compiled before)
toshok Jul 10, 2026
322932d
eir: tagged template literals natively (template_callsite)
toshok Jul 10, 2026
1df185e
eir: flip the default — EIR is the pipeline, --legacy for one release
toshok Jul 10, 2026
ed5f237
eir: the pipeline stands alone — no legacy fallback, gaps closed
toshok Jul 10, 2026
31c4f12
eir: delete the legacy middle-end
toshok Jul 10, 2026
6c929b2
eir: mop-up after the deletion; computed accessor keys lower natively
toshok Jul 10, 2026
9bca473
docs: JS modernization census (34 probes) + plans update
toshok Jul 10, 2026
6f850c0
fix the four behavioral bugs from the modernization census
toshok Jul 10, 2026
101cc56
ts: build plumbing + first ports (debug, errors, stack)
toshok Jul 10, 2026
dd8d97e
ts: estree types, ast-builder, common-ids, echo-util; @llvm/@node-com…
toshok Jul 10, 2026
1fa6f67
ts: the EIR core — ops, intrinsics, errors, ir, builder, printer, ver…
toshok Jul 10, 2026
a9b495b
ts: types, consts, abi, sret-abi, triple, module-info
toshok Jul 10, 2026
49abfae
ts: node-visitor — typed dispatch over the estree unions
toshok Jul 10, 2026
c0219f0
fix: the arguments object choked on symbol keys (latent bug #28)
toshok Jul 10, 2026
2938bb6
ts: desugar passes — metaproperties, spread, generator-functions
toshok Jul 11, 2026
d6790bf
ts: desugar-destructuring
toshok Jul 11, 2026
6ac3027
ts: desugar-classes
toshok Jul 11, 2026
3e244e0
ts: desugar driver, gather-imports; vendored-dependency declarations
toshok Jul 11, 2026
2588c1f
ts: runtime — the C-runtime interface table, fully key-typed
toshok Jul 11, 2026
3f085f7
ts: eir/scopes — the scope analysis, fully typed
toshok Jul 11, 2026
4173a42
ts: eir/lower — AST-to-EIR lowering, fully typed
toshok Jul 11, 2026
6cda66e
ts: eir/integrate — module collection and accessor synthesis
toshok Jul 11, 2026
b6ed203
ts: eir/emit — EIR-to-LLVM emission
toshok Jul 11, 2026
5b8ff94
ts: compiler — the module scaffolding, implementing VisitorSurface
toshok Jul 11, 2026
5530b8a
ts: track the vendored-dependency declarations in the parent repo
toshok Jul 11, 2026
5d387b3
ts: the driver (ejs-es6) — and the --target presets were broken
toshok Jul 11, 2026
0b9a56a
ts: eir/tests — the unit suite
toshok Jul 11, 2026
aff8ba3
ts: the vendor declarations live in their submodules now
toshok Jul 11, 2026
0977de2
ci: GitHub Actions — the buck2 bootstrap matrix on macOS arm64
toshok Jul 11, 2026
b601626
linux: the full bootstrap matrix runs on aarch64-linux
toshok Jul 11, 2026
b286494
ci: matrix the linux bootstrap over arm64/x86_64; bootstrap-$os-$arch…
toshok Jul 11, 2026
0fd8196
ci: buck2 isn't in homebrew core — install the release binary on macOS
toshok Jul 11, 2026
1701f7a
eir: allocation sinking for object/array literals + effects-driven DCE
toshok Jul 11, 2026
41dccc8
eir: direct IIFE inlining + env scalar replacement
toshok Jul 11, 2026
c336273
eir: dump the as-lowered module before the optimizer mutates it
toshok Jul 11, 2026
a45bc8a
eir: state precisely what the swap-idiom optimization achieves
toshok Jul 11, 2026
b4682b1
eir: fold the iterator-protocol walk over dense array literals
toshok Jul 11, 2026
5f35097
eir: EJS_NO_EIR_OPT hook; allocation-lean use tracking in the optimizer
toshok Jul 11, 2026
a48957f
eir: add echojs-maam submodule + MAAM integration plan
toshok Jul 11, 2026
d3e3fd1
eir: Phase 0 --types probe: maam analysis adapter, stats only
toshok Jul 11, 2026
3e71ad4
eir: Phase 0 measurement results; P0 done, P1 rescoped accordingly
toshok Jul 19, 2026
d917a27
eir: Phase 1 re-measurement closes the convergence question: outcome (a)
toshok Jul 21, 2026
2ca1698
eir: TypeOracle + --types-dump; Phase 1 complete
toshok Jul 21, 2026
5ab6793
eir: Phase 2 -- the low tier: has_tag/unbox_f64/box_f64/f64_* emit + …
toshok Jul 22, 2026
568efc7
eir: Phase 3 lowering -- oracle-guided guarded arithmetic diamonds
toshok Jul 22, 2026
5093e1d
eir: Phase 3 gates -- the --types diff lane, test/types probes, bench…
toshok Jul 22, 2026
e4c4001
eir: go straight to bitcode -- drop the textual IR round-trips
toshok Jul 22, 2026
51441e3
maam-plan: add Phase 3.6 -- typed calling convention / specialization
toshok Jul 22, 2026
d16d383
maam-plan: split P3.4 pre-work out; exports are never specialized
toshok Jul 22, 2026
08cf388
gc-plan: mostly-copying generational collector -- the design doc
toshok Jul 23, 2026
134ed67
gc-plan: rewrite as a compiler/runtime co-design
toshok Jul 23, 2026
458a1fd
eir: Phase 3.4 -- dominated-guard elimination, region merging, raw f6…
toshok Jul 23, 2026
4ef1e28
eir: P3.4 review fixes -- j1 exhaustiveness + generic-twin verification
toshok Jul 23, 2026
5611b0d
eir: P3.4 review round 2 -- symmetric twin verification for region1
toshok Jul 23, 2026
106d835
eir: P3.4 review round 3 -- Object.is const correspondence
toshok Jul 23, 2026
10959e9
eir: bump echojs-maam -- P3.5 differential harness + exact concrete i…
toshok Jul 23, 2026
3430bb1
eir: bump echojs-maam -- P3.5 review round 2 (capture generalized to …
toshok Jul 23, 2026
b193e2a
eir: bump echojs-maam -- P3.5 nits: pattern-leaf capture accounting +…
toshok Jul 23, 2026
63379bc
eir: bump echojs-maam -- P3.5 round 4: binding-split re-declarations …
toshok Jul 23, 2026
5978a4e
eir: P3.6 typed calling convention / function specialization
toshok Jul 24, 2026
f0a5ca3
eir: P3.6 clones drop the dead env argument (signature = formals alone)
toshok Jul 24, 2026
c0bad46
eir: P4.0 shapes design doc (docs/shapes-plan.md)
toshok Jul 24, 2026
94a6627
eir: P4.1 runtime shape tracking, dual bookkeeping + 64-bit header (j…
toshok Jul 24, 2026
c0c35e2
eir: spawn llvm tools from the built-against bindir; fail loudly on t…
toshok Jul 24, 2026
aa5a570
eir: P4.2 slot storage for shaped objects (union flip + GC lessons)
toshok Jul 24, 2026
fd9cd3b
eir: P4.3 shape-guarded property fast paths under --types (types-benc…
toshok Jul 24, 2026
2b84ef6
eir: P4.4 born-with-shape under --types (types-bench2 3.3x total)
toshok Jul 24, 2026
fa7707e
eir: P4.5 typed slots + shape/numeric region fusion under --types
toshok Jul 24, 2026
bf8bbd0
eir: P4.6 measured extensions — 2-way poly guard chains land, rest ev…
toshok Jul 25, 2026
338be75
eir: gc-P0 — generator-scan fixes, GC profiling, runtime -O2 (self-co…
toshok Jul 25, 2026
46fa47e
eir: gc-P1 — forwarding plumbing (header half landed with shapes P4.1)
toshok Jul 25, 2026
541d5ba
eir: gc-P2 generational nursery — default ON (bench2 0.64s, envbench …
toshok Jul 25, 2026
78d5809
eir: sinking-plan S1 — shaped-literal allocation sinking
toshok Jul 25, 2026
0e50ae7
eir: gc-P3 — emitter gc-frames: precise, relocatable JS-frame roots
toshok Jul 25, 2026
7ef542a
docs: plans.md becomes the program spine; buckets renumbered; plan id…
toshok Jul 25, 2026
9c5e24b
eir: sinking-P2 — epoch-guarded constructor-result sinking
toshok Jul 26, 2026
15896f6
eir: sinking-P3 — flow-sensitive field writes, partial escapes, args …
toshok Jul 26, 2026
331382f
eir: gc-P4 (P6.1) — mostly-copying major compaction; pin-scan cliff k…
toshok Jul 26, 2026
d48cf69
eir: compiler-P1 (P5.4) — optimizer residue: SSA cleanups, type latti…
toshok Jul 28, 2026
8e92342
docs: compiler-P5 pass-configuration ergonomics phase; P7.5 in the spine
toshok Jul 29, 2026
acd3ccd
eir: gc-P5 (P6.2) part 1 — single-cell shaped objects: embedded slots…
toshok Jul 29, 2026
8e85813
eir: gc-P5 (P6.2) part 2 — flag-off born-shaped literals; 256-byte si…
toshok Jul 29, 2026
e586583
test: gc5stress1 — gc-P5 embedded-slot stress probe joins the suite
toshok Jul 29, 2026
511b060
eir: runtime-P4 (P6.3) part 1 — cell lifecycle in one block; explicit…
toshok Jul 29, 2026
039eb2f
eir: runtime-P4 (P6.3) part 2 — root registry; one collection-policy …
toshok Jul 29, 2026
6591e9a
eir: runtime-P4 (P6.3) part 3 — the file split; two stack-luck hazard…
toshok Jul 29, 2026
e86b4f0
docs: runtime-P4 (P6.3) phase record; P6 closed; compiler-P1.1 pinned
toshok Jul 29, 2026
60bc677
eir: runtime-P1 (P7.1) — the pinned-bug burn-down; all ten fixed
toshok Jul 29, 2026
b1736f8
eir: runtime-P2 (P7.2) — export-boundary wrapper + escape-taint fence
toshok Jul 29, 2026
d28e85c
eir: runtime-P3 (P7.3) — the value-based test harness; node unpinned
toshok Jul 29, 2026
3c252f9
eir: compiler-P2 (P7.4) — the TypeScript port, finished; babel removed
toshok Jul 30, 2026
2065d8a
eir: compiler-P5 (P7.5) — clang-style pass configuration
toshok Jul 30, 2026
9e5ac52
eir: compiler-P1.1 — the test-eir pin burn-down; no optimizer gap
toshok Jul 30, 2026
4ea98df
eir: release-P1 (P9.1) — relocatable dist artifact + LLVM toolchain p…
toshok Jul 30, 2026
168ca1f
eir: release-P1 follow-on — silence the hardcoded exception spew
toshok Jul 30, 2026
48a622e
eir: release-P2 (P9.2) — platform packages on the dist tarball
toshok Jul 30, 2026
1de4f5a
eir: release-P3 (P9.3) — versioning + release automation off the matrix
toshok Jul 30, 2026
119f107
eir: npm wrapper is @pirouette/echojs (the @pirouette org)
toshok Jul 30, 2026
1e5b639
eir: npm publishes via OIDC trusted publishing — no npm token
toshok Jul 30, 2026
13eb58c
eir: version 0.2.0 — the 2016 era already released 0.1.0
toshok Jul 30, 2026
649c563
eir: fix the platform CI reds — remset type + the ignored npm shim
toshok Jul 30, 2026
5200b25
eir: the rest of the CI fix — remset type + gitignore anchor
toshok Jul 30, 2026
9f24846
eir: never publish uninitialized dense array elements — the linux sta…
toshok Jul 31, 2026
d4b4453
eir: install buck2 via dtolnay/install-buck2
toshok Jul 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 0 additions & 8 deletions .babelrc

This file was deleted.

23 changes: 23 additions & 0 deletions .buckconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[repositories]
root = .
prelude = prelude
toolchains = toolchains
none = none

[repository_aliases]
config = prelude
ovr_config = prelude
fbcode = none
fbsource = none
fbcode_macros = none
buck = none

[parser]
target_platform_detector_spec = target:root//...->prelude//platforms:default

[project]
ignore = .git

[llvm]
prefix = /opt/homebrew/opt/llvm
suffix =
File renamed without changes.
149 changes: 0 additions & 149 deletions .circleci/config.yml

This file was deleted.

199 changes: 199 additions & 0 deletions .github/workflows/bootstrap.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,199 @@
# The full buck2 bootstrap matrix, as a reusable workflow: ci.yml runs
# it on every push/PR, release.yml runs the SAME jobs on a version tag
# (release-P3's "a release is a green matrix" is literal — one
# definition, two callers).
#
# Per platform (macOS arm64, Linux arm64/x86_64), sequential targets —
# buck2 shares artifacts between them, so the stage ladder (stage1
# builds feed stage2/3) costs one traversal:
#
# test-eir EIR unit tests (node-hosted)
# test-stage0 full suite against the node-hosted compiler
# test-stage1 suite against the self-compiled compiler
# test-stage2 suite against stage1's self-compile
# test-stage3 suite + the stage2/stage3 byte-identity fixed point
#
# then the dist tarball + its smoke tests (release-P1) and the package
# smokes (release-P2), uploading echojs-dist-<platform> artifacts.
name: bootstrap

on:
workflow_call:

jobs:
bootstrap-macos-arm64:
name: bootstrap-macos-arm64
runs-on: macos-15 # arm64
timeout-minutes: 120
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install llvm
run: |
brew install llvm
"$(brew --prefix llvm)/bin/llvm-config" --version

# the facebook/buck2 `latest` release binary, same as before —
# the action just owns the platform selection and unpacking
- uses: dtolnay/install-buck2@latest
- run: buck2 --version

# unpinned (runtime-P3): the value-based harness serializes logged
# values itself (test/harness-console-shim.js) on both the node and
# ejs sides, so baselines no longer depend on node's inspect format
# (verified: 22.4.0 and 22.23.2 generate byte-identical baselines)
- uses: actions/setup-node@v4
with:
node-version: 22.x

- name: npm ci
run: npm ci

# the node-hosted (stage0) compiler drives llvm through this
# node-gyp native addon; buck picks up the built artifact
- name: Build the node-llvm addon
run: ./node-llvm/build-addon.sh "$(brew --prefix llvm)"

- name: TypeScript typecheck
run: |
node node_modules/typescript/bin/tsc -p tsconfig.json
node node_modules/typescript/bin/tsc -p test --noEmit

- name: buck2 bootstrap matrix
run: |
buck2 build \
//:test-eir \
//:test-stage0 \
//:test-stage1 \
//:test-stage2 \
//:test-stage3

# the relocatable dist artifact + its installed-layout smoke test
# (release-P1); the stage builds above are shared, so this only
# adds the repack + smoke compile
- name: dist artifact
run: |
buck2 build //:test-dist
buck2 build //:dist --out dist-out/

- uses: actions/upload-artifact@v4
with:
name: echojs-dist-macos-arm64
path: dist-out/*.tar.gz
if-no-files-found: error

# release-P2 package smokes. The formula comes from the tarball
# just built (file:// url) via a throwaway local tap; the npm
# wrapper installs through its EJS_NPM_TARBALL override.
# release-P3 points both at hosted release assets instead.
- name: package smoke (homebrew + npm)
run: |
brew tap-new --no-git toshok/echojs-ci
./packaging/homebrew/make-formula.sh \
--tarball dist-out/echojs-*.tar.gz \
--out "$(brew --repository)/Library/Taps/toshok/homebrew-echojs-ci/Formula/echojs.rb"
brew install toshok/echojs-ci/echojs
echo 'console.log(`ok ${[1,2].map((x) => x + 1).join("")}`)' > "$RUNNER_TEMP/smoke.js"
"$(brew --prefix)/bin/ejs" -q -o "$RUNNER_TEMP/smoke.exe" "$RUNNER_TEMP/smoke.js"
test "$("$RUNNER_TEMP/smoke.exe")" = "ok 23"
brew test echojs
brew uninstall echojs

cd "$RUNNER_TEMP"
npm pack "$GITHUB_WORKSPACE/packaging/npm"
mkdir npm-smoke && cd npm-smoke
npm init -y > /dev/null
EJS_NPM_TARBALL="$(echo "$GITHUB_WORKSPACE"/dist-out/echojs-*.tar.gz)" \
npm install --no-fund --no-audit ../pirouette-echojs-*.tgz
./node_modules/.bin/ejs -q -o smoke.exe ../smoke.js
test "$(./smoke.exe)" = "ok 23"

- name: Surface test logs on failure
if: failure()
run: |
find buck-out/v2 -name "test-*.log" -newer package.json 2>/dev/null | while read -r f; do
echo "=== $f ==="
tail -60 "$f"
done || true

bootstrap-linux:
name: bootstrap-linux-${{ matrix.arch }}
runs-on: ${{ matrix.runner }}
timeout-minutes: 150
strategy:
fail-fast: false
matrix:
include:
- arch: arm64
runner: ubuntu-24.04-arm
- arch: x86_64
runner: ubuntu-24.04
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install packages
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq build-essential cmake libunwind-dev libuv1-dev

- name: Install llvm 22
run: |
curl -sSf https://apt.llvm.org/llvm.sh -o /tmp/llvm.sh
chmod +x /tmp/llvm.sh
sudo /tmp/llvm.sh 22
/usr/lib/llvm-22/bin/llvm-config --version
# prelude's cxx toolchain wants a bare clang++ on PATH
echo "/usr/lib/llvm-22/bin" >> "$GITHUB_PATH"

- uses: dtolnay/install-buck2@latest
- run: buck2 --version

# unpinned (runtime-P3) — see the macOS job's note
- uses: actions/setup-node@v4
with:
node-version: 22.x

- name: npm ci
run: npm ci

- name: Build the node-llvm addon
run: ./node-llvm/build-addon.sh /usr/lib/llvm-22

- name: buck2 bootstrap matrix
run: |
buck2 build --config llvm.prefix=/usr/lib/llvm-22 \
//:test-eir \
//:test-stage0 \
//:test-stage1 \
//:test-stage2 \
//:test-stage3

# release-P1 — see the macOS job's note
- name: dist artifact
run: |
buck2 build --config llvm.prefix=/usr/lib/llvm-22 //:test-dist
buck2 build --config llvm.prefix=/usr/lib/llvm-22 //:dist --out dist-out/

- uses: actions/upload-artifact@v4
with:
name: echojs-dist-linux-${{ matrix.arch }}
path: dist-out/*.tar.gz
if-no-files-found: error

# release-P2 — the npm wrapper against the tarball just built
# (the prefix installer is smoke-tested inside //:test-dist)
- name: package smoke (npm)
run: |
cd "$RUNNER_TEMP"
npm pack "$GITHUB_WORKSPACE/packaging/npm"
mkdir npm-smoke && cd npm-smoke
npm init -y > /dev/null
EJS_NPM_TARBALL="$(echo "$GITHUB_WORKSPACE"/dist-out/echojs-*.tar.gz)" \
npm install --no-fund --no-audit ../pirouette-echojs-*.tgz
echo 'console.log(`ok ${[1,2].map((x) => x + 1).join("")}`)' > smoke.js
./node_modules/.bin/ejs -q -o smoke.exe smoke.js
test "$(./smoke.exe)" = "ok 23"
Loading
Loading