eliscript 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/bootstrap/README.md +26 -0
- package/bootstrap/backends/README.md +515 -0
- package/bootstrap/backends/async.eli +230 -0
- package/bootstrap/backends/binary.eli +173 -0
- package/bootstrap/backends/capabilities.eli +74 -0
- package/bootstrap/backends/elf.eli +246 -0
- package/bootstrap/backends/managed.eli +5976 -0
- package/bootstrap/backends/memory.eli +100 -0
- package/bootstrap/backends/native.eli +2000 -0
- package/bootstrap/backends/numeric.eli +1362 -0
- package/bootstrap/backends/optimize.eli +79 -0
- package/bootstrap/backends/regexp.eli +2263 -0
- package/bootstrap/backends/sha256.eli +138 -0
- package/bootstrap/backends/wasm.eli +1161 -0
- package/bootstrap/compiler/analyzer.eli +165 -77
- package/bootstrap/compiler/compiler.eli +43 -19
- package/bootstrap/compiler/emitter.eli +780 -170
- package/bootstrap/compiler/expander.eli +136 -45
- package/bootstrap/compiler/formatter.eli +8 -1
- package/bootstrap/compiler/ir.eli +148 -45
- package/bootstrap/compiler/lower.eli +29 -2
- package/bootstrap/compiler/project.eli +51 -21
- package/bootstrap/compiler/reader.eli +128 -36
- package/bootstrap/compiler/source-map.eli +46 -4
- package/bootstrap/compiler/symbol.eli +2 -1
- package/bootstrap/compiler/syntax.eli +47 -12
- package/bootstrap/compiler/transient-analysis.eli +40 -4
- package/bootstrap/host/check-cli-legacy.mjs +163 -0
- package/bootstrap/host/check-cli.mjs +59 -158
- package/bootstrap/host/check-cli.mjs.map +1 -0
- package/bootstrap/host/compiler-session.eli +1579 -0
- package/bootstrap/host/compiler-tools.eli +513 -0
- package/bootstrap/host/eliscript-cli-legacy.mjs +37 -0
- package/bootstrap/host/eliscript-cli.mjs +53 -33
- package/bootstrap/host/eliscript-cli.mjs.map +1 -0
- package/bootstrap/host/project-cli-legacy.mjs +295 -0
- package/bootstrap/host/project-cli.mjs +74 -289
- package/bootstrap/host/project-cli.mjs.map +1 -0
- package/bootstrap/host/project-legacy.mjs +1080 -0
- package/bootstrap/host/project.mjs +210 -1060
- package/bootstrap/host/project.mjs.map +1 -0
- package/bootstrap/runtime/UNICODE-LICENSE.txt +39 -0
- package/bootstrap/runtime/memory.eli +30379 -0
- package/browser/host.mjs +89 -0
- package/compiler/eliscript-analyzer.el +371 -4
- package/compiler/eliscript-cli.el +84 -1
- package/compiler/eliscript-emitter.el +1189 -256
- package/compiler/eliscript-expander.el +147 -10
- package/compiler/eliscript-ir-emitter.el +725 -208
- package/compiler/eliscript-lower.el +127 -1
- package/compiler/eliscript-portable.el +177 -51
- package/compiler/eliscript-project.el +20 -2
- package/compiler/eliscript-reader.el +141 -57
- package/compiler/eliscript-source-map.el +26 -12
- package/compiler/eliscript-transient-analysis.el +382 -19
- package/dist/backends/async.mjs +561 -0
- package/dist/backends/async.mjs.macro-origins.json +1 -0
- package/dist/backends/async.mjs.map +1 -0
- package/dist/backends/binary.mjs +381 -0
- package/dist/backends/binary.mjs.macro-origins.json +1 -0
- package/dist/backends/binary.mjs.map +1 -0
- package/dist/backends/capabilities.mjs +237 -0
- package/dist/backends/capabilities.mjs.macro-origins.json +1 -0
- package/dist/backends/capabilities.mjs.map +1 -0
- package/dist/backends/elf.mjs +540 -0
- package/dist/backends/elf.mjs.macro-origins.json +1 -0
- package/dist/backends/elf.mjs.map +1 -0
- package/dist/backends/managed.mjs +10616 -0
- package/dist/backends/managed.mjs.macro-origins.json +1 -0
- package/dist/backends/managed.mjs.map +1 -0
- package/dist/backends/memory.mjs +278 -0
- package/dist/backends/memory.mjs.macro-origins.json +1 -0
- package/dist/backends/memory.mjs.map +1 -0
- package/dist/backends/native.mjs +4099 -0
- package/dist/backends/native.mjs.macro-origins.json +1 -0
- package/dist/backends/native.mjs.map +1 -0
- package/dist/backends/numeric.mjs +2458 -0
- package/dist/backends/numeric.mjs.macro-origins.json +1 -0
- package/dist/backends/numeric.mjs.map +1 -0
- package/dist/backends/optimize.mjs +204 -0
- package/dist/backends/optimize.mjs.macro-origins.json +1 -0
- package/dist/backends/optimize.mjs.map +1 -0
- package/dist/backends/regexp.mjs +2033 -0
- package/dist/backends/regexp.mjs.macro-origins.json +1 -0
- package/dist/backends/regexp.mjs.map +1 -0
- package/dist/backends/sha256.mjs +310 -0
- package/dist/backends/sha256.mjs.macro-origins.json +1 -0
- package/dist/backends/sha256.mjs.map +1 -0
- package/dist/backends/wasm.mjs +2258 -0
- package/dist/backends/wasm.mjs.macro-origins.json +1 -0
- package/dist/backends/wasm.mjs.map +1 -0
- package/dist/bootstrap/analyzer.mjs +1908 -776
- package/dist/bootstrap/analyzer.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/analyzer.mjs.map +1 -1
- package/dist/bootstrap/compiler.mjs +450 -142
- package/dist/bootstrap/compiler.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/compiler.mjs.map +1 -1
- package/dist/bootstrap/emitter.mjs +3083 -909
- package/dist/bootstrap/emitter.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/emitter.mjs.map +1 -1
- package/dist/bootstrap/expander.mjs +2887 -1233
- package/dist/bootstrap/expander.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/expander.mjs.map +1 -1
- package/dist/bootstrap/formatter.mjs +582 -218
- package/dist/bootstrap/formatter.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/formatter.mjs.map +1 -1
- package/dist/bootstrap/ir.mjs +670 -116
- package/dist/bootstrap/ir.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/ir.mjs.map +1 -1
- package/dist/bootstrap/lower.mjs +866 -257
- package/dist/bootstrap/lower.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/lower.mjs.map +1 -1
- package/dist/bootstrap/package.json +1 -0
- package/dist/bootstrap/project.mjs +1168 -498
- package/dist/bootstrap/project.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/project.mjs.map +1 -1
- package/dist/bootstrap/reader.mjs +674 -175
- package/dist/bootstrap/reader.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/reader.mjs.map +1 -1
- package/dist/bootstrap/runtime/math.mjs +1117 -0
- package/dist/bootstrap/runtime/math.mjs.map +1 -0
- package/dist/bootstrap/runtime/unicode-case-data.mjs +10125 -0
- package/dist/bootstrap/runtime/unicode-case-data.mjs.map +1 -0
- package/dist/bootstrap/runtime/unicode-case.mjs +281 -0
- package/dist/bootstrap/runtime/unicode-case.mjs.map +1 -0
- package/dist/bootstrap/source-map.mjs +430 -119
- package/dist/bootstrap/source-map.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/source-map.mjs.map +1 -1
- package/dist/bootstrap/symbol.mjs +229 -53
- package/dist/bootstrap/symbol.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/symbol.mjs.map +1 -1
- package/dist/bootstrap/syntax.mjs +205 -7
- package/dist/bootstrap/syntax.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/syntax.mjs.map +1 -1
- package/dist/bootstrap/transient-analysis.mjs +1185 -489
- package/dist/bootstrap/transient-analysis.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/transient-analysis.mjs.map +1 -1
- package/dist/browser/compiler.js +199 -6478
- package/dist/browser/host.mjs +446 -0
- package/dist/browser/loader.js +1 -0
- package/dist/browser/loader.mjs +231 -0
- package/dist/browser/worker.mjs +60 -0
- package/dist/compiler-artifact.json +1 -0
- package/dist/host/compiler-session.mjs +2980 -0
- package/dist/host/compiler-session.mjs.macro-origins.json +1 -0
- package/dist/host/compiler-session.mjs.map +1 -0
- package/dist/host/compiler-tools.mjs +1084 -0
- package/dist/host/compiler-tools.mjs.macro-origins.json +1 -0
- package/dist/host/compiler-tools.mjs.map +1 -0
- package/dist/literal-sources/runtime/core/collection-internals.eli +60 -0
- package/dist/literal-sources/runtime/core/collection.eli +579 -0
- package/dist/literal-sources/runtime/core/data-text.eli +290 -0
- package/dist/literal-sources/runtime/core/data.eli +22 -0
- package/dist/literal-sources/runtime/core/identifier.eli +44 -0
- package/dist/literal-sources/runtime/core/lazy-sequence.eli +131 -0
- package/dist/literal-sources/runtime/core/list.eli +19 -0
- package/dist/literal-sources/runtime/core/map.eli +9 -0
- package/dist/literal-sources/runtime/core/metadata-internals.eli +6 -0
- package/dist/literal-sources/runtime/core/metadata.eli +23 -0
- package/dist/literal-sources/runtime/core/object.eli +8 -0
- package/dist/literal-sources/runtime/core/order.eli +123 -0
- package/dist/literal-sources/runtime/core/persistent-kind.eli +28 -0
- package/dist/literal-sources/runtime/core/protocol-error.eli +32 -0
- package/dist/literal-sources/runtime/core/protocol.eli +28 -0
- package/dist/literal-sources/runtime/core/queue.eli +9 -0
- package/dist/literal-sources/runtime/core/record.eli +191 -0
- package/dist/literal-sources/runtime/core/regex.eli +158 -0
- package/dist/literal-sources/runtime/core/sequence.eli +305 -0
- package/dist/literal-sources/runtime/core/set-algebra.eli +28 -0
- package/dist/literal-sources/runtime/core/set.eli +9 -0
- package/dist/literal-sources/runtime/core/sorted.eli +408 -0
- package/dist/literal-sources/runtime/core/text.eli +14 -0
- package/dist/literal-sources/runtime/core/transducer.eli +268 -0
- package/dist/literal-sources/runtime/core/transient.eli +17 -0
- package/dist/literal-sources/runtime/core/truth.eli +4 -0
- package/dist/literal-sources/runtime/core/type.eli +232 -0
- package/dist/literal-sources/runtime/core/value-internals.eli +13 -0
- package/dist/literal-sources/runtime/core/value.eli +19 -0
- package/dist/literal-sources/runtime/core/vector.eli +20 -0
- package/dist/literal-sources/runtime/literals.eli +23 -0
- package/dist/literal-sources/runtime/testing/value.eli +6 -0
- package/dist/literal-sources/runtime/wire/http-rpc.eli +362 -0
- package/dist/literal-sources/runtime/wire/markdown.eli +275 -0
- package/dist/literal-sources/runtime/wire/schema.eli +193 -0
- package/dist/literal-sources/stdlib/bit.eli +36 -0
- package/dist/literal-sources/stdlib/core/data.eli +306 -0
- package/dist/literal-sources/stdlib/core/object.eli +89 -0
- package/dist/literal-sources/stdlib/core/protocol.eli +451 -0
- package/dist/literal-sources/stdlib/core/set.eli +312 -0
- package/dist/literal-sources/stdlib/core/text.eli +103 -0
- package/dist/literal-sources/stdlib/managed-literal-protocols.eli +483 -0
- package/dist/literal-sources/stdlib/managed-literals.eli +1414 -0
- package/dist/literal-sources/stdlib/managed-queue-state.eli +65 -0
- package/dist/literal-sources/stdlib/managed-sorted-state.eli +233 -0
- package/dist/literal-sources/stdlib/managed-transient-state.eli +348 -0
- package/dist/literal-sources/stdlib/managed-value-state.eli +153 -0
- package/dist/literal-sources/stdlib/managed-vector-view-state.eli +102 -0
- package/dist/literal-sources/stdlib/persistent-list.eli +145 -0
- package/dist/literal-sources/stdlib/persistent-map.eli +724 -0
- package/dist/literal-sources/stdlib/persistent-set.eli +236 -0
- package/dist/literal-sources/stdlib/persistent-vector.eli +359 -0
- package/dist/literal-sources/stdlib/value.eli +325 -0
- package/dist/package.json +10 -0
- package/dist/runtime/math.mjs +1116 -0
- package/dist/runtime/math.mjs.macro-origins.json +1 -0
- package/dist/runtime/math.mjs.map +1 -0
- package/dist/runtime/unicode-case-data.mjs +10124 -0
- package/dist/runtime/unicode-case-data.mjs.macro-origins.json +1 -0
- package/dist/runtime/unicode-case-data.mjs.map +1 -0
- package/dist/runtime/unicode-case.mjs +280 -0
- package/dist/runtime/unicode-case.mjs.macro-origins.json +1 -0
- package/dist/runtime/unicode-case.mjs.map +1 -0
- package/dist/runtime.eli +30379 -0
- package/dist/stage3-release.json +1 -0
- package/editor/README.md +1 -1
- package/editor/eliscript-mode.el +1 -1
- package/editor/eliscript-repl.el +1 -1
- package/package.json +97 -10
- package/platform/http.mjs +20 -0
- package/runtime/array-text.mjs +159 -0
- package/runtime/core/map-internals.mjs +27 -9
- package/runtime/core/object-impl.mjs +26 -17
- package/runtime/core/object-impl.mjs.map +1 -1
- package/runtime/core/protocol-impl.mjs +682 -255
- package/runtime/core/protocol-impl.mjs.map +1 -1
- package/runtime/core/protocol.mjs +4 -0
- package/runtime/core/record.mjs +23 -2
- package/runtime/core/regex.mjs +4 -0
- package/runtime/core/sorted.mjs +53 -0
- package/runtime/core/text-impl.mjs +167 -48
- package/runtime/core/text-impl.mjs.map +1 -1
- package/runtime/core/type.mjs +75 -3
- package/runtime/core/vector.mjs +6 -0
- package/runtime/math.eli +429 -0
- package/runtime/math.mjs +1116 -0
- package/runtime/math.mjs.map +1 -0
- package/runtime/number-radix.mjs +105 -0
- package/runtime/unicode-case-data.eli +29 -0
- package/runtime/unicode-case-data.mjs +10124 -0
- package/runtime/unicode-case-data.mjs.map +1 -0
- package/runtime/unicode-case.eli +100 -0
- package/runtime/unicode-case.mjs +280 -0
- package/runtime/unicode-case.mjs.map +1 -0
- package/runtime/wire/http-rpc.mjs +168 -0
- package/runtime/wire/markdown.mjs +196 -0
- package/runtime/wire/schema.mjs +109 -0
- package/stdlib/README.md +54 -0
- package/stdlib/core/protocol.eli +81 -17
- package/stdlib/core/seq.eli +1 -1
- package/stdlib/core/zipper.eli +114 -47
- package/stdlib/gepo.eli +12 -0
- package/stdlib/interop/js.eli +56 -15
- package/stdlib/managed-literal-protocols.eli +483 -0
- package/stdlib/managed-literals.eli +1414 -0
- package/stdlib/managed-protocol-error.eli +32 -0
- package/stdlib/managed-queue-state.eli +65 -0
- package/stdlib/managed-runtime-collection-internals.eli +60 -0
- package/stdlib/managed-runtime-collection.eli +579 -0
- package/stdlib/managed-runtime-data-text.eli +290 -0
- package/stdlib/managed-runtime-data.eli +22 -0
- package/stdlib/managed-runtime-identifier.eli +44 -0
- package/stdlib/managed-runtime-lazy-sequence.eli +131 -0
- package/stdlib/managed-runtime-list.eli +19 -0
- package/stdlib/managed-runtime-literals.eli +23 -0
- package/stdlib/managed-runtime-map.eli +9 -0
- package/stdlib/managed-runtime-metadata-internals.eli +6 -0
- package/stdlib/managed-runtime-metadata.eli +23 -0
- package/stdlib/managed-runtime-object.eli +8 -0
- package/stdlib/managed-runtime-order.eli +123 -0
- package/stdlib/managed-runtime-persistent-kind.eli +28 -0
- package/stdlib/managed-runtime-protocol.eli +28 -0
- package/stdlib/managed-runtime-queue.eli +9 -0
- package/stdlib/managed-runtime-record.eli +191 -0
- package/stdlib/managed-runtime-regex.eli +158 -0
- package/stdlib/managed-runtime-sequence.eli +305 -0
- package/stdlib/managed-runtime-set-algebra.eli +28 -0
- package/stdlib/managed-runtime-set.eli +9 -0
- package/stdlib/managed-runtime-sorted.eli +408 -0
- package/stdlib/managed-runtime-text.eli +14 -0
- package/stdlib/managed-runtime-transducer.eli +268 -0
- package/stdlib/managed-runtime-transient.eli +17 -0
- package/stdlib/managed-runtime-truth.eli +4 -0
- package/stdlib/managed-runtime-type.eli +232 -0
- package/stdlib/managed-runtime-value-internals.eli +13 -0
- package/stdlib/managed-runtime-value.eli +19 -0
- package/stdlib/managed-runtime-vector.eli +20 -0
- package/stdlib/managed-sorted-state.eli +233 -0
- package/stdlib/managed-testing-value.eli +6 -0
- package/stdlib/managed-transient-state.eli +348 -0
- package/stdlib/managed-value-state.eli +153 -0
- package/stdlib/managed-vector-view-state.eli +102 -0
- package/stdlib/managed-wire-http-rpc.eli +362 -0
- package/stdlib/managed-wire-markdown.eli +275 -0
- package/stdlib/managed-wire-schema.eli +193 -0
- package/stdlib/mdp.eli +7 -0
- package/stdlib/mds.eli +4 -0
- package/stdlib/persistent-vector.eli +23 -6
- package/tools/acceptance/check-legacy.mjs +687 -0
- package/tools/acceptance/check.eli +431 -0
- package/tools/acceptance/compile-evidence.el +49 -0
- package/tools/acceptance/finalize-legacy.mjs +498 -0
- package/tools/acceptance/finalize.eli +270 -0
- package/tools/backends/benchmark.mjs +175 -0
- package/tools/backends/build.mjs +135 -0
- package/tools/backends/compile.mjs +94 -0
- package/tools/backends/compiler-bootstrap.mjs +1001 -0
- package/tools/backends/compiler-browser.mjs +361 -0
- package/tools/backends/compiler-build.mjs +1628 -0
- package/tools/backends/compiler-cli-legacy.mjs +334 -0
- package/tools/backends/compiler-cli.mjs +29 -0
- package/tools/backends/compiler-corpus-bit.mjs +234 -0
- package/tools/backends/compiler-corpus-cli-adapters-legacy.mjs +362 -0
- package/tools/backends/compiler-corpus-cli-adapters.mjs +247 -0
- package/tools/backends/compiler-corpus-debugging.mjs +221 -0
- package/tools/backends/compiler-corpus-emitter.mjs +324 -0
- package/tools/backends/compiler-corpus-evaluation-adapters.mjs +65 -0
- package/tools/backends/compiler-corpus-execution-legacy.mjs +769 -0
- package/tools/backends/compiler-corpus-execution.mjs +3324 -0
- package/tools/backends/compiler-corpus-fuzz.mjs +229 -0
- package/tools/backends/compiler-corpus-generations.mjs +208 -0
- package/tools/backends/compiler-corpus-host-context-legacy.mjs +114 -0
- package/tools/backends/compiler-corpus-host-context.mjs +550 -0
- package/tools/backends/compiler-corpus-identity-host.mjs +553 -0
- package/tools/backends/compiler-corpus-identity-value-adapters-legacy.mjs +298 -0
- package/tools/backends/compiler-corpus-identity-value-adapters.mjs +69 -0
- package/tools/backends/compiler-corpus-isolated-exports.mjs +21 -0
- package/tools/backends/compiler-corpus-legacy.mjs +1155 -0
- package/tools/backends/compiler-corpus-literal-provider.mjs +282 -0
- package/tools/backends/compiler-corpus-managed-adapters-legacy.mjs +334 -0
- package/tools/backends/compiler-corpus-managed-adapters.mjs +937 -0
- package/tools/backends/compiler-corpus-managed-cases.mjs +179 -0
- package/tools/backends/compiler-corpus-managed-fixtures-legacy.mjs +879 -0
- package/tools/backends/compiler-corpus-managed-fixtures.mjs +1287 -0
- package/tools/backends/compiler-corpus-matchers.mjs +173 -0
- package/tools/backends/compiler-corpus-original-program.mjs +612 -0
- package/tools/backends/compiler-corpus-process.mjs +765 -0
- package/tools/backends/compiler-corpus-program-driver.mjs +306 -0
- package/tools/backends/compiler-corpus-project-adapters-legacy.mjs +497 -0
- package/tools/backends/compiler-corpus-project-adapters.mjs +340 -0
- package/tools/backends/compiler-corpus-project-entry-host.mjs +511 -0
- package/tools/backends/compiler-corpus-project-transport.mjs +151 -0
- package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1438 -0
- package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1456 -0
- package/tools/backends/compiler-corpus-raw-math-fixture.mjs +346 -0
- package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +523 -0
- package/tools/backends/compiler-corpus-reference-legacy.mjs +263 -0
- package/tools/backends/compiler-corpus-reference.mjs +241 -0
- package/tools/backends/compiler-corpus-runtime-adapters-legacy.mjs +843 -0
- package/tools/backends/compiler-corpus-runtime-adapters.mjs +663 -0
- package/tools/backends/compiler-corpus-source-archive.mjs +206 -0
- package/tools/backends/compiler-corpus-tools-artifact-adapters.mjs +410 -0
- package/tools/backends/compiler-corpus-tools-cli.mjs +363 -0
- package/tools/backends/compiler-corpus-tools-reference.mjs +264 -0
- package/tools/backends/compiler-corpus.mjs +2054 -0
- package/tools/backends/compiler-debug.mjs +142 -0
- package/tools/backends/compiler-matrix.mjs +1955 -0
- package/tools/backends/compiler-metadata.mjs +203 -0
- package/tools/backends/compiler-package-browser.mjs +120 -0
- package/tools/backends/compiler-package-legacy.mjs +654 -0
- package/tools/backends/compiler-package.mjs +464 -0
- package/tools/backends/compiler-project.mjs +126 -0
- package/tools/backends/compiler-session.mjs +843 -0
- package/tools/backends/compiler-sha256.mjs +152 -0
- package/tools/backends/compiler-unicode-profile-host.mjs +196 -0
- package/tools/backends/compiler-worker.mjs +573 -0
- package/tools/backends/dist/bootstrap-js-stages.mjs +919 -0
- package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -0
- package/tools/backends/dist/managed-ir-inventory.mjs +488 -0
- package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -0
- package/tools/backends/dist/record-grid.mjs +1256 -0
- package/tools/backends/dist/record-grid.mjs.map +1 -0
- package/tools/backends/dist/release-cli.mjs +460 -0
- package/tools/backends/dist/release-cli.mjs.map +1 -0
- package/tools/backends/dist/run-artifact.mjs +517 -0
- package/tools/backends/dist/run-artifact.mjs.map +1 -0
- package/tools/backends/eliscript/compiler-corpus-bit.eli +77 -0
- package/tools/backends/eliscript/compiler-corpus-debugging.eli +70 -0
- package/tools/backends/eliscript/compiler-corpus-project-entry-host.eli +256 -0
- package/tools/backends/managed-foreign-binding.mjs +497 -0
- package/tools/backends/managed-host-legacy.mjs +1181 -0
- package/tools/backends/managed-host-lifecycle.mjs +310 -0
- package/tools/backends/managed-host-object-provider.mjs +155 -0
- package/tools/backends/managed-host-object-realm.mjs +797 -0
- package/tools/backends/managed-host-proxy.mjs +71 -0
- package/tools/backends/managed-host-runtime.mjs +5868 -0
- package/tools/backends/managed-host.mjs +716 -0
- package/tools/backends/managed-module-graph-legacy.mjs +308 -0
- package/tools/backends/managed-module-graph.mjs +694 -0
- package/tools/backends/managed-runtime-host-legacy.mjs +195 -0
- package/tools/backends/managed-runtime.mjs +939 -0
- package/tools/backends/managed-source-view-legacy.mjs +332 -0
- package/tools/backends/managed-source-view.mjs +959 -0
- package/tools/backends/memory-runtime.mjs +100 -0
- package/tools/backends/native-benchmark.mjs +88 -0
- package/tools/backends/native-managed-runtime.mjs +677 -0
- package/tools/backends/native-memory.mjs +768 -0
- package/tools/backends/native-node-memory.mjs +142 -0
- package/tools/backends/native-node-runner.mjs +99 -0
- package/tools/backends/native-node-watchdog.mjs +19 -0
- package/tools/backends/native-node-worker.mjs +75 -0
- package/tools/backends/stage3-targets.mjs +486 -0
- package/tools/bootstrap-command.el +13 -0
- package/tools/bootstrap-runtime.el +101 -0
- package/tools/bootstrap-seed.el +55 -0
- package/tools/project/check-cli.eli +31 -0
- package/tools/project/project-cli.eli +42 -0
- package/tools/project/project.eli +122 -0
- package/tools/runtime/unicode-case-profiles.mjs +13 -0
- package/tools/runtime/unicode-case-runtime.el +57 -0
- package/tools/testing/source-debugging-corpus-host.eli +16 -0
- package/tools/testing/source-debugging.eli +139 -0
- package/tools/testing/stdlib-bit-corpus-host.eli +21 -0
- package/tools/testing/stdlib-bit-corpus-host.mjs +118 -0
- package/tools/testing/stdlib-bit.eli +104 -0
- package/tools/testing/stdlib-bit.mjs +255 -0
- package/bin/eliscript-bootstrap +0 -15
|
@@ -0,0 +1,486 @@
|
|
|
1
|
+
// Generated by Eliscript. Do not edit.
|
|
2
|
+
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
|
|
3
|
+
var __eliscript_tdz_ready_0;
|
|
4
|
+
function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("targets"); return targets; }
|
|
5
|
+
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("targets"); return __eliscript_const_error(); }
|
|
6
|
+
import "eliscript/runtime/unicode-case.mjs";
|
|
7
|
+
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
8
|
+
const __eliscript_number_intrinsic = globalThis.Number;
|
|
9
|
+
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
10
|
+
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
11
|
+
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
12
|
+
const __eliscript_numeric_error = globalThis.TypeError;
|
|
13
|
+
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
14
|
+
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
15
|
+
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
16
|
+
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
17
|
+
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
18
|
+
const __eliscript_numeric_primitive = (value) => {
|
|
19
|
+
if (!__eliscript_numeric_object(value)) return value;
|
|
20
|
+
const exotic = value[__eliscript_numeric_symbol];
|
|
21
|
+
if (exotic !== void 0 && exotic !== null) {
|
|
22
|
+
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
23
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
24
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
25
|
+
}
|
|
26
|
+
for (let index = 0; index < 2; index++) {
|
|
27
|
+
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
28
|
+
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
29
|
+
const result = __eliscript_numeric_apply(method, value, []);
|
|
30
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
34
|
+
};
|
|
35
|
+
const __eliscript_to_number = (value) => {
|
|
36
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
37
|
+
if (typeof primitive === "string") {
|
|
38
|
+
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
39
|
+
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
40
|
+
let first = 2;
|
|
41
|
+
while (first < text.length && text[first] === "0") first++;
|
|
42
|
+
if (first === text.length) return 0;
|
|
43
|
+
const prefix = text[1];
|
|
44
|
+
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
45
|
+
if (text.length - first > limit) return 1 / 0;
|
|
46
|
+
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
47
|
+
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return __eliscript_number_intrinsic(primitive);
|
|
51
|
+
};
|
|
52
|
+
const __eliscript_numeric = (value) => {
|
|
53
|
+
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
54
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
55
|
+
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
56
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
57
|
+
};
|
|
58
|
+
const __eliscript_implicit_number = (value) => {
|
|
59
|
+
if (typeof value === "number") return value;
|
|
60
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
61
|
+
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
62
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
63
|
+
};
|
|
64
|
+
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
65
|
+
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
66
|
+
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
67
|
+
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
68
|
+
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
69
|
+
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
70
|
+
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
71
|
+
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
72
|
+
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
73
|
+
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
74
|
+
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
75
|
+
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
76
|
+
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
77
|
+
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
78
|
+
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
79
|
+
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
80
|
+
if (typeof left === "number" && typeof right === "number") {
|
|
81
|
+
if (operator === "<") return left < right;
|
|
82
|
+
if (operator === "<=") return left <= right;
|
|
83
|
+
if (operator === ">") return left > right;
|
|
84
|
+
return left >= right;
|
|
85
|
+
}
|
|
86
|
+
let a = __eliscript_numeric_primitive(left);
|
|
87
|
+
let b = __eliscript_numeric_primitive(right);
|
|
88
|
+
const x = typeof a, y = typeof b;
|
|
89
|
+
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
90
|
+
a = __eliscript_numeric(a);
|
|
91
|
+
b = __eliscript_numeric(b);
|
|
92
|
+
}
|
|
93
|
+
if (operator === "<") return a < b;
|
|
94
|
+
if (operator === "<=") return a <= b;
|
|
95
|
+
if (operator === ">") return a > b;
|
|
96
|
+
return a >= b;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
import {readFile, writeFile, mkdir, realpath} from "node:fs/promises";
|
|
100
|
+
import {resolve, dirname, relative} from "node:path";
|
|
101
|
+
import {isDeepStrictEqual} from "node:util";
|
|
102
|
+
import {root} from "./build.mjs";
|
|
103
|
+
import {compilerFailure, compilerDigest, saveCompilerMetadata, compilerSourceIdentity} from "./compiler-bootstrap.mjs";
|
|
104
|
+
import {loadCompilerSources, independentCompilerProductIdentity} from "./compiler-build.mjs";
|
|
105
|
+
import {readCompilerMetadata} from "./compiler-metadata.mjs";
|
|
106
|
+
import {loadCompilerMatrixCorpus, runStage3CompilerTargetCell, classifyStage3Corpus} from "./compiler-matrix.mjs";
|
|
107
|
+
import {compilerCorpusRuntimeAcceptance} from "./compiler-corpus-execution.mjs";
|
|
108
|
+
import {compareJsFixedPoint} from "./dist/bootstrap-js-stages.mjs";
|
|
109
|
+
const targets = Object.freeze(["javascript", "wasm", "native"]);
|
|
110
|
+
__eliscript_tdz_ready_0 = true;
|
|
111
|
+
function fail(message) {
|
|
112
|
+
return ((__eliscript_value_1) => { throw __eliscript_value_1; })(new (globalThis.Error)(message));
|
|
113
|
+
}
|
|
114
|
+
function type_fail(message) {
|
|
115
|
+
return ((__eliscript_value_2) => { throw __eliscript_value_2; })(new (globalThis.TypeError)(message));
|
|
116
|
+
}
|
|
117
|
+
function object_options(value) {
|
|
118
|
+
if ((!__eliscript_truthy(((__eliscript_value_3) => (__eliscript_truthy(__eliscript_value_3) ? ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "object") && (!__eliscript_truthy(Array.isArray(value)))) : __eliscript_value_3))(value)))) {
|
|
119
|
+
type_fail("stage3 options must be an object");
|
|
120
|
+
}
|
|
121
|
+
return value;
|
|
122
|
+
}
|
|
123
|
+
function required_path(value, label) {
|
|
124
|
+
if ((!((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "string") && __eliscript_numeric_relation(">", ((value) ?? []).length, 0)))) {
|
|
125
|
+
type_fail((label + " is required"));
|
|
126
|
+
}
|
|
127
|
+
return resolve(value);
|
|
128
|
+
}
|
|
129
|
+
function snapshot(value) {
|
|
130
|
+
{
|
|
131
|
+
const __eliscript_value_4 = ({});
|
|
132
|
+
{
|
|
133
|
+
let result = __eliscript_value_4;
|
|
134
|
+
(Reflect.ownKeys(value))["forEach"](((key) => {
|
|
135
|
+
if (__eliscript_truthy((Object.getOwnPropertyDescriptor(value, key))["enumerable"])) {
|
|
136
|
+
return Object.defineProperty(result, key, ({"value": (value)[key], "enumerable": true, "writable": true, "configurable": true}));
|
|
137
|
+
} else {
|
|
138
|
+
return null;
|
|
139
|
+
}
|
|
140
|
+
}));
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
function identical(actual, expected, label) {
|
|
146
|
+
if ((!__eliscript_truthy(isDeepStrictEqual(actual, expected)))) {
|
|
147
|
+
return fail((label + " differs from authenticated stage3"));
|
|
148
|
+
} else {
|
|
149
|
+
return null;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function reason(signal) {
|
|
153
|
+
if (((signal)["reason"] === undefined)) {
|
|
154
|
+
return new (globalThis.Error)("stage3 targets cancelled");
|
|
155
|
+
} else {
|
|
156
|
+
return (signal)["reason"];
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
function cancelled(signal) {
|
|
160
|
+
return ((__eliscript_value_5) => (__eliscript_truthy(__eliscript_value_5) ? (signal)["aborted"] : __eliscript_value_5))((!(signal == null)));
|
|
161
|
+
}
|
|
162
|
+
async function progress(callback, event) {
|
|
163
|
+
return ((!(callback == null)) ? (await (async () => {
|
|
164
|
+
try {
|
|
165
|
+
return await (callback(Object.freeze(event)));
|
|
166
|
+
} catch (ignored) {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
})()) : null);
|
|
170
|
+
}
|
|
171
|
+
async function authenticateStage3Targets(input) {
|
|
172
|
+
return (await (async (options) => {
|
|
173
|
+
return (await (async (manifest_path) => {
|
|
174
|
+
return (await (async (base) => {
|
|
175
|
+
return (await (async (manifest) => {
|
|
176
|
+
return (await (async (stages) => {
|
|
177
|
+
return (((manifest)["format"] === "eliscript-stage3-release") ? (await (async () => {
|
|
178
|
+
if ((!__eliscript_truthy(((__eliscript_value_6) => (__eliscript_truthy(__eliscript_value_6) ? ((__eliscript_value_7) => (__eliscript_truthy(__eliscript_value_7) ? ((__eliscript_value_8) => (__eliscript_truthy(__eliscript_value_8) ? ((__eliscript_value_9) => (__eliscript_truthy(__eliscript_value_9) ? __eliscript_numeric_relation(">", (manifest)["fixedPointFileCount"], 0) : __eliscript_value_9))(Number.isInteger((manifest)["fixedPointFileCount"])) : __eliscript_value_8))(((manifest)["verification"] === "identical")) : __eliscript_value_7))(((manifest)["status"] === "accepted")) : __eliscript_value_6))(((manifest)["version"] === 1))))) {
|
|
179
|
+
fail("an accepted stage3 release receipt is required");
|
|
180
|
+
}
|
|
181
|
+
return (await (async (path3) => {
|
|
182
|
+
return (await (async (supplied) => {
|
|
183
|
+
return (await (async (artifact) => {
|
|
184
|
+
return (await (async (directory) => {
|
|
185
|
+
return (await (async (declared_files) => {
|
|
186
|
+
return (await (async (verified_files) => {
|
|
187
|
+
return (await (async (index) => {
|
|
188
|
+
return (await (async () => {
|
|
189
|
+
((!(supplied === undefined)) ? ((!(await (realpath(required_path(supplied, "stage3MetadataPath"))) === path3)) ? fail("the requested compiler is not the designated final stage3") : null) : null);
|
|
190
|
+
identical((artifact)["sourceIdentity"], (manifest)["artifactSourceIdentity"], "stage3 source identity");
|
|
191
|
+
identical((artifact)["stage3FullProductIdentity"], (manifest)["stage3ProductIdentity"], "stage3 product identity");
|
|
192
|
+
if ((!__eliscript_truthy(((__eliscript_value_10) => (__eliscript_truthy(__eliscript_value_10) ? __eliscript_numeric_relation(">", ((declared_files) ?? []).length, 0) : __eliscript_value_10))(Array.isArray(declared_files))))) {
|
|
193
|
+
fail("packaged stage3 artifact requires declared files");
|
|
194
|
+
}
|
|
195
|
+
(await (async () => {
|
|
196
|
+
while (__eliscript_numeric_relation("<", index, ((declared_files) ?? []).length)) {
|
|
197
|
+
(await (async (entry) => {
|
|
198
|
+
return (await (async (rel_path) => {
|
|
199
|
+
return ((bytes) => {
|
|
200
|
+
return ((actual_sha) => {
|
|
201
|
+
return (() => {
|
|
202
|
+
if ((!((((bytes) ?? []).length === (entry)["bytes"]) && (actual_sha === (entry)["sha256"])))) {
|
|
203
|
+
fail(("packaged stage3 file changed after emission: " + rel_path));
|
|
204
|
+
}
|
|
205
|
+
return (verified_files)["push"](({"path": rel_path, "bytes": ((bytes) ?? []).length, "sha256": actual_sha}));
|
|
206
|
+
})();
|
|
207
|
+
})(compilerDigest(bytes));
|
|
208
|
+
})(await (readFile(resolve(directory, rel_path))));
|
|
209
|
+
})((entry)["path"]));
|
|
210
|
+
})((declared_files)[index]));
|
|
211
|
+
((index = (index + 1)));
|
|
212
|
+
}
|
|
213
|
+
return null;
|
|
214
|
+
})());
|
|
215
|
+
{
|
|
216
|
+
const __eliscript_value_11 = independentCompilerProductIdentity(({"host": (artifact)["host"], "nativeTarget": (artifact)["nativeTarget"], "files": verified_files, "descriptor": (artifact)["descriptor"], "typed": (artifact)["typed"]}));
|
|
217
|
+
{
|
|
218
|
+
let actual_packaged = __eliscript_value_11;
|
|
219
|
+
identical(actual_packaged, (artifact)["productIdentity"], "packaged stage3 artifact product identity");
|
|
220
|
+
identical(actual_packaged, (manifest)["packagedProductIdentity"], "packaged stage3 release product identity");
|
|
221
|
+
return ({"scope": "stage3-identity", "verification": "authenticated", "bootstrapManifestPath": manifest_path, "stage3MetadataPath": path3, "stage2MetadataPath": path3, "stage2ProductIdentity": (manifest)["stage2ProductIdentity"], "fixedPointFileCount": (manifest)["fixedPointFileCount"], "sourceIdentity": (manifest)["formalSourceIdentity"], "productIdentity": (manifest)["stage3ProductIdentity"]});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
})());
|
|
225
|
+
})(0));
|
|
226
|
+
})([]));
|
|
227
|
+
})(((artifact)["artifactIdentity"])["files"]));
|
|
228
|
+
})(dirname(path3)));
|
|
229
|
+
})(await (readCompilerMetadata(path3))));
|
|
230
|
+
})((options)["stage3MetadataPath"]));
|
|
231
|
+
})(await (realpath(resolve(base, (manifest)["metadataPath"])))));
|
|
232
|
+
})()) : (await (async () => {
|
|
233
|
+
if ((!__eliscript_truthy(((__eliscript_value_12) => (__eliscript_truthy(__eliscript_value_12) ? ((__eliscript_value_13) => (__eliscript_truthy(__eliscript_value_13) ? ((__eliscript_value_14) => (__eliscript_truthy(__eliscript_value_14) ? ((__eliscript_value_15) => (__eliscript_truthy(__eliscript_value_15) ? (((stages) ?? []).length === 4) : __eliscript_value_15))(Array.isArray(stages)) : __eliscript_value_14))(((manifest)["status"] === "accepted")) : __eliscript_value_13))(((manifest)["version"] === 1)) : __eliscript_value_12))(((manifest)["format"] === "eliscript-js-bootstrap"))))) {
|
|
234
|
+
fail("an accepted JavaScript stage0-stage3 bootstrap is required");
|
|
235
|
+
}
|
|
236
|
+
{
|
|
237
|
+
const __eliscript_value_16 = 0;
|
|
238
|
+
{
|
|
239
|
+
let index = __eliscript_value_16;
|
|
240
|
+
while (__eliscript_numeric_relation("<", index, 4)) {
|
|
241
|
+
{
|
|
242
|
+
const __eliscript_value_17 = (stages)[index];
|
|
243
|
+
{
|
|
244
|
+
let stage = __eliscript_value_17;
|
|
245
|
+
if ((!(((stage)["stage"] === index) && ((stage)["host"] === "javascript") && ((stage)["target"] === "javascript") && ((stage)["status"] === "built") && ((stage)["producer"] === ((index === 0) ? "emacs-lisp" : ("stage" + __eliscript_numeric_decrement(index))))))) {
|
|
246
|
+
fail("bootstrap stage provenance is invalid");
|
|
247
|
+
}
|
|
248
|
+
identical((stage)["inputIdentity"], (manifest)["formalSourceIdentity"], "stage source identity");
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
((index = (index + 1)));
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
if ((!((((manifest)["fixedPoint"])["from"] === 2) && (((manifest)["fixedPoint"])["to"] === 3) && (((manifest)["fixedPoint"])["status"] === "identical")))) {
|
|
256
|
+
fail("stage2-stage3 fixed point is not identical");
|
|
257
|
+
}
|
|
258
|
+
return (await (async (stage2) => {
|
|
259
|
+
return (await (async (stage3) => {
|
|
260
|
+
return (await (async (path2) => {
|
|
261
|
+
return (await (async (path3) => {
|
|
262
|
+
return (await (async (supplied) => {
|
|
263
|
+
return (await (async (receipt_path) => {
|
|
264
|
+
return (await (async () => {
|
|
265
|
+
((!(supplied === undefined)) ? ((!(await (realpath(required_path(supplied, "stage3MetadataPath"))) === path3)) ? fail("the requested compiler is not the designated final stage3") : null) : null);
|
|
266
|
+
return (await (async (receipt) => {
|
|
267
|
+
return ((actual) => {
|
|
268
|
+
return (() => {
|
|
269
|
+
identical(actual, receipt, "fixed-point receipt");
|
|
270
|
+
identical((actual)["stage2ProductIdentity"], (stage2)["productIdentity"], "stage2 product identity");
|
|
271
|
+
identical((actual)["stage3ProductIdentity"], (stage3)["productIdentity"], "stage3 product identity");
|
|
272
|
+
return ({"scope": "stage3-identity", "verification": "authenticated", "bootstrapManifestPath": manifest_path, "stage3MetadataPath": path3, "stage2MetadataPath": path2, "stage2ProductIdentity": (actual)["stage2ProductIdentity"], "fixedPointFileCount": (((actual)["files"]) ?? []).length, "sourceIdentity": (manifest)["formalSourceIdentity"], "productIdentity": (actual)["stage3ProductIdentity"]});
|
|
273
|
+
})();
|
|
274
|
+
})(await (compareJsFixedPoint(({"stage2": path2, "stage3": path3, "sourceIdentity": (manifest)["formalSourceIdentity"]}))));
|
|
275
|
+
})(await (readCompilerMetadata(receipt_path))));
|
|
276
|
+
})());
|
|
277
|
+
})(resolve(base, ((manifest)["fixedPoint"])["comparisonPath"])));
|
|
278
|
+
})((options)["stage3MetadataPath"]));
|
|
279
|
+
})(await (realpath(resolve(base, (stage3)["metadataPath"])))));
|
|
280
|
+
})(await (realpath(resolve(base, (stage2)["metadataPath"])))));
|
|
281
|
+
})((stages)[3]));
|
|
282
|
+
})((stages)[2]));
|
|
283
|
+
})()));
|
|
284
|
+
})((manifest)["stages"]));
|
|
285
|
+
})(await (readCompilerMetadata(manifest_path))));
|
|
286
|
+
})(dirname(manifest_path)));
|
|
287
|
+
})(await (realpath(required_path((options)["bootstrapManifestPath"], "bootstrapManifestPath")))));
|
|
288
|
+
})(snapshot(object_options(input))));
|
|
289
|
+
}
|
|
290
|
+
function cancel_target_entry(result, entry, signal) {
|
|
291
|
+
if ((!__eliscript_truthy((result)["hasFailure"]))) {
|
|
292
|
+
((result)["hasFailure"] = true);
|
|
293
|
+
((result)["failure"] = reason(signal));
|
|
294
|
+
}
|
|
295
|
+
((result)["status"] = "cancelled");
|
|
296
|
+
return ((entry)["status"] = "cancelled");
|
|
297
|
+
}
|
|
298
|
+
async function run_target_entry(options, run_cell, result, entry) {
|
|
299
|
+
return (await (async (target, signal, observer) => {
|
|
300
|
+
return (__eliscript_truthy(cancelled(signal)) ? cancel_target_entry(result, entry, signal) : (await (async () => {
|
|
301
|
+
((entry)["status"] = "running");
|
|
302
|
+
await (progress(observer, ({"host": "javascript", "target": target, "phase": "target-start"})));
|
|
303
|
+
(__eliscript_truthy(cancelled(signal)) ? cancel_target_entry(result, entry, signal) : (await (async () => {
|
|
304
|
+
try {
|
|
305
|
+
return (await (async (call) => {
|
|
306
|
+
return (await (async (_resources) => {
|
|
307
|
+
return ((actual) => {
|
|
308
|
+
return ((metadata) => {
|
|
309
|
+
return (() => {
|
|
310
|
+
((entry)["directory"] = (actual)["directory"]);
|
|
311
|
+
((entry)["manifestPath"] = resolve((actual)["directory"], "matrix.json"));
|
|
312
|
+
((entry)["status"] = (((metadata)["verification"] === "equivalent") ? "passed" : "failed"));
|
|
313
|
+
if (__eliscript_truthy((metadata)["resourceAcceptance"])) {
|
|
314
|
+
((entry)["resourceAcceptance"] = (metadata)["resourceAcceptance"]);
|
|
315
|
+
((entry)["resourceOutcomes"] = (metadata)["resourceOutcomes"]);
|
|
316
|
+
}
|
|
317
|
+
if (__eliscript_truthy((metadata)["corpusSelection"])) {
|
|
318
|
+
{
|
|
319
|
+
const __eliscript_value_18 = (metadata)["corpusSelection"];
|
|
320
|
+
{
|
|
321
|
+
let selection = __eliscript_value_18;
|
|
322
|
+
((entry)["corpusSelection"] = selection);
|
|
323
|
+
((entry)["effectiveCount"] = (((selection)["effectiveIds"]) ?? []).length);
|
|
324
|
+
((entry)["cancelledCount"] = (((selection)["cancelled"]) ?? []).length);
|
|
325
|
+
((entry)["resourceDeferred"] = ((selection)["resourceDeferred"] ?? []));
|
|
326
|
+
((entry)["resourceDeferredCount"] = (((entry)["resourceDeferred"]) ?? []).length);
|
|
327
|
+
if (__eliscript_numeric_relation(">", (entry)["resourceDeferredCount"], 0)) {
|
|
328
|
+
((entry)["fullCorpusVerification"] = "unverified");
|
|
329
|
+
((entry)["verificationScope"] = "effective-corpus");
|
|
330
|
+
((entry)["passedCount"] = ((metadata)["passedCount"] ?? 0));
|
|
331
|
+
}
|
|
332
|
+
if ((((entry)["status"] === "passed") && (__eliscript_numeric_relation(">", (entry)["cancelledCount"], 0) || __eliscript_numeric_relation(">", (entry)["resourceDeferredCount"], 0)))) {
|
|
333
|
+
((entry)["status"] = "passed-effective-scope");
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if (((entry)["status"] === "failed")) {
|
|
339
|
+
return ((__eliscript_value_19) => { throw __eliscript_value_19; })(new (globalThis.Error)(("stage3 " + target + " output acceptance failed; see " + (entry)["manifestPath"])));
|
|
340
|
+
} else {
|
|
341
|
+
return null;
|
|
342
|
+
}
|
|
343
|
+
})();
|
|
344
|
+
})((actual)["metadata"]);
|
|
345
|
+
})(await (run_cell(call)));
|
|
346
|
+
})(((!((options)["functionalRuntimeProfile"] === undefined)) ? ((call)["functionalRuntimeProfile"] = (options)["functionalRuntimeProfile"]) : null)));
|
|
347
|
+
})(({"host": "javascript", "target": target, "metadataPath": (options)["stage3MetadataPath"], "corpusRecordsPath": (options)["corpusRecordsPath"], "outputRoot": resolve((options)["outputRoot"], target), "sourceRoot": (options)["sourceRoot"], "nativeTarget": (options)["nativeTarget"], "programCache": (options)["programCache"], "bootstrapManifestPath": (options)["bootstrapManifestPath"], "signal": signal, "sessionOptions": (options)["sessionOptions"], "onStage": observer})));
|
|
348
|
+
} catch (error) {
|
|
349
|
+
((entry)["status"] = (__eliscript_truthy(cancelled(signal)) ? "cancelled" : "failed"));
|
|
350
|
+
((entry)["failure"] = compilerFailure(error));
|
|
351
|
+
if ((!__eliscript_truthy((result)["hasFailure"]))) {
|
|
352
|
+
((result)["hasFailure"] = true);
|
|
353
|
+
((result)["failure"] = error);
|
|
354
|
+
}
|
|
355
|
+
return ((result)["status"] = (__eliscript_truthy(cancelled(signal)) ? "cancelled" : "failed"));
|
|
356
|
+
}
|
|
357
|
+
})()));
|
|
358
|
+
return await (progress(observer, ({"host": "javascript", "target": target, "phase": "target-complete", "status": (entry)["status"]})));
|
|
359
|
+
})()));
|
|
360
|
+
})((entry)["target"], (options)["signal"], (options)["onStage"]));
|
|
361
|
+
}
|
|
362
|
+
async function run_stage3_target_schedule(input, run_cell) {
|
|
363
|
+
return (await (async (options) => {
|
|
364
|
+
return (await (async (parallel) => {
|
|
365
|
+
return (await (async (entries) => {
|
|
366
|
+
return (await (async (result) => {
|
|
367
|
+
return (await (async () => {
|
|
368
|
+
compilerCorpusRuntimeAcceptance(null, options);
|
|
369
|
+
if ((!((parallel === undefined) || (parallel === false) || (parallel === true)))) {
|
|
370
|
+
type_fail("parallelTargets must be a boolean");
|
|
371
|
+
}
|
|
372
|
+
((parallel === true) ? await (Promise.all((entries)["map"](((entry) => {
|
|
373
|
+
return run_target_entry(options, run_cell, result, entry);
|
|
374
|
+
})))) : (await (async (index) => {
|
|
375
|
+
return (await (async () => {
|
|
376
|
+
while (__eliscript_numeric_relation("<", index, 3)) {
|
|
377
|
+
await (run_target_entry(options, run_cell, result, (entries)[index]));
|
|
378
|
+
((index = (index + 1)));
|
|
379
|
+
}
|
|
380
|
+
return null;
|
|
381
|
+
})());
|
|
382
|
+
})(0)));
|
|
383
|
+
return result;
|
|
384
|
+
})());
|
|
385
|
+
})(({"scope": "target-schedule", "verification": "unverified", "status": "completed", "hasFailure": false, "targets": entries})));
|
|
386
|
+
})(((__eliscript_tdz_read_0()))["map"](((target) => {
|
|
387
|
+
return ({"host": "javascript", "target": target, "status": "pending"});
|
|
388
|
+
}))));
|
|
389
|
+
})((options)["parallelTargets"]));
|
|
390
|
+
})(snapshot(object_options(input))));
|
|
391
|
+
}
|
|
392
|
+
async function runStage3Targets(input) {
|
|
393
|
+
object_options(input);
|
|
394
|
+
compilerCorpusRuntimeAcceptance(null, input);
|
|
395
|
+
(["host", "target", "producer", "producers", "compilerArtifact", "runCell", "execute", "compare", "corpusRecords", "originalOracle", "programCache", "seedOracleCache", "parallelTargets"])["forEach"](((key) => {
|
|
396
|
+
if (__eliscript_truthy(Object.hasOwn(input, key))) {
|
|
397
|
+
return type_fail(("final stage3 acceptance does not accept " + key));
|
|
398
|
+
} else {
|
|
399
|
+
return null;
|
|
400
|
+
}
|
|
401
|
+
}));
|
|
402
|
+
return (await (async (options) => {
|
|
403
|
+
return (await (async (output) => {
|
|
404
|
+
return (await (async (source_root) => {
|
|
405
|
+
return (await (async (authentication) => {
|
|
406
|
+
return (await (async (corpus) => {
|
|
407
|
+
return (await (async (sources) => {
|
|
408
|
+
return (await (async (source_identity) => {
|
|
409
|
+
return (await (async (frozen_path) => {
|
|
410
|
+
return (await (async (summary_path) => {
|
|
411
|
+
return (await (async () => {
|
|
412
|
+
identical(source_identity, (authentication)["sourceIdentity"], "current formal source identity");
|
|
413
|
+
await (mkdir(dirname(frozen_path), ({"recursive": true})));
|
|
414
|
+
await (writeFile(frozen_path, (corpus)["recordsBytes"]));
|
|
415
|
+
return (await (async (summary) => {
|
|
416
|
+
return (await (async (schedule_options) => {
|
|
417
|
+
return (await (async () => {
|
|
418
|
+
await (saveCompilerMetadata(summary_path, summary));
|
|
419
|
+
return (await (async (result) => {
|
|
420
|
+
((summary)["targets"] = (result)["targets"]);
|
|
421
|
+
if (__eliscript_truthy(((result)["targets"])["some"](((entry) => {
|
|
422
|
+
return __eliscript_numeric_relation(">", ((entry)["resourceDeferredCount"] ?? 0), 0);
|
|
423
|
+
})))) {
|
|
424
|
+
((summary)["fullCorpusVerification"] = "unverified");
|
|
425
|
+
((summary)["verificationScope"] = "effective-corpus");
|
|
426
|
+
((summary)["resourceDeferred"] = ((result)["targets"])["map"](((entry) => {
|
|
427
|
+
return ({"target": (entry)["target"], "records": ((entry)["resourceDeferred"] ?? []), "count": ((entry)["resourceDeferredCount"] ?? 0)});
|
|
428
|
+
})));
|
|
429
|
+
}
|
|
430
|
+
((summary)["resourceAcceptance"] = (__eliscript_truthy(((result)["targets"])["some"](((entry) => {
|
|
431
|
+
return ((entry)["resourceAcceptance"] === "deferred");
|
|
432
|
+
}))) ? "deferred" : "not-overridden"));
|
|
433
|
+
((summary)["status"] = (((result)["status"] === "completed") ? "passed-effective-scope" : (result)["status"]));
|
|
434
|
+
if (__eliscript_truthy((result)["hasFailure"])) {
|
|
435
|
+
((summary)["failure"] = compilerFailure((result)["failure"]));
|
|
436
|
+
}
|
|
437
|
+
(await (async () => {
|
|
438
|
+
try {
|
|
439
|
+
identical(await (authenticateStage3Targets(options)), authentication, "final stage3 identity");
|
|
440
|
+
identical(compilerSourceIdentity(await (loadCompilerSources(({"sourceRoot": source_root})))), source_identity, "final source identity");
|
|
441
|
+
((!(compilerDigest(await (readFile(frozen_path))) === (corpus)["recordsSha256"])) ? fail("frozen stage3 corpus changed during target execution") : null);
|
|
442
|
+
if (((result)["status"] === "completed")) {
|
|
443
|
+
return ((summary)["verification"] = "equivalent");
|
|
444
|
+
} else {
|
|
445
|
+
return null;
|
|
446
|
+
}
|
|
447
|
+
} catch (error) {
|
|
448
|
+
if ((!__eliscript_truthy((result)["hasFailure"]))) {
|
|
449
|
+
((result)["hasFailure"] = true);
|
|
450
|
+
((result)["failure"] = error);
|
|
451
|
+
}
|
|
452
|
+
((summary)["status"] = "failed");
|
|
453
|
+
((summary)["verification"] = "unverified");
|
|
454
|
+
return ((summary)["failure"] = compilerFailure((result)["failure"]));
|
|
455
|
+
}
|
|
456
|
+
})());
|
|
457
|
+
((summary)["functionalVerification"] = (((summary)["verification"] === "equivalent") ? "passed" : "unverified"));
|
|
458
|
+
await (saveCompilerMetadata(summary_path, summary));
|
|
459
|
+
if (__eliscript_truthy((result)["hasFailure"])) {
|
|
460
|
+
((__eliscript_value_20) => { throw __eliscript_value_20; })((result)["failure"]);
|
|
461
|
+
}
|
|
462
|
+
return summary_path;
|
|
463
|
+
})(await (run_stage3_target_schedule(schedule_options, (async (call) => {
|
|
464
|
+
((!(compilerDigest(await (readFile(frozen_path))) === (corpus)["recordsSha256"])) ? fail("frozen stage3 corpus changed before target execution") : null);
|
|
465
|
+
return await (runStage3CompilerTargetCell(call));
|
|
466
|
+
})))));
|
|
467
|
+
})());
|
|
468
|
+
})(({"parallelTargets": false, "stage3MetadataPath": (authentication)["stage3MetadataPath"], "bootstrapManifestPath": (authentication)["bootstrapManifestPath"], "corpusRecordsPath": frozen_path, "outputRoot": output, "sourceRoot": source_root, "programCache": new (globalThis.Map)(), "nativeTarget": (options)["nativeTarget"], "signal": (options)["signal"], "functionalRuntimeProfile": (options)["functionalRuntimeProfile"], "sessionOptions": (options)["sessionOptions"], "onStage": (options)["onStage"]})));
|
|
469
|
+
})(({"format": "eliscript-stage3-targets", "version": 1, "scope": "javascript-stage3-output-targets", "status": "running", "verification": "unverified", "bootstrapManifestPath": (authentication)["bootstrapManifestPath"], "stage3MetadataPath": (authentication)["stage3MetadataPath"], "sourceIdentity": source_identity, "producerIdentity": (authentication)["productIdentity"], "corpusIdentity": (corpus)["identity"], "corpusRecordsSha256": (corpus)["recordsSha256"], "corpusRecordsPath": relative(output, frozen_path), "completeIds": ((corpus)["records"])["map"](((record) => {
|
|
470
|
+
return (record)["id"];
|
|
471
|
+
})), "targetSelections": ((__eliscript_tdz_read_0()))["map"](((target) => {
|
|
472
|
+
return classifyStage3Corpus((corpus)["records"], target, Object.assign(({}), options, ({"sourceAssets": ((corpus)["document"])["evidence"]})));
|
|
473
|
+
})), "semanticComparison": "each effective record uses the original independent Seed oracle and exact comparison", "functionalRuntimeProfile": (options)["functionalRuntimeProfile"], "resourceAcceptance": "not-evaluated", "targets": []})));
|
|
474
|
+
})());
|
|
475
|
+
})(resolve(output, "stage3-targets.json")));
|
|
476
|
+
})(resolve(output, "corpus", "records.json")));
|
|
477
|
+
})(compilerSourceIdentity(sources)));
|
|
478
|
+
})(await (loadCompilerSources(({"sourceRoot": source_root})))));
|
|
479
|
+
})(await (loadCompilerMatrixCorpus(({"sourceRoot": source_root, "recordsPath": (options)["corpusRecordsPath"]})))));
|
|
480
|
+
})(await (authenticateStage3Targets(options))));
|
|
481
|
+
})((((options)["sourceRoot"] === undefined) ? root : resolve((options)["sourceRoot"]))));
|
|
482
|
+
})(required_path((options)["outputRoot"], "outputRoot")));
|
|
483
|
+
})(snapshot(input)));
|
|
484
|
+
}
|
|
485
|
+
export {authenticateStage3Targets, runStage3Targets, run_stage3_target_schedule};
|
|
486
|
+
//# sourceMappingURL=stage3-targets.mjs.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env -S emacs --script
|
|
2
|
+
;;; bootstrap-command.el --- Public Emacs seed launcher -*- lexical-binding: t; -*-
|
|
3
|
+
|
|
4
|
+
(declare-function eliscript-bootstrap-launch-command "bootstrap-runtime" (root))
|
|
5
|
+
|
|
6
|
+
(let* ((script (file-truename (or load-file-name buffer-file-name)))
|
|
7
|
+
(root (expand-file-name ".." (file-name-directory script))))
|
|
8
|
+
(add-to-list 'load-path (expand-file-name "compiler" root))
|
|
9
|
+
(add-to-list 'load-path (expand-file-name "tools" root))
|
|
10
|
+
(require 'eliscript-bootstrap-runtime "bootstrap-runtime")
|
|
11
|
+
(eliscript-bootstrap-launch-command root))
|
|
12
|
+
|
|
13
|
+
;;; bootstrap-command.el ends here
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
;;; bootstrap-runtime.el --- Runtime for an independent JS seed -*- lexical-binding: t; -*-
|
|
2
|
+
|
|
3
|
+
(require 'json)
|
|
4
|
+
(require 'eliscript)
|
|
5
|
+
|
|
6
|
+
(declare-function eliscript-generate-unicode-case-runtime-data "runtime/unicode-case-runtime" (root))
|
|
7
|
+
|
|
8
|
+
(defun eliscript-bootstrap-prepare-runtime (root output)
|
|
9
|
+
"Compile ROOT's real default runtime into the independent seed OUTPUT."
|
|
10
|
+
(unless (file-exists-p (expand-file-name "runtime/unicode-case-data.eli" root))
|
|
11
|
+
;; A clean source checkout has no ignored generated table module. Published
|
|
12
|
+
;; source packages can carry that actual derived Eli source directly.
|
|
13
|
+
(let ((generator (expand-file-name "tools/runtime/unicode-case-runtime.el" root)))
|
|
14
|
+
(unless (file-regular-p generator)
|
|
15
|
+
(error "Unicode bootstrap requires its maintained generator or derived Eli data"))
|
|
16
|
+
(load generator nil t)
|
|
17
|
+
(eliscript-generate-unicode-case-runtime-data root)))
|
|
18
|
+
(dolist (name '("unicode-case-data" "unicode-case" "math"))
|
|
19
|
+
(let ((runtime (expand-file-name (concat "runtime/" name ".mjs") output)))
|
|
20
|
+
(make-directory (file-name-directory runtime) t)
|
|
21
|
+
(eliscript-compile-file-with-source-map
|
|
22
|
+
(expand-file-name (concat "runtime/" name ".eli") root) runtime)))
|
|
23
|
+
;; The emitted frontend keeps its imports unchanged. A private scope resolves
|
|
24
|
+
;; this complete real runtime even when OUTPUT is outside the checkout.
|
|
25
|
+
(let ((coding-system-for-write 'utf-8-unix))
|
|
26
|
+
(with-temp-file (expand-file-name "package.json" output)
|
|
27
|
+
(insert (json-serialize
|
|
28
|
+
'((name . "eliscript") (type . "module") (private . t)
|
|
29
|
+
(exports . ((./runtime/math.mjs . "./runtime/math.mjs")
|
|
30
|
+
(./runtime/unicode-case.mjs . "./runtime/unicode-case.mjs")
|
|
31
|
+
(./runtime/unicode-case-data.mjs . "./runtime/unicode-case-data.mjs")))))
|
|
32
|
+
"\n"))))
|
|
33
|
+
|
|
34
|
+
(defun eliscript-bootstrap-prepare-project-host (root &optional preserve-existing)
|
|
35
|
+
"Prepare ROOT's maintained project host before loading the JS build driver."
|
|
36
|
+
(let ((entries '(("tools/project/project.eli" . "bootstrap/host/project.mjs")
|
|
37
|
+
("tools/project/project-cli.eli" . "bootstrap/host/project-cli.mjs")
|
|
38
|
+
("tools/project/check-cli.eli" . "bootstrap/host/check-cli.mjs"))))
|
|
39
|
+
(when (file-exists-p (expand-file-name (caar entries) root))
|
|
40
|
+
;; The generated host lives in ROOT, outside the private compiler output
|
|
41
|
+
;; scope. Its bare runtime imports must resolve in this same source tree.
|
|
42
|
+
(dolist (name '("unicode-case-data" "unicode-case" "math"))
|
|
43
|
+
(let ((module (expand-file-name (concat "runtime/" name ".mjs") root)))
|
|
44
|
+
(unless (and preserve-existing (file-exists-p module)
|
|
45
|
+
(file-exists-p (concat module ".map")))
|
|
46
|
+
(eliscript-compile-file-with-source-map
|
|
47
|
+
(expand-file-name (concat "runtime/" name ".eli") root) module))))
|
|
48
|
+
(dolist (entry entries)
|
|
49
|
+
(let ((source (expand-file-name (car entry) root))
|
|
50
|
+
(output (expand-file-name (cdr entry) root)))
|
|
51
|
+
(when (file-exists-p source)
|
|
52
|
+
(make-directory (file-name-directory output) t)
|
|
53
|
+
(unless (and preserve-existing (file-exists-p output)
|
|
54
|
+
(file-exists-p (concat output ".map")))
|
|
55
|
+
(eliscript-compile-file-with-source-map source output))))))))
|
|
56
|
+
|
|
57
|
+
(defun eliscript-bootstrap--call-emacs (emacs arguments)
|
|
58
|
+
"Call EMACS with ARGUMENTS, preserving its output and error streams."
|
|
59
|
+
(let ((stderr-file (make-temp-file "eliscript-bootstrap-stderr-"))
|
|
60
|
+
(stdout standard-output))
|
|
61
|
+
(unwind-protect
|
|
62
|
+
(with-temp-buffer
|
|
63
|
+
(let ((status (apply #'call-process emacs nil
|
|
64
|
+
(list (current-buffer) stderr-file) nil arguments)))
|
|
65
|
+
(princ (buffer-string) stdout)
|
|
66
|
+
(with-temp-buffer
|
|
67
|
+
(insert-file-contents stderr-file)
|
|
68
|
+
(princ (buffer-string) #'external-debugging-output))
|
|
69
|
+
status))
|
|
70
|
+
(delete-file stderr-file))))
|
|
71
|
+
|
|
72
|
+
(defun eliscript-bootstrap-launch-command (root)
|
|
73
|
+
"Run the maintained seed build for ROOT, honoring its executable override."
|
|
74
|
+
(let* ((configured-output (getenv "ELISCRIPT_BOOTSTRAP_OUT_DIR"))
|
|
75
|
+
(output (if (and configured-output (> (length configured-output) 0))
|
|
76
|
+
configured-output (expand-file-name "dist/bootstrap" root)))
|
|
77
|
+
(modules '("symbol" "syntax" "reader" "formatter" "expander"
|
|
78
|
+
"transient-analysis" "analyzer" "ir" "lower" "source-map"
|
|
79
|
+
"emitter" "project" "compiler"))
|
|
80
|
+
(arguments (append (list root output) modules))
|
|
81
|
+
(configured-emacs (getenv "EMACS"))
|
|
82
|
+
(emacs (and configured-emacs (> (length configured-emacs) 0) configured-emacs)))
|
|
83
|
+
(setq command-line-args-left nil)
|
|
84
|
+
(if emacs
|
|
85
|
+
;; Honor the existing executable override without shell interpolation.
|
|
86
|
+
(condition-case error-data
|
|
87
|
+
(let ((status (eliscript-bootstrap--call-emacs
|
|
88
|
+
emacs
|
|
89
|
+
(append (list "--batch" "-Q" "--script"
|
|
90
|
+
(expand-file-name
|
|
91
|
+
"tools/bootstrap-seed.el" root)
|
|
92
|
+
"--") arguments))))
|
|
93
|
+
(kill-emacs (if (integerp status) status 1)))
|
|
94
|
+
(error (message "eliscript: %s" (error-message-string error-data))
|
|
95
|
+
(kill-emacs 1)))
|
|
96
|
+
(setq command-line-args-left (cons "--" arguments))
|
|
97
|
+
(load (expand-file-name "tools/bootstrap-seed.el" root) nil t)))
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
(provide 'eliscript-bootstrap-runtime)
|
|
101
|
+
;;; bootstrap-runtime.el ends here
|