eliscript 0.0.1 → 0.0.3
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 +61 -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.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 +732 -11
- package/browser/worker.mjs +6 -3
- 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 +1078 -0
- package/dist/browser/loader.js +1 -0
- package/dist/browser/loader.mjs +231 -0
- package/dist/browser/worker.mjs +63 -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 +639 -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 +40 -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 +25 -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 +494 -0
- package/dist/literal-sources/stdlib/managed-literals.eli +1469 -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 +106 -11
- 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 +172 -72
- package/stdlib/gepo.eli +12 -0
- package/stdlib/interop/js.eli +56 -15
- package/stdlib/managed-literal-protocols.eli +494 -0
- package/stdlib/managed-literals.eli +1469 -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 +639 -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 +40 -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 +25 -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 +462 -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 +493 -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,310 @@
|
|
|
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("constants"); return constants; }
|
|
5
|
+
function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("constants"); return __eliscript_const_error(); }
|
|
6
|
+
import "eliscript/runtime/unicode-case.mjs";
|
|
7
|
+
import "eliscript/runtime/math.mjs";
|
|
8
|
+
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
9
|
+
const __eliscript_number_intrinsic = globalThis.Number;
|
|
10
|
+
const __eliscript_bigint_intrinsic = globalThis.BigInt;
|
|
11
|
+
const __eliscript_numeric_apply = globalThis.Reflect.apply;
|
|
12
|
+
const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
|
|
13
|
+
const __eliscript_numeric_error = globalThis.TypeError;
|
|
14
|
+
const __eliscript_numeric_trim = globalThis.String.prototype.trim;
|
|
15
|
+
const __eliscript_numeric_slice = globalThis.String.prototype.slice;
|
|
16
|
+
const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
|
|
17
|
+
const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
|
|
18
|
+
const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
|
|
19
|
+
const __eliscript_numeric_primitive = (value) => {
|
|
20
|
+
if (!__eliscript_numeric_object(value)) return value;
|
|
21
|
+
const exotic = value[__eliscript_numeric_symbol];
|
|
22
|
+
if (exotic !== void 0 && exotic !== null) {
|
|
23
|
+
const result = __eliscript_numeric_apply(exotic, value, ["number"]);
|
|
24
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
25
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
26
|
+
}
|
|
27
|
+
for (let index = 0; index < 2; index++) {
|
|
28
|
+
const method = value[index === 0 ? "valueOf" : "toString"];
|
|
29
|
+
if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
|
|
30
|
+
const result = __eliscript_numeric_apply(method, value, []);
|
|
31
|
+
if (!__eliscript_numeric_object(result)) return result;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
throw new __eliscript_numeric_error("Cannot convert object to primitive value");
|
|
35
|
+
};
|
|
36
|
+
const __eliscript_to_number = (value) => {
|
|
37
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
38
|
+
if (typeof primitive === "string") {
|
|
39
|
+
const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
|
|
40
|
+
if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
|
|
41
|
+
let first = 2;
|
|
42
|
+
while (first < text.length && text[first] === "0") first++;
|
|
43
|
+
if (first === text.length) return 0;
|
|
44
|
+
const prefix = text[1];
|
|
45
|
+
const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
|
|
46
|
+
if (text.length - first > limit) return 1 / 0;
|
|
47
|
+
const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
|
|
48
|
+
return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return __eliscript_number_intrinsic(primitive);
|
|
52
|
+
};
|
|
53
|
+
const __eliscript_numeric = (value) => {
|
|
54
|
+
if (typeof value === "number" || typeof value === "bigint") return value;
|
|
55
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
56
|
+
if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
|
|
57
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
58
|
+
};
|
|
59
|
+
const __eliscript_implicit_number = (value) => {
|
|
60
|
+
if (typeof value === "number") return value;
|
|
61
|
+
const primitive = __eliscript_numeric_primitive(value);
|
|
62
|
+
if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
|
|
63
|
+
return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
|
|
64
|
+
};
|
|
65
|
+
const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
|
|
66
|
+
const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
|
|
67
|
+
const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
|
|
68
|
+
const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
|
|
69
|
+
const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
|
|
70
|
+
const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
|
|
71
|
+
const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
|
|
72
|
+
const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
|
|
73
|
+
const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
|
|
74
|
+
const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
|
|
75
|
+
const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
|
|
76
|
+
const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
|
|
77
|
+
const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
|
|
78
|
+
const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
|
|
79
|
+
const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
|
|
80
|
+
const __eliscript_numeric_relation = (operator, left, right) => {
|
|
81
|
+
if (typeof left === "number" && typeof right === "number") {
|
|
82
|
+
if (operator === "<") return left < right;
|
|
83
|
+
if (operator === "<=") return left <= right;
|
|
84
|
+
if (operator === ">") return left > right;
|
|
85
|
+
return left >= right;
|
|
86
|
+
}
|
|
87
|
+
let a = __eliscript_numeric_primitive(left);
|
|
88
|
+
let b = __eliscript_numeric_primitive(right);
|
|
89
|
+
const x = typeof a, y = typeof b;
|
|
90
|
+
if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
|
|
91
|
+
a = __eliscript_numeric(a);
|
|
92
|
+
b = __eliscript_numeric(b);
|
|
93
|
+
}
|
|
94
|
+
if (operator === "<") return a < b;
|
|
95
|
+
if (operator === "<=") return a <= b;
|
|
96
|
+
if (operator === ">") return a > b;
|
|
97
|
+
return a >= b;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
const constants = [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298];
|
|
101
|
+
__eliscript_tdz_ready_0 = true;
|
|
102
|
+
function rotate(x, n) {
|
|
103
|
+
return __eliscript_numeric_uint32(__eliscript_numeric_or(__eliscript_numeric_ushr(x, n), __eliscript_numeric_shl(x, __eliscript_numeric_sub(32, n))));
|
|
104
|
+
}
|
|
105
|
+
function big_word(output, value) {
|
|
106
|
+
return (output)["push"](__eliscript_numeric_ushr(value, 24), __eliscript_numeric_and(__eliscript_numeric_ushr(value, 16), 255), __eliscript_numeric_and(__eliscript_numeric_ushr(value, 8), 255), __eliscript_numeric_and(value, 255));
|
|
107
|
+
}
|
|
108
|
+
function compress_block(hash, words) {
|
|
109
|
+
{
|
|
110
|
+
const __eliscript_value_1 = 16;
|
|
111
|
+
{
|
|
112
|
+
let i = __eliscript_value_1;
|
|
113
|
+
while (__eliscript_numeric_relation("<", i, 64)) {
|
|
114
|
+
{
|
|
115
|
+
let x = ((((words) ?? [])[__eliscript_numeric_sub(i, 15)]) ?? null);
|
|
116
|
+
let y = ((((words) ?? [])[__eliscript_numeric_sub(i, 2)]) ?? null);
|
|
117
|
+
let s0 = __eliscript_numeric_xor(rotate(x, 7), __eliscript_numeric_xor(rotate(x, 18), __eliscript_numeric_ushr(x, 3)));
|
|
118
|
+
let s1 = __eliscript_numeric_xor(rotate(y, 17), __eliscript_numeric_xor(rotate(y, 19), __eliscript_numeric_ushr(y, 10)));
|
|
119
|
+
(words)["push"](__eliscript_numeric_uint32((((((words) ?? [])[__eliscript_numeric_sub(i, 16)]) ?? null) + s0 + ((((words) ?? [])[__eliscript_numeric_sub(i, 7)]) ?? null) + s1)));
|
|
120
|
+
}
|
|
121
|
+
((i = (i + 1)));
|
|
122
|
+
}
|
|
123
|
+
{
|
|
124
|
+
const __eliscript_value_2 = ((((hash) ?? [])[0]) ?? null);
|
|
125
|
+
const __eliscript_value_3 = ((((hash) ?? [])[1]) ?? null);
|
|
126
|
+
const __eliscript_value_4 = ((((hash) ?? [])[2]) ?? null);
|
|
127
|
+
const __eliscript_value_5 = ((((hash) ?? [])[3]) ?? null);
|
|
128
|
+
const __eliscript_value_6 = ((((hash) ?? [])[4]) ?? null);
|
|
129
|
+
const __eliscript_value_7 = ((((hash) ?? [])[5]) ?? null);
|
|
130
|
+
const __eliscript_value_8 = ((((hash) ?? [])[6]) ?? null);
|
|
131
|
+
const __eliscript_value_9 = ((((hash) ?? [])[7]) ?? null);
|
|
132
|
+
{
|
|
133
|
+
let a = __eliscript_value_2;
|
|
134
|
+
let b = __eliscript_value_3;
|
|
135
|
+
let c = __eliscript_value_4;
|
|
136
|
+
let d = __eliscript_value_5;
|
|
137
|
+
let e = __eliscript_value_6;
|
|
138
|
+
let f = __eliscript_value_7;
|
|
139
|
+
let g = __eliscript_value_8;
|
|
140
|
+
let h = __eliscript_value_9;
|
|
141
|
+
((i = 0));
|
|
142
|
+
while (__eliscript_numeric_relation("<", i, 64)) {
|
|
143
|
+
{
|
|
144
|
+
let s1 = __eliscript_numeric_xor(rotate(e, 6), __eliscript_numeric_xor(rotate(e, 11), rotate(e, 25)));
|
|
145
|
+
let ch = __eliscript_numeric_xor(__eliscript_numeric_and(e, f), __eliscript_numeric_and(__eliscript_numeric_xor(e, 4294967295), g));
|
|
146
|
+
let s0 = __eliscript_numeric_xor(rotate(a, 2), __eliscript_numeric_xor(rotate(a, 13), rotate(a, 22)));
|
|
147
|
+
let maj = __eliscript_numeric_xor(__eliscript_numeric_and(a, b), __eliscript_numeric_xor(__eliscript_numeric_and(a, c), __eliscript_numeric_and(b, c)));
|
|
148
|
+
let t1 = __eliscript_numeric_uint32((h + s1 + ch + (((((__eliscript_tdz_read_0())) ?? [])[i]) ?? null) + ((((words) ?? [])[i]) ?? null)));
|
|
149
|
+
let t2 = __eliscript_numeric_uint32((s0 + maj));
|
|
150
|
+
((h = g));
|
|
151
|
+
((g = f));
|
|
152
|
+
((f = e));
|
|
153
|
+
((e = __eliscript_numeric_uint32((d + t1))));
|
|
154
|
+
((d = c));
|
|
155
|
+
((c = b));
|
|
156
|
+
((b = a));
|
|
157
|
+
((a = __eliscript_numeric_uint32((t1 + t2))));
|
|
158
|
+
}
|
|
159
|
+
((i = (i + 1)));
|
|
160
|
+
}
|
|
161
|
+
{
|
|
162
|
+
const __eliscript_value_10 = [a, b, c, d, e, f, g, h];
|
|
163
|
+
{
|
|
164
|
+
let values = __eliscript_value_10;
|
|
165
|
+
((i = 0));
|
|
166
|
+
while (__eliscript_numeric_relation("<", i, 8)) {
|
|
167
|
+
(hash)["splice"](i, 1, __eliscript_numeric_uint32((((((hash) ?? [])[i]) ?? null) + ((((values) ?? [])[i]) ?? null))));
|
|
168
|
+
((i = (i + 1)));
|
|
169
|
+
}
|
|
170
|
+
return null;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
function hash_output(hash) {
|
|
179
|
+
{
|
|
180
|
+
const __eliscript_value_11 = [];
|
|
181
|
+
const __eliscript_value_12 = 0;
|
|
182
|
+
{
|
|
183
|
+
let output = __eliscript_value_11;
|
|
184
|
+
let i = __eliscript_value_12;
|
|
185
|
+
while (__eliscript_numeric_relation("<", i, 8)) {
|
|
186
|
+
big_word(output, ((((hash) ?? [])[i]) ?? null));
|
|
187
|
+
((i = (i + 1)));
|
|
188
|
+
}
|
|
189
|
+
return output;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
function sha256_bytes(input) {
|
|
194
|
+
{
|
|
195
|
+
let bytes = (input)["slice"]();
|
|
196
|
+
let length = ((bytes) ?? []).length;
|
|
197
|
+
let hash = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225];
|
|
198
|
+
let offset = 0;
|
|
199
|
+
(bytes)["push"](128);
|
|
200
|
+
while (((__eliscript_value_13, __eliscript_value_14) => (__eliscript_value_13 !== __eliscript_value_14))(__eliscript_numeric_and(((bytes) ?? []).length, 63), 56)) {
|
|
201
|
+
(bytes)["push"](0);
|
|
202
|
+
}
|
|
203
|
+
big_word(bytes, __eliscript_numeric_uint32(__eliscript_numeric_div(length, 536870912)));
|
|
204
|
+
big_word(bytes, __eliscript_numeric_uint32(__eliscript_numeric_mul(length, 8)));
|
|
205
|
+
while (__eliscript_numeric_relation("<", offset, ((bytes) ?? []).length)) {
|
|
206
|
+
{
|
|
207
|
+
const __eliscript_value_15 = [];
|
|
208
|
+
const __eliscript_value_16 = 0;
|
|
209
|
+
{
|
|
210
|
+
let words = __eliscript_value_15;
|
|
211
|
+
let i = __eliscript_value_16;
|
|
212
|
+
while (__eliscript_numeric_relation("<", i, 16)) {
|
|
213
|
+
{
|
|
214
|
+
const __eliscript_value_17 = (offset + __eliscript_numeric_mul(i, 4));
|
|
215
|
+
{
|
|
216
|
+
let at = __eliscript_value_17;
|
|
217
|
+
(words)["push"]((__eliscript_numeric_mul(((((bytes) ?? [])[at]) ?? null), 16777216) + __eliscript_numeric_mul(((((bytes) ?? [])[(at + 1)]) ?? null), 65536) + __eliscript_numeric_mul(((((bytes) ?? [])[(at + 2)]) ?? null), 256) + ((((bytes) ?? [])[(at + 3)]) ?? null)));
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
((i = (i + 1)));
|
|
221
|
+
}
|
|
222
|
+
compress_block(hash, words);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
((offset = (offset + 64)));
|
|
226
|
+
}
|
|
227
|
+
return hash_output(hash);
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
function sha256_words_le(input, reader = null) {
|
|
231
|
+
{
|
|
232
|
+
let length = ((input) ?? []).length;
|
|
233
|
+
let total = __eliscript_numeric_mul(16, (globalThis.Math)["ceil"](__eliscript_numeric_div((length + 3), 16)));
|
|
234
|
+
let high = __eliscript_numeric_uint32(__eliscript_numeric_div(length, 134217728));
|
|
235
|
+
let low = __eliscript_numeric_uint32(__eliscript_numeric_mul(length, 32));
|
|
236
|
+
let hash = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225];
|
|
237
|
+
let offset = 0;
|
|
238
|
+
while (__eliscript_numeric_relation("<", offset, total)) {
|
|
239
|
+
{
|
|
240
|
+
const __eliscript_value_18 = [];
|
|
241
|
+
const __eliscript_value_19 = 0;
|
|
242
|
+
{
|
|
243
|
+
let words = __eliscript_value_18;
|
|
244
|
+
let i = __eliscript_value_19;
|
|
245
|
+
while (__eliscript_numeric_relation("<", i, 16)) {
|
|
246
|
+
{
|
|
247
|
+
let at = (offset + i);
|
|
248
|
+
let value = (__eliscript_numeric_relation("<", at, length) ? ((word) => {
|
|
249
|
+
return __eliscript_numeric_uint32(__eliscript_numeric_or(__eliscript_numeric_shl(__eliscript_numeric_and(word, 255), 24), __eliscript_numeric_or(__eliscript_numeric_shl(__eliscript_numeric_and(word, 65280), 8), __eliscript_numeric_or(__eliscript_numeric_and(__eliscript_numeric_ushr(word, 8), 65280), __eliscript_numeric_ushr(word, 24)))));
|
|
250
|
+
})((__eliscript_truthy(reader) ? reader(input, at) : ((((input) ?? [])[at]) ?? null))) : ((at === length) ? 2147483648 : ((at === __eliscript_numeric_sub(total, 2)) ? high : ((at === __eliscript_numeric_decrement(total)) ? low : 0))));
|
|
251
|
+
(words)["push"](value);
|
|
252
|
+
}
|
|
253
|
+
((i = (i + 1)));
|
|
254
|
+
}
|
|
255
|
+
compress_block(hash, words);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
((offset = (offset + 16)));
|
|
259
|
+
}
|
|
260
|
+
return hash_output(hash);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
function sha256_string_utf16le(input) {
|
|
264
|
+
{
|
|
265
|
+
let length = __eliscript_numeric_mul(2, ((input) ?? []).length);
|
|
266
|
+
let total = __eliscript_numeric_mul(64, (globalThis.Math)["ceil"](__eliscript_numeric_div((length + 9), 64)));
|
|
267
|
+
let high = __eliscript_numeric_uint32(__eliscript_numeric_div(length, 536870912));
|
|
268
|
+
let low = __eliscript_numeric_uint32(__eliscript_numeric_mul(length, 8));
|
|
269
|
+
let hash = [1779033703, 3144134277, 1013904242, 2773480762, 1359893119, 2600822924, 528734635, 1541459225];
|
|
270
|
+
let offset = 0;
|
|
271
|
+
while (__eliscript_numeric_relation("<", offset, total)) {
|
|
272
|
+
{
|
|
273
|
+
const __eliscript_value_20 = [];
|
|
274
|
+
const __eliscript_value_21 = 0;
|
|
275
|
+
{
|
|
276
|
+
let words = __eliscript_value_20;
|
|
277
|
+
let i = __eliscript_value_21;
|
|
278
|
+
while (__eliscript_numeric_relation("<", i, 16)) {
|
|
279
|
+
{
|
|
280
|
+
let at = (offset + __eliscript_numeric_mul(i, 4));
|
|
281
|
+
let value = ((at === __eliscript_numeric_sub(total, 8)) ? high : ((at === __eliscript_numeric_sub(total, 4)) ? low : ((word, j) => {
|
|
282
|
+
while (__eliscript_numeric_relation("<", j, 4)) {
|
|
283
|
+
{
|
|
284
|
+
let byte_at = (at + j);
|
|
285
|
+
let byte = (__eliscript_numeric_relation("<", byte_at, length) ? ((unit) => {
|
|
286
|
+
if ((__eliscript_numeric_and(byte_at, 1) === 0)) {
|
|
287
|
+
return __eliscript_numeric_and(unit, 255);
|
|
288
|
+
} else {
|
|
289
|
+
return __eliscript_numeric_ushr(unit, 8);
|
|
290
|
+
}
|
|
291
|
+
})((input).charCodeAt((globalThis.Math)["floor"](__eliscript_numeric_div(byte_at, 2)))) : ((byte_at === length) ? 128 : 0));
|
|
292
|
+
((word = __eliscript_numeric_uint32((__eliscript_numeric_mul(word, 256) + byte))));
|
|
293
|
+
}
|
|
294
|
+
((j = (j + 1)));
|
|
295
|
+
}
|
|
296
|
+
return word;
|
|
297
|
+
})(0, 0)));
|
|
298
|
+
(words)["push"](value);
|
|
299
|
+
}
|
|
300
|
+
((i = (i + 1)));
|
|
301
|
+
}
|
|
302
|
+
compress_block(hash, words);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
((offset = (offset + 64)));
|
|
306
|
+
}
|
|
307
|
+
return hash_output(hash);
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
export {sha256_bytes, sha256_words_le, sha256_string_utf16le};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backends/sha256.mjs","sources":["bootstrap/backends/sha256.eli"],"sourcesContent":["(module eliscript.backend.sha256\n ;; Deterministic byte hashing for native image metadata and ad-hoc page\n ;; signatures. No host crypto API or external signing process is involved.\n (defconst constants (js-array\n 1116352408 1899447441 3049323471 3921009573 961987163 1508970993 2453635748 2870763221\n 3624381080 310598401 607225278 1426881987 1925078388 2162078206 2614888103 3248222580\n 3835390401 4022224774 264347078 604807628 770255983 1249150122 1555081692 1996064986\n 2554220882 2821834349 2952996808 3210313671 3336571891 3584528711 113926993 338241895\n 666307205 773529912 1294757372 1396182291 1695183700 1986661051 2177026350 2456956037\n 2730485921 2820302411 3259730800 3345764771 3516065817 3600352804 4094571909 275423344\n 430227734 506948616 659060556 883997877 958139571 1322822218 1537002063 1747873779\n 1955562222 2024104815 2227730452 2361852424 2428436474 2756734187 3204031479 3329325298))\n\n (defun rotate (x n)\n (uint32 (bit-or (unsigned-bit-shift-right x n) (bit-shift-left x (- 32 n)))))\n\n (defun big-word (output value)\n (js-call output :push (unsigned-bit-shift-right value 24)\n (bit-and (unsigned-bit-shift-right value 16) 255)\n (bit-and (unsigned-bit-shift-right value 8) 255) (bit-and value 255)))\n\n (defun compress-block (hash words)\n (let ((i 16))\n (while (< i 64)\n (let* ((x (js-nth (- i 15) words)) (y (js-nth (- i 2) words))\n (s0 (bit-xor (rotate x 7) (bit-xor (rotate x 18) (unsigned-bit-shift-right x 3))))\n (s1 (bit-xor (rotate y 17) (bit-xor (rotate y 19) (unsigned-bit-shift-right y 10)))))\n (js-call words :push (uint32 (+ (js-nth (- i 16) words) s0 (js-nth (- i 7) words) s1))))\n (setq i (1+ i)))\n (let ((a (js-nth 0 hash)) (b (js-nth 1 hash)) (c (js-nth 2 hash)) (d (js-nth 3 hash))\n (e (js-nth 4 hash)) (f (js-nth 5 hash)) (g (js-nth 6 hash)) (h (js-nth 7 hash)))\n (setq i 0)\n (while (< i 64)\n (let* ((s1 (bit-xor (rotate e 6) (bit-xor (rotate e 11) (rotate e 25))))\n (ch (bit-xor (bit-and e f) (bit-and (bit-xor e 4294967295) g)))\n (s0 (bit-xor (rotate a 2) (bit-xor (rotate a 13) (rotate a 22))))\n (maj (bit-xor (bit-and a b) (bit-xor (bit-and a c) (bit-and b c))))\n (t1 (uint32 (+ h s1 ch (js-nth i constants) (js-nth i words))))\n (t2 (uint32 (+ s0 maj))))\n (setq h g) (setq g f) (setq f e) (setq e (uint32 (+ d t1)))\n (setq d c) (setq c b) (setq b a) (setq a (uint32 (+ t1 t2))))\n (setq i (1+ i)))\n (let ((values (js-array a b c d e f g h)))\n (setq i 0)\n (while (< i 8)\n (js-call hash :splice i 1 (uint32 (+ (js-nth i hash) (js-nth i values))))\n (setq i (1+ i)))))))\n\n (defun hash-output (hash)\n (let ((output (js-array)) (i 0))\n (while (< i 8) (big-word output (js-nth i hash)) (setq i (1+ i)))\n output))\n\n (defun sha256-bytes (input)\n (let* ((bytes (js-call input :slice)) (length (js-length bytes))\n (hash (js-array 1779033703 3144134277 1013904242 2773480762\n 1359893119 2600822924 528734635 1541459225)) (offset 0))\n (js-call bytes :push 128)\n (while (/= (bit-and (js-length bytes) 63) 56) (js-call bytes :push 0))\n (big-word bytes (uint32 (/ length 536870912)))\n (big-word bytes (uint32 (* length 8)))\n (while (< offset (js-length bytes))\n (let ((words (js-array)) (i 0))\n (while (< i 16)\n (let ((at (+ offset (* i 4))))\n (js-call words :push (+ (* (js-nth at bytes) 16777216) (* (js-nth (+ at 1) bytes) 65536)\n (* (js-nth (+ at 2) bytes) 256) (js-nth (+ at 3) bytes))))\n (setq i (1+ i)))\n (compress-block hash words))\n (setq offset (+ offset 64)))\n (hash-output hash)))\n\n (defun sha256-words-le (input &optional reader)\n ;; Native words already own the complete image. Only one 64-word schedule\n ;; is materialized; message bytes and padding never duplicate that image.\n (let* ((length (js-length input))\n (total (* 16 (js-call globalThis.Math :ceil (/ (+ length 3) 16))))\n (high (uint32 (/ length 134217728))) (low (uint32 (* length 32)))\n (hash (js-array 1779033703 3144134277 1013904242 2773480762\n 1359893119 2600822924 528734635 1541459225)) (offset 0))\n (while (< offset total)\n (let ((words (js-array)) (i 0))\n (while (< i 16)\n (let* ((at (+ offset i))\n (value (cond\n ((< at length)\n (let ((word (if reader (funcall reader input at) (js-nth at input))))\n (uint32 (bit-or (bit-shift-left (bit-and word 255) 24)\n (bit-or (bit-shift-left (bit-and word 65280) 8)\n (bit-or (bit-and (unsigned-bit-shift-right word 8) 65280)\n (unsigned-bit-shift-right word 24)))))))\n ((= at length) 2147483648)\n ((= at (- total 2)) high)\n ((= at (1- total)) low)\n (t 0))))\n (js-call words :push value))\n (setq i (1+ i)))\n (compress-block hash words))\n (setq offset (+ offset 16)))\n (hash-output hash)))\n\n (defun sha256-string-utf16le (input)\n ;; Read the original code units in place. No UTF-8 replacement, whole\n ;; source byte array or padded copy can change lone surrogate identity.\n (let* ((length (* 2 (js-length input)))\n (total (* 64 (js-call globalThis.Math :ceil (/ (+ length 9) 64))))\n (high (uint32 (/ length 536870912))) (low (uint32 (* length 8)))\n (hash (js-array 1779033703 3144134277 1013904242 2773480762\n 1359893119 2600822924 528734635 1541459225)) (offset 0))\n (while (< offset total)\n (let ((words (js-array)) (i 0))\n (while (< i 16)\n (let* ((at (+ offset (* i 4)))\n (value (cond\n ((= at (- total 8)) high)\n ((= at (- total 4)) low)\n (t\n (let ((word 0) (j 0))\n (while (< j 4)\n (let* ((byte-at (+ at j))\n (byte (cond\n ((< byte-at length)\n (let ((unit (string-code-unit-at input\n (js-call globalThis.Math :floor (/ byte-at 2)))))\n (if (= (bit-and byte-at 1) 0) (bit-and unit 255)\n (unsigned-bit-shift-right unit 8))))\n ((= byte-at length) 128)\n (t 0))))\n (setq word (uint32 (+ (* word 256) byte))))\n (setq j (1+ j)))\n word)))))\n (js-call words :push value))\n (setq i (1+ i)))\n (compress-block hash words))\n (setq offset (+ offset 64)))\n (hash-output hash)))\n\n (export sha256-bytes sha256-words-le sha256-string-utf16le))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGE,kBAAoB,CAClB,YAAW,YAAW,YAAW,YAAW,WAAU,YAAW,YAAW,YAC5E,YAAW,WAAU,WAAU,YAAW,YAAW,YAAW,YAAW,YAC3E,YAAW,YAAW,WAAU,WAAU,WAAU,YAAW,YAAW,YAC1E,YAAW,YAAW,YAAW,YAAW,YAAW,YAAW,WAAU,WAC5E,WAAU,WAAU,YAAW,YAAW,YAAW,YAAW,YAAW,YAC3E,YAAW,YAAW,YAAW,YAAW,YAAW,YAAW,YAAW,WAC7E,WAAU,WAAU,WAAU,WAAU,WAAU,YAAW,YAAW,Y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