eliscript 0.1.3 → 0.1.4
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/COPYING.RUNTIME +93 -0
- package/README.md +15 -3
- package/bin/eliscript-test +29 -0
- package/bootstrap/backends/README.md +5 -4
- package/bootstrap/backends/binary.eli +89 -22
- package/bootstrap/backends/capabilities.eli +9 -4
- package/bootstrap/backends/managed-layout.eli +93 -81
- package/bootstrap/backends/managed.eli +651 -125
- package/bootstrap/backends/native.eli +1791 -324
- package/bootstrap/backends/numeric.eli +71 -7
- package/bootstrap/backends/sha256.eli +165 -68
- package/bootstrap/backends/wasm.eli +461 -52
- package/bootstrap/compiler/analyzer.eli +692 -2
- package/bootstrap/compiler/compiler.eli +16 -3
- package/bootstrap/compiler/emitter.eli +80 -35
- package/bootstrap/compiler/project.eli +175 -1
- package/bootstrap/compiler/transient-analysis.eli +2 -2
- package/bootstrap/host/build.eli +1 -0
- package/bootstrap/host/build.mjs +1 -1
- package/bootstrap/host/build.mjs.map +1 -1
- package/bootstrap/host/bun.mjs +7 -9
- package/bootstrap/host/bun.mjs.map +1 -1
- package/bootstrap/host/check-cli-ground.eli +47 -5
- package/bootstrap/host/check-cli-ground.mjs +60 -19
- package/bootstrap/host/check-cli-ground.mjs.map +1 -1
- package/bootstrap/host/check-cli.mjs +41 -1
- package/bootstrap/host/check-cli.mjs.map +1 -1
- package/bootstrap/host/compiler-session.eli +136 -22
- package/bootstrap/host/eliscript-cli.mjs +1 -1
- package/bootstrap/host/eliscript-cli.mjs.map +1 -1
- package/bootstrap/host/evaluation-cli.eli +33 -1
- package/bootstrap/host/evaluation-cli.mjs +65 -28
- package/bootstrap/host/evaluation-cli.mjs.map +1 -1
- package/bootstrap/host/evaluation.eli +651 -42
- package/bootstrap/host/evaluation.mjs +884 -72
- package/bootstrap/host/evaluation.mjs.map +1 -1
- package/bootstrap/host/project-cli-ground.eli +6 -1
- package/bootstrap/host/project-cli-ground.mjs +33 -32
- package/bootstrap/host/project-cli-ground.mjs.map +1 -1
- package/bootstrap/host/project-cli.mjs +1 -1
- package/bootstrap/host/project-cli.mjs.map +1 -1
- package/bootstrap/host/project-ground.eli +266 -45
- package/bootstrap/host/project-ground.mjs +429 -159
- package/bootstrap/host/project-ground.mjs.map +1 -1
- package/bootstrap/host/project.mjs +30 -40
- package/bootstrap/host/project.mjs.map +1 -1
- package/bootstrap/host/test-cli.eli +379 -0
- package/bootstrap/host/test-cli.mjs +494 -0
- package/bootstrap/host/test-cli.mjs.map +1 -0
- package/browser/README.md +7 -0
- package/browser/host.mjs +21 -29
- package/browser/host.mjs.map +1 -1
- package/browser/worker.mjs +7 -9
- package/browser/worker.mjs.map +1 -1
- package/compiler/eliscript-analyzer.el +694 -0
- package/compiler/eliscript-cli.el +66 -22
- package/compiler/eliscript-emitter.el +67 -43
- package/compiler/eliscript-ir-emitter.el +71 -36
- package/compiler/eliscript-project.el +360 -80
- package/compiler/eliscript-transient-analysis.el +5 -5
- package/compiler/eliscript.el +6 -0
- package/dist/backends/binary.mjs +148 -26
- package/dist/backends/binary.mjs.map +1 -1
- package/dist/backends/capabilities.mjs +11 -4
- package/dist/backends/capabilities.mjs.map +1 -1
- package/dist/backends/elf.mjs +4 -4
- package/dist/backends/elf.mjs.map +1 -1
- package/dist/backends/managed-layout.mjs +53 -56
- package/dist/backends/managed-layout.mjs.map +1 -1
- package/dist/backends/managed.mjs +1116 -375
- package/dist/backends/managed.mjs.map +1 -1
- package/dist/backends/memory.mjs +24 -26
- package/dist/backends/memory.mjs.map +1 -1
- package/dist/backends/native.mjs +2529 -434
- package/dist/backends/native.mjs.map +1 -1
- package/dist/backends/numeric.mjs +140 -33
- package/dist/backends/numeric.mjs.map +1 -1
- package/dist/backends/optimize.mjs +2 -2
- package/dist/backends/optimize.mjs.map +1 -1
- package/dist/backends/regexp.mjs +33 -35
- package/dist/backends/regexp.mjs.map +1 -1
- package/dist/backends/sha256.mjs +159 -59
- package/dist/backends/sha256.mjs.map +1 -1
- package/dist/backends/wasm.mjs +609 -73
- package/dist/backends/wasm.mjs.map +1 -1
- package/dist/bootstrap/analyzer.mjs +1018 -2
- package/dist/bootstrap/analyzer.mjs.map +1 -1
- package/dist/bootstrap/compiler.mjs +30 -23
- package/dist/bootstrap/compiler.mjs.map +1 -1
- package/dist/bootstrap/emitter.mjs +206 -161
- package/dist/bootstrap/emitter.mjs.macro-origins.json +16 -16
- package/dist/bootstrap/emitter.mjs.map +1 -1
- package/dist/bootstrap/expander.mjs +27 -31
- package/dist/bootstrap/expander.mjs.map +1 -1
- package/dist/bootstrap/ir.mjs +22 -24
- package/dist/bootstrap/ir.mjs.map +1 -1
- package/dist/bootstrap/project.mjs +246 -1
- package/dist/bootstrap/project.mjs.map +1 -1
- package/dist/bootstrap/reader.mjs +2 -2
- package/dist/bootstrap/reader.mjs.map +1 -1
- package/dist/bootstrap/source-map.mjs +34 -48
- package/dist/bootstrap/source-map.mjs.map +1 -1
- package/dist/bootstrap/transient-analysis.mjs +2 -2
- package/dist/bootstrap/transient-analysis.mjs.map +1 -1
- package/dist/browser/compiler.js +106 -106
- package/dist/browser/host.mjs +21 -29
- package/dist/browser/loader.js +1 -1
- package/dist/browser/worker.mjs +95 -95
- package/dist/compiler-artifact.json +1 -1
- package/dist/host/compiler-session.mjs +405 -228
- package/dist/host/compiler-session.mjs.map +1 -1
- package/dist/host/compiler-tools.mjs +44 -46
- package/dist/host/compiler-tools.mjs.map +1 -1
- package/dist/literal-sources/runtime/core/array-map.eli +45 -0
- package/dist/literal-sources/runtime/core/collection-internals.eli +22 -2
- package/dist/literal-sources/runtime/core/collection.eli +282 -23
- package/dist/literal-sources/runtime/core/data-text.eli +196 -13
- package/dist/literal-sources/runtime/core/data.eli +1 -1
- package/dist/literal-sources/runtime/core/identifier.eli +1 -1
- package/dist/literal-sources/runtime/core/lazy-sequence.eli +822 -44
- package/dist/literal-sources/runtime/core/list.eli +1 -1
- package/dist/literal-sources/runtime/core/map.eli +1 -1
- package/dist/literal-sources/runtime/core/metadata-internals.eli +2 -2
- package/dist/literal-sources/runtime/core/metadata.eli +2 -2
- package/dist/literal-sources/{stdlib/core/object.eli → runtime/core/object-impl.eli} +6 -6
- package/dist/literal-sources/runtime/core/object.eli +1 -1
- package/dist/literal-sources/runtime/core/order.eli +3 -3
- package/dist/literal-sources/runtime/core/persistent-kind.eli +1 -1
- package/dist/literal-sources/{stdlib/core/protocol.eli → runtime/core/protocol-impl.eli} +2 -2
- package/dist/literal-sources/runtime/core/protocol.eli +5 -3
- package/dist/literal-sources/runtime/core/queue.eli +1 -1
- package/dist/literal-sources/runtime/core/record.eli +3 -3
- package/dist/literal-sources/runtime/core/regex.eli +2 -2
- package/dist/literal-sources/runtime/core/sequence.eli +1 -1
- package/dist/literal-sources/runtime/core/set-algebra.eli +1 -1
- package/dist/literal-sources/runtime/core/set.eli +1 -1
- package/dist/literal-sources/runtime/core/sorted.eli +4 -4
- package/dist/literal-sources/{stdlib/core/text.eli → runtime/core/text-impl.eli} +2 -2
- package/dist/literal-sources/runtime/core/text.eli +1 -1
- package/dist/literal-sources/runtime/core/transducer.eli +24 -2
- package/dist/literal-sources/runtime/core/transient.eli +7 -5
- package/dist/literal-sources/runtime/core/type.eli +1 -1
- package/dist/literal-sources/runtime/core/value-internals.eli +3 -3
- package/dist/literal-sources/runtime/core/value.eli +2 -2
- package/dist/literal-sources/runtime/core/vector.eli +5 -2
- package/dist/literal-sources/{stdlib → runtime/managed}/managed-literal-protocols.eli +100 -34
- package/dist/literal-sources/{stdlib → runtime/managed}/managed-literals.eli +406 -81
- package/{stdlib → dist/literal-sources/runtime/managed}/managed-queue-state.eli +1 -1
- package/{stdlib → dist/literal-sources/runtime/managed}/managed-sorted-state.eli +1 -1
- package/dist/literal-sources/runtime/managed/managed-transient-state.eli +1206 -0
- package/{stdlib → dist/literal-sources/runtime/managed}/managed-value-state.eli +30 -6
- package/dist/literal-sources/{stdlib → runtime/managed}/managed-vector-view-state.eli +1 -1
- package/dist/literal-sources/runtime/wire/http-rpc.eli +1 -1
- package/dist/literal-sources/runtime/wire/markdown.eli +1 -1
- package/dist/literal-sources/runtime/wire/schema.eli +1 -1
- package/dist/literal-sources/stdlib/bit.eli +89 -1
- package/dist/literal-sources/stdlib/data.eli +522 -0
- package/dist/literal-sources/stdlib/interop/object.eli +39 -0
- package/dist/literal-sources/stdlib/persistent-list.eli +60 -21
- package/dist/literal-sources/stdlib/persistent-map.eli +335 -324
- package/dist/literal-sources/stdlib/persistent-set.eli +8 -6
- package/dist/literal-sources/stdlib/persistent-vector.eli +18 -18
- package/dist/literal-sources/stdlib/protocol.eli +63 -0
- package/{stdlib/core → dist/literal-sources/stdlib}/set.eli +8 -8
- package/dist/literal-sources/stdlib/string.eli +362 -0
- package/dist/runtime/lisp/async-runtime.mjs +55 -59
- package/dist/runtime/lisp/async-runtime.mjs.map +1 -1
- package/dist/runtime/lisp/builtins.mjs +232 -280
- package/dist/runtime/lisp/builtins.mjs.map +1 -1
- package/dist/runtime/lisp/cli.mjs +159 -167
- package/dist/runtime/lisp/cli.mjs.map +1 -1
- package/dist/runtime/lisp/compiler.mjs +359 -419
- package/dist/runtime/lisp/compiler.mjs.map +1 -1
- package/dist/runtime/lisp/core.mjs +24 -24
- package/dist/runtime/lisp/core.mjs.map +1 -1
- package/dist/runtime/lisp/evaluator.mjs +315 -385
- package/dist/runtime/lisp/evaluator.mjs.map +1 -1
- package/dist/runtime/lisp/extensions.mjs +85 -103
- package/dist/runtime/lisp/extensions.mjs.map +1 -1
- package/dist/runtime/lisp/host-io.mjs +106 -122
- package/dist/runtime/lisp/host-io.mjs.map +1 -1
- package/dist/runtime/lisp/io-worker.mjs +117 -135
- package/dist/runtime/lisp/io-worker.mjs.map +1 -1
- package/dist/runtime/lisp/keymap.mjs +5 -5
- package/dist/runtime/lisp/keymap.mjs.map +1 -1
- package/dist/runtime/lisp/macros-forms.mjs +49 -51
- package/dist/runtime/lisp/macros-forms.mjs.map +1 -1
- package/dist/runtime/lisp/reader-format.mjs +31 -31
- package/dist/runtime/lisp/reader-format.mjs.map +1 -1
- package/dist/runtime/lisp/regexp-buffer.mjs +9 -9
- package/dist/runtime/lisp/regexp-buffer.mjs.map +1 -1
- package/dist/runtime/math.mjs +32 -38
- package/dist/runtime/math.mjs.map +1 -1
- package/dist/runtime/number-radix.mjs +5 -7
- package/dist/runtime/number-radix.mjs.map +1 -1
- package/dist/runtime/primitives.mjs +81 -46
- package/dist/runtime/primitives.mjs.macro-origins.json +294 -44
- package/dist/runtime/primitives.mjs.map +1 -1
- package/dist/runtime/unicode-case.mjs +6 -6
- package/dist/runtime/unicode-case.mjs.map +1 -1
- package/dist/runtime.eli +3068 -1882
- package/dist/stage3-release.json +1 -1
- package/dist/stdlib/async.mjs +1838 -0
- package/dist/stdlib/bit.mjs +116 -0
- package/dist/stdlib/collection.mjs +193 -0
- package/dist/stdlib/core.mjs +28 -0
- package/dist/stdlib/data-text.mjs +54 -0
- package/dist/stdlib/data.mjs +601 -0
- package/dist/stdlib/devtools.mjs +565 -0
- package/dist/stdlib/diff.mjs +180 -0
- package/dist/stdlib/fn.mjs +164 -0
- package/dist/stdlib/hierarchy.mjs +189 -0
- package/dist/stdlib/identifier.mjs +33 -0
- package/dist/stdlib/interop/js.mjs +706 -0
- package/dist/stdlib/interop/object.mjs +40 -0
- package/dist/stdlib/json.mjs +843 -0
- package/dist/stdlib/lazy-sequence.mjs +117 -0
- package/dist/stdlib/math.mjs +386 -0
- package/dist/stdlib/meta.mjs +21 -0
- package/dist/stdlib/multimethod.mjs +345 -0
- package/dist/stdlib/numeric.mjs +327 -0
- package/dist/stdlib/order.mjs +194 -0
- package/dist/stdlib/persistent-list.mjs +171 -0
- package/dist/stdlib/persistent-map.mjs +781 -0
- package/dist/stdlib/persistent-queue.mjs +44 -0
- package/dist/stdlib/persistent-set.mjs +225 -0
- package/dist/stdlib/persistent-vector.mjs +316 -0
- package/dist/stdlib/portable/data-text.mjs +1094 -0
- package/dist/stdlib/portable/data.mjs +62 -0
- package/dist/stdlib/portable/identifier.mjs +179 -0
- package/dist/stdlib/portable/metadata.mjs +63 -0
- package/dist/stdlib/portable/object.mjs +140 -0
- package/dist/stdlib/portable/sequence.mjs +142 -0
- package/dist/stdlib/portable/text.mjs +111 -0
- package/dist/stdlib/pprint.mjs +807 -0
- package/dist/stdlib/protocol.mjs +61 -0
- package/dist/stdlib/record.mjs +25 -0
- package/dist/stdlib/regex.mjs +115 -0
- package/dist/stdlib/result.mjs +198 -0
- package/dist/stdlib/schema.mjs +2828 -0
- package/dist/stdlib/seq.mjs +913 -0
- package/dist/stdlib/set.mjs +317 -0
- package/dist/stdlib/sorted.mjs +56 -0
- package/dist/stdlib/state.mjs +451 -0
- package/dist/stdlib/string.mjs +494 -0
- package/dist/stdlib/tap.mjs +187 -0
- package/dist/stdlib/test.mjs +669 -0
- package/dist/stdlib/time.mjs +522 -0
- package/dist/stdlib/transducer.mjs +85 -0
- package/dist/stdlib/transient.mjs +32 -0
- package/dist/stdlib/type.mjs +28 -0
- package/dist/stdlib/uuid.mjs +377 -0
- package/dist/stdlib/value.mjs +334 -0
- package/dist/stdlib/walk.mjs +243 -0
- package/dist/stdlib/wire/gepo.mjs +28 -0
- package/dist/stdlib/wire/mdp.mjs +13 -0
- package/dist/stdlib/wire/mds.mjs +10 -0
- package/dist/stdlib/zipper.mjs +1025 -0
- package/editor/README.md +15 -0
- package/editor/eliscript-data.el +221 -8
- package/editor/eliscript-mode.el +207 -48
- package/editor/eliscript-runtime.el +6 -3
- package/package.json +49 -15
- package/platform/README.md +6 -0
- package/platform/browser.mjs +10 -12
- package/platform/browser.mjs.map +1 -1
- package/runtime/README.md +12 -5
- package/runtime/core/array-map.eli +538 -0
- package/runtime/core/array-map.mjs +651 -0
- package/runtime/core/array-map.mjs.map +1 -0
- package/runtime/core/collection-internals.eli +85 -33
- package/runtime/core/collection-internals.mjs +245 -193
- package/runtime/core/collection-internals.mjs.map +1 -1
- package/runtime/core/collection.eli +105 -3
- package/runtime/core/collection.mjs +190 -53
- package/runtime/core/collection.mjs.map +1 -1
- package/runtime/core/data-text.eli +224 -16
- package/runtime/core/data-text.mjs +345 -83
- package/runtime/core/data-text.mjs.map +1 -1
- package/runtime/core/data.eli +50 -33
- package/runtime/core/data.mjs +72 -36
- package/runtime/core/data.mjs.map +1 -1
- package/runtime/core/identifier.mjs +15 -19
- package/runtime/core/identifier.mjs.map +1 -1
- package/runtime/core/lazy-sequence.eli +885 -15
- package/runtime/core/lazy-sequence.mjs +1265 -38
- package/runtime/core/lazy-sequence.mjs.map +1 -1
- package/runtime/core/map-internals.eli +209 -1
- package/runtime/core/map-internals.mjs +359 -71
- package/runtime/core/map-internals.mjs.map +1 -1
- package/runtime/core/map.eli +75 -7
- package/runtime/core/map.mjs +122 -47
- package/runtime/core/map.mjs.map +1 -1
- package/{stdlib/core/object.eli → runtime/core/object-impl.eli} +6 -6
- package/runtime/core/object-impl.mjs +5 -5
- package/runtime/core/object-impl.mjs.map +1 -1
- package/runtime/core/order.eli +15 -3
- package/runtime/core/order.mjs +23 -8
- package/runtime/core/order.mjs.map +1 -1
- package/runtime/core/persistent-kind.mjs +9 -13
- package/runtime/core/persistent-kind.mjs.map +1 -1
- package/runtime/core/protocol-error.mjs +9 -11
- package/runtime/core/protocol-error.mjs.map +1 -1
- package/{stdlib/core/protocol.eli → runtime/core/protocol-impl.eli} +2 -2
- package/runtime/core/protocol-impl.mjs +10 -10
- package/runtime/core/protocol-impl.mjs.map +1 -1
- package/runtime/core/queue.mjs +14 -16
- package/runtime/core/queue.mjs.map +1 -1
- package/runtime/core/record.eli +2 -2
- package/runtime/core/record.mjs +13 -17
- package/runtime/core/record.mjs.map +1 -1
- package/runtime/core/regex.mjs +18 -22
- package/runtime/core/regex.mjs.map +1 -1
- package/runtime/core/sequence.eli +33 -31
- package/runtime/core/sequence.mjs +60 -93
- package/runtime/core/sequence.mjs.map +1 -1
- package/runtime/core/set.eli +53 -27
- package/runtime/core/set.mjs +113 -82
- package/runtime/core/set.mjs.map +1 -1
- package/runtime/core/sorted.mjs +91 -108
- package/runtime/core/sorted.mjs.map +1 -1
- package/{stdlib/core/text.eli → runtime/core/text-impl.eli} +2 -2
- package/runtime/core/text-impl.mjs +1 -1
- package/runtime/core/text-impl.mjs.map +1 -1
- package/runtime/core/transducer.eli +24 -0
- package/runtime/core/transducer.mjs +27 -1
- package/runtime/core/transducer.mjs.map +1 -1
- package/runtime/core/transient-internals.eli +12 -4
- package/runtime/core/transient-internals.mjs +19 -6
- package/runtime/core/transient-internals.mjs.map +1 -1
- package/runtime/core/transient.eli +31 -0
- package/runtime/core/transient.mjs +33 -2
- package/runtime/core/transient.mjs.map +1 -1
- package/runtime/core/value-internals.mjs +29 -35
- package/runtime/core/value-internals.mjs.map +1 -1
- package/runtime/core/vector.eli +73 -20
- package/runtime/core/vector.mjs +159 -156
- package/runtime/core/vector.mjs.map +1 -1
- package/runtime/literals.eli +16 -9
- package/runtime/literals.mjs +25 -9
- package/runtime/literals.mjs.map +1 -1
- package/{stdlib → runtime/managed}/managed-literal-protocols.eli +100 -34
- package/{stdlib → runtime/managed}/managed-literals.eli +406 -81
- package/{dist/literal-sources/stdlib → runtime/managed}/managed-queue-state.eli +1 -1
- package/runtime/managed/managed-runtime-array-map.eli +45 -0
- package/{stdlib → runtime/managed}/managed-runtime-collection-internals.eli +22 -2
- package/{stdlib → runtime/managed}/managed-runtime-collection.eli +282 -23
- package/{stdlib → runtime/managed}/managed-runtime-data-text.eli +196 -13
- package/{stdlib → runtime/managed}/managed-runtime-data.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-identifier.eli +1 -1
- package/runtime/managed/managed-runtime-lazy-sequence.eli +935 -0
- package/{stdlib → runtime/managed}/managed-runtime-list.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-map.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-metadata-internals.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-metadata.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-object.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-order.eli +3 -3
- package/{stdlib → runtime/managed}/managed-runtime-persistent-kind.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-protocol.eli +5 -3
- package/{stdlib → runtime/managed}/managed-runtime-queue.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-record.eli +3 -3
- package/{stdlib → runtime/managed}/managed-runtime-regex.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-sequence.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-set-algebra.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-set.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-sorted.eli +4 -4
- package/{stdlib → runtime/managed}/managed-runtime-text.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-transducer.eli +24 -2
- package/{stdlib → runtime/managed}/managed-runtime-transient.eli +7 -5
- package/{stdlib → runtime/managed}/managed-runtime-type.eli +1 -1
- package/{stdlib → runtime/managed}/managed-runtime-value-internals.eli +3 -3
- package/{stdlib → runtime/managed}/managed-runtime-value.eli +2 -2
- package/{stdlib → runtime/managed}/managed-runtime-vector.eli +5 -2
- package/{dist/literal-sources/stdlib → runtime/managed}/managed-sorted-state.eli +1 -1
- package/runtime/managed/managed-transient-state.eli +1206 -0
- package/{dist/literal-sources/stdlib → runtime/managed}/managed-value-state.eli +30 -6
- package/{stdlib → runtime/managed}/managed-vector-view-state.eli +1 -1
- package/{stdlib → runtime/managed}/managed-wire-http-rpc.eli +1 -1
- package/{stdlib → runtime/managed}/managed-wire-markdown.eli +1 -1
- package/{stdlib → runtime/managed}/managed-wire-schema.eli +1 -1
- package/runtime/math.mjs +32 -38
- package/runtime/math.mjs.map +1 -1
- package/runtime/number-radix.mjs +5 -7
- package/runtime/number-radix.mjs.map +1 -1
- package/runtime/primitives.eli +19 -6
- package/runtime/primitives.mjs +81 -46
- package/runtime/primitives.mjs.map +1 -1
- package/runtime/source-mapping.mjs +17 -23
- package/runtime/source-mapping.mjs.map +1 -1
- package/runtime/testing/map.eli +70 -41
- package/runtime/testing/map.mjs +57 -34
- package/runtime/testing/map.mjs.map +1 -1
- package/runtime/unicode-case.mjs +6 -6
- package/runtime/unicode-case.mjs.map +1 -1
- package/runtime/wire/http-rpc.mjs +12 -18
- package/runtime/wire/http-rpc.mjs.map +1 -1
- package/runtime/wire/markdown.mjs +42 -42
- package/runtime/wire/markdown.mjs.map +1 -1
- package/runtime/wire/schema.mjs +13 -13
- package/runtime/wire/schema.mjs.map +1 -1
- package/runtime/worker-value-codec.mjs +5 -7
- package/runtime/worker-value-codec.mjs.map +1 -1
- package/runtime/worker-value-stream.mjs +128 -135
- package/runtime/worker-value-stream.mjs.map +1 -1
- package/runtime/worker.mjs +75 -89
- package/runtime/worker.mjs.map +1 -1
- package/stdlib/README.md +25 -18
- package/stdlib/async.eli +1245 -0
- package/stdlib/bit.eli +89 -1
- package/stdlib/bit.mjs +89 -2
- package/stdlib/bit.mjs.map +1 -1
- package/stdlib/{core/collection.eli → collection.eli} +39 -4
- package/stdlib/core.eli +956 -0
- package/stdlib/data-text.eli +62 -1091
- package/stdlib/data.eli +517 -37
- package/stdlib/devtools.eli +399 -0
- package/stdlib/diff.eli +134 -0
- package/stdlib/{function.eli → fn.eli} +1 -1
- package/stdlib/identifier.eli +21 -136
- package/stdlib/interop/object.eli +39 -0
- package/stdlib/{core/lazy-sequence.eli → lazy-sequence.eli} +28 -2
- package/stdlib/math.eli +267 -0
- package/stdlib/{core/metadata.eli → meta.eli} +2 -2
- package/stdlib/{core/order.eli → order.eli} +6 -6
- package/stdlib/persistent-list.eli +60 -21
- package/stdlib/persistent-map.eli +335 -324
- package/stdlib/persistent-set.eli +8 -6
- package/stdlib/persistent-vector.eli +18 -18
- package/stdlib/portable/data-text.eli +1092 -0
- package/stdlib/portable/data.eli +42 -0
- package/stdlib/portable/identifier.eli +147 -0
- package/stdlib/{metadata.eli → portable/metadata.eli} +5 -5
- package/stdlib/{object.eli → portable/object.eli} +1 -1
- package/stdlib/{sequence.eli → portable/sequence.eli} +1 -1
- package/stdlib/{text.eli → portable/text.eli} +1 -1
- package/stdlib/pprint.eli +588 -0
- package/stdlib/protocol.eli +63 -0
- package/stdlib/{core/record.eli → record.eli} +2 -2
- package/stdlib/regex.eli +70 -0
- package/stdlib/result.eli +53 -44
- package/stdlib/schema.eli +1886 -0
- package/stdlib/{core/seq.eli → seq.eli} +97 -90
- package/{dist/literal-sources/stdlib/core → stdlib}/set.eli +8 -8
- package/stdlib/{core/sorted.eli → sorted.eli} +2 -2
- package/stdlib/{state/atom.eli → state.eli} +137 -7
- package/stdlib/string.eli +362 -0
- package/stdlib/tap.eli +135 -0
- package/stdlib/test.eli +566 -0
- package/stdlib/time.eli +419 -0
- package/stdlib/{core/transducer.eli → transducer.eli} +4 -2
- package/stdlib/{core/transient.eli → transient.eli} +11 -5
- package/stdlib/{core/type.eli → type.eli} +2 -2
- package/stdlib/uuid.eli +288 -0
- package/stdlib/{core/walk.eli → walk.eli} +6 -6
- package/stdlib/{gepo.eli → wire/gepo.eli} +2 -2
- package/stdlib/{mdp.eli → wire/mdp.eli} +2 -2
- package/stdlib/{mds.eli → wire/mds.eli} +2 -2
- package/stdlib/{core/zipper.eli → zipper.eli} +179 -138
- package/tests/helpers/wasm-managed-math-node.mjs +495 -582
- package/tools/acceptance/check-ground.mjs +106 -132
- package/tools/acceptance/check.mjs +16 -16
- package/tools/acceptance/retained-performance-snapshot.mjs +265 -149
- package/tools/acceptance/retained-soak.mjs +5 -7
- package/tools/acceptance/retained-transient.mjs +5 -7
- package/tools/backends/build.mjs +373 -95
- package/tools/backends/compiler-bootstrap.mjs +271 -317
- package/tools/backends/compiler-browser.mjs +7 -9
- package/tools/backends/compiler-build.mjs +77 -97
- package/tools/backends/compiler-cli-ground.mjs +47 -47
- package/tools/backends/compiler-data-transport.mjs +27 -31
- package/tools/backends/compiler-host-iteration.mjs +13 -21
- package/tools/backends/compiler-host-record.mjs +28 -34
- package/tools/backends/compiler-metadata.mjs +145 -53
- package/tools/backends/compiler-package-ground.mjs +39 -47
- package/tools/backends/compiler-package-loader.mjs +164 -206
- package/tools/backends/compiler-session.mjs +432 -324
- package/tools/backends/compiler-worker.mjs +79 -89
- package/tools/backends/dist/bootstrap-js-stages.mjs +17 -19
- package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -1
- package/tools/backends/dist/managed-ir-inventory.mjs +1 -1
- package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -1
- package/tools/backends/dist/release-cli.mjs +151 -22
- package/tools/backends/dist/release-cli.mjs.map +1 -1
- package/tools/backends/dist/run-artifact.mjs +54 -76
- package/tools/backends/dist/run-artifact.mjs.map +1 -1
- package/tools/backends/managed-foreign-binding.mjs +370 -114
- package/tools/backends/managed-host-ground.mjs +14 -17
- package/tools/backends/managed-host-lifecycle.mjs +42 -53
- package/tools/backends/managed-host-object-realm.mjs +121 -111
- package/tools/backends/managed-host-proxy.mjs +5 -7
- package/tools/backends/managed-host-runtime.mjs +6295 -4350
- package/tools/backends/managed-host.mjs +234 -188
- package/tools/backends/managed-layout.mjs +53 -56
- package/tools/backends/managed-module-graph-ground.mjs +488 -568
- package/tools/backends/managed-module-graph.mjs +62 -76
- package/tools/backends/managed-runtime-host-ground.mjs +352 -400
- package/tools/backends/managed-runtime.mjs +227 -266
- package/tools/backends/managed-source-view-ground.mjs +165 -161
- package/tools/backends/managed-source-view.mjs +415 -154
- package/tools/backends/native-managed-runtime.mjs +96 -138
- package/tools/backends/native-memory.mjs +1122 -742
- package/tools/backends/native-node-ffi.mjs +2439 -0
- package/tools/backends/native-node-memory.mjs +793 -383
- package/tools/backends/native-node-runner.mjs +1458 -579
- package/tools/backends/native-node-watchdog.mjs +12 -14
- package/tools/backends/native-node-worker.mjs +46 -50
- package/tools/backends/stage3-targets.mjs +2 -2
- package/tools/bootstrap-runtime.el +4 -4
- package/tools/collections/transient-builder-benchmark.mjs +17 -17
- package/tools/project/check-cli.eli +27 -3
- package/tools/project/project-cli.eli +1 -1
- package/tools/testing/maintained-suite-source.mjs +5 -7
- package/tools/testing/maintained-suite-source.mjs.map +1 -1
- package/dist/literal-sources/stdlib/core/data.eli +0 -306
- package/dist/literal-sources/stdlib/managed-transient-state.eli +0 -353
- package/stdlib/core/data-text.eli +0 -16
- package/stdlib/core/data.eli +0 -306
- package/stdlib/core/identifier.eli +0 -32
- package/stdlib/core/regex.eli +0 -17
- package/stdlib/deferred.eli +0 -70
- package/stdlib/managed-runtime-lazy-sequence.eli +0 -157
- package/stdlib/managed-transient-state.eli +0 -353
- /package/{stdlib → runtime/managed}/managed-protocol-error.eli +0 -0
- /package/{stdlib → runtime/managed}/managed-runtime-literals.eli +0 -0
- /package/{stdlib → runtime/managed}/managed-runtime-truth.eli +0 -0
- /package/{stdlib → runtime/managed}/managed-testing-value.eli +0 -0
|
@@ -16,7 +16,7 @@ const __eliscript_truthy = (value) => value !== false && value != null;
|
|
|
16
16
|
import {instantiateManagedRuntime} from "./managed-runtime.mjs";
|
|
17
17
|
const names = Object.freeze(({"create": "compiler_session_new", "request": "compiler_session_request", "close": "compiler_session_close"}));
|
|
18
18
|
__eliscript_tdz_ready_0 = true;
|
|
19
|
-
const compilerHeap = Object.freeze(({"
|
|
19
|
+
const compilerHeap = Object.freeze(({"initialBytes": 8388608, "maxBytes": 67108864}));
|
|
20
20
|
__eliscript_tdz_ready_1 = true;
|
|
21
21
|
const compilerMemory = Object.freeze(({"initialPages": 128, "maximumPages": 4096}));
|
|
22
22
|
__eliscript_tdz_ready_2 = true;
|
|
@@ -233,20 +233,20 @@ function decodeCompilerSourceAsset(bytes, ...rest) {
|
|
|
233
233
|
}
|
|
234
234
|
function check_signal(signal) {
|
|
235
235
|
if ((!(signal === undefined))) {
|
|
236
|
-
if (((signal === null) || ((
|
|
237
|
-
((
|
|
236
|
+
if (((signal === null) || (__eliscript_value_type(signal) !== "object") || (__eliscript_value_type((signal)["aborted"]) !== "boolean"))) {
|
|
237
|
+
((__eliscript_value_5) => { throw __eliscript_value_5; })(new (globalThis.TypeError)("compiler request requires an AbortSignal"));
|
|
238
238
|
}
|
|
239
239
|
if ((__eliscript_value_type((signal)["throwIfAborted"]) === "function")) {
|
|
240
240
|
return (signal)["throwIfAborted"]();
|
|
241
241
|
} else {
|
|
242
242
|
if (__eliscript_truthy((signal)["aborted"])) {
|
|
243
243
|
if (!(((signal)["reason"] === undefined))) {
|
|
244
|
-
return ((
|
|
244
|
+
return ((__eliscript_value_6) => { throw __eliscript_value_6; })((signal)["reason"]);
|
|
245
245
|
} else {
|
|
246
246
|
{
|
|
247
247
|
let error = new (globalThis.Error)("compiler request aborted");
|
|
248
248
|
((error)["name"] = "AbortError");
|
|
249
|
-
return ((
|
|
249
|
+
return ((__eliscript_value_7) => { throw __eliscript_value_7; })(error);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
252
252
|
} else {
|
|
@@ -267,7 +267,7 @@ function compiler_response_events(graph_arg = null, string_chunks_arg = null) {
|
|
|
267
267
|
let references = [];
|
|
268
268
|
let active_references = new (globalThis.Set)();
|
|
269
269
|
let invalid = (() => {
|
|
270
|
-
return ((
|
|
270
|
+
return ((__eliscript_value_8) => { throw __eliscript_value_8; })(new (globalThis.TypeError)("compiler returned invalid response events"));
|
|
271
271
|
});
|
|
272
272
|
let attach = ((value) => {
|
|
273
273
|
if ((((frames) ?? []).length === 0)) {
|
|
@@ -468,7 +468,7 @@ function encode_request(request) {
|
|
|
468
468
|
return request;
|
|
469
469
|
} else {
|
|
470
470
|
if (((request === undefined) || (kind === "function") || (kind === "symbol"))) {
|
|
471
|
-
((
|
|
471
|
+
((__eliscript_value_9) => { throw __eliscript_value_9; })(new (globalThis.TypeError)("compiler request must contain JSON data"));
|
|
472
472
|
}
|
|
473
473
|
return encodeCompilerIR(request);
|
|
474
474
|
}
|
|
@@ -481,6 +481,8 @@ function encode_compiler_data(program, metadata, consume = null) {
|
|
|
481
481
|
let frames = [];
|
|
482
482
|
let quoted_strings = new (globalThis.Map)();
|
|
483
483
|
let short_quotes = new (globalThis.Map)();
|
|
484
|
+
let short_key_first = new (globalThis.Map)();
|
|
485
|
+
let short_key_rest = new (globalThis.Map)();
|
|
484
486
|
let emit = ((consume == null) ? ((text) => {
|
|
485
487
|
return (chunks)["push"](text);
|
|
486
488
|
}) : consume);
|
|
@@ -508,7 +510,7 @@ function encode_compiler_data(program, metadata, consume = null) {
|
|
|
508
510
|
} else {
|
|
509
511
|
(pending)["push"](text);
|
|
510
512
|
((pending_units = (pending_units + ((text) ?? []).length)));
|
|
511
|
-
if ((__eliscript_numeric_relation(">=", ((pending) ?? []).length,
|
|
513
|
+
if ((__eliscript_numeric_relation(">=", ((pending) ?? []).length, 8192) || __eliscript_numeric_relation(">=", pending_units, 131072))) {
|
|
512
514
|
return flush();
|
|
513
515
|
} else {
|
|
514
516
|
return null;
|
|
@@ -613,6 +615,27 @@ function encode_compiler_data(program, metadata, consume = null) {
|
|
|
613
615
|
}
|
|
614
616
|
}
|
|
615
617
|
});
|
|
618
|
+
let push_key = ((key, is_first) => {
|
|
619
|
+
if (__eliscript_numeric_relation("<", ((key) ?? []).length, large_token_units)) {
|
|
620
|
+
{
|
|
621
|
+
let table = (__eliscript_truthy(is_first) ? short_key_first : short_key_rest);
|
|
622
|
+
let cached_key = (table)["get"](key);
|
|
623
|
+
if ((cached_key === undefined)) {
|
|
624
|
+
((cached_key = (String((__eliscript_truthy(is_first) ? "" : ",")) + String(quote_str(key)) + String(":"))));
|
|
625
|
+
if (__eliscript_numeric_relation("<", (table)["size"], 4096)) {
|
|
626
|
+
(table)["set"](key, cached_key);
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
return push(cached_key);
|
|
630
|
+
}
|
|
631
|
+
} else {
|
|
632
|
+
if ((!__eliscript_truthy(is_first))) {
|
|
633
|
+
push(",");
|
|
634
|
+
}
|
|
635
|
+
push_quoted(key);
|
|
636
|
+
return push(":");
|
|
637
|
+
}
|
|
638
|
+
});
|
|
616
639
|
let append = ((value, array_element = null) => {
|
|
617
640
|
if ((value === null)) {
|
|
618
641
|
push("null");
|
|
@@ -634,7 +657,7 @@ function encode_compiler_data(program, metadata, consume = null) {
|
|
|
634
657
|
} else {
|
|
635
658
|
if ((kind === "bigint")) {
|
|
636
659
|
if ((!(metadata === true))) {
|
|
637
|
-
((
|
|
660
|
+
((__eliscript_value_10) => { throw __eliscript_value_10; })(new (globalThis.TypeError)("compiler IR cannot contain BigInt values"));
|
|
638
661
|
}
|
|
639
662
|
push_quoted((String(value)));
|
|
640
663
|
return true;
|
|
@@ -646,7 +669,7 @@ function encode_compiler_data(program, metadata, consume = null) {
|
|
|
646
669
|
return false;
|
|
647
670
|
} else {
|
|
648
671
|
if (((ancestors)["has"](value) === true)) {
|
|
649
|
-
((
|
|
672
|
+
((__eliscript_value_11) => { throw __eliscript_value_11; })(new (globalThis.TypeError)("compiler IR cannot contain cycles"));
|
|
650
673
|
}
|
|
651
674
|
(ancestors)["add"](value);
|
|
652
675
|
if ((Array.isArray(value) === true)) {
|
|
@@ -665,52 +688,180 @@ function encode_compiler_data(program, metadata, consume = null) {
|
|
|
665
688
|
}
|
|
666
689
|
}
|
|
667
690
|
});
|
|
668
|
-
|
|
669
|
-
((
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
691
|
+
let drain_frames = (() => {
|
|
692
|
+
while (__eliscript_numeric_relation(">", ((frames) ?? []).length, 0)) {
|
|
693
|
+
{
|
|
694
|
+
let frame = (frames)[__eliscript_numeric_decrement(((frames) ?? []).length)];
|
|
695
|
+
if (((frame)["array"] === true)) {
|
|
696
|
+
if (__eliscript_numeric_relation("<", (frame)["index"], (((frame)["value"]) ?? []).length)) {
|
|
697
|
+
{
|
|
698
|
+
let index = (frame)["index"];
|
|
699
|
+
((frame)["index"] = (index + 1));
|
|
700
|
+
if (__eliscript_numeric_relation(">", index, 0)) {
|
|
701
|
+
push(",");
|
|
702
|
+
}
|
|
703
|
+
append(((frame)["value"])[index], true);
|
|
681
704
|
}
|
|
682
|
-
|
|
705
|
+
} else {
|
|
706
|
+
push("]");
|
|
707
|
+
(ancestors)["delete"]((frame)["value"]);
|
|
708
|
+
(frames)["pop"]();
|
|
683
709
|
}
|
|
684
710
|
} else {
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
((frame)["index"] = (index + 1));
|
|
697
|
-
if ((!((item === undefined) || (item_kind === "function") || (item_kind === "symbol")))) {
|
|
698
|
-
if ((!((frame)["first"] === true))) {
|
|
699
|
-
push(",");
|
|
711
|
+
if (__eliscript_numeric_relation("<", (frame)["index"], (((frame)["keys"]) ?? []).length)) {
|
|
712
|
+
{
|
|
713
|
+
let index = (frame)["index"];
|
|
714
|
+
let key = ((frame)["keys"])[index];
|
|
715
|
+
let item = ((frame)["value"])[key];
|
|
716
|
+
let item_kind = session_value_type(item);
|
|
717
|
+
((frame)["index"] = (index + 1));
|
|
718
|
+
if ((!((item === undefined) || (item_kind === "function") || (item_kind === "symbol")))) {
|
|
719
|
+
push_key(key, ((frame)["first"] === true));
|
|
720
|
+
((frame)["first"] = false);
|
|
721
|
+
append(item, false);
|
|
700
722
|
}
|
|
701
|
-
((frame)["first"] = false);
|
|
702
|
-
push_quoted(key);
|
|
703
|
-
push(":");
|
|
704
|
-
append(item, false);
|
|
705
723
|
}
|
|
724
|
+
} else {
|
|
725
|
+
push("}");
|
|
726
|
+
(ancestors)["delete"]((frame)["value"]);
|
|
727
|
+
(frames)["pop"]();
|
|
706
728
|
}
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
return null;
|
|
733
|
+
});
|
|
734
|
+
let emit_rec = null;
|
|
735
|
+
((emit_rec = ((value, array_element, depth) => {
|
|
736
|
+
if ((value === null)) {
|
|
737
|
+
push("null");
|
|
738
|
+
return true;
|
|
739
|
+
} else {
|
|
740
|
+
{
|
|
741
|
+
let kind = session_value_type(value);
|
|
742
|
+
if ((kind === "number")) {
|
|
743
|
+
push((((value === 0) && __eliscript_numeric_relation("<", __eliscript_numeric_div(1, value), 0)) ? "-0" : ((Number.isFinite(value) === true) ? (String(value)) : "null")));
|
|
744
|
+
return true;
|
|
707
745
|
} else {
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
746
|
+
if ((kind === "string")) {
|
|
747
|
+
push_quoted(value);
|
|
748
|
+
return true;
|
|
749
|
+
} else {
|
|
750
|
+
if ((kind === "boolean")) {
|
|
751
|
+
push(((value === true) ? "true" : "false"));
|
|
752
|
+
return true;
|
|
753
|
+
} else {
|
|
754
|
+
if ((kind === "bigint")) {
|
|
755
|
+
if ((!(metadata === true))) {
|
|
756
|
+
((__eliscript_value_12) => { throw __eliscript_value_12; })(new (globalThis.TypeError)("compiler IR cannot contain BigInt values"));
|
|
757
|
+
}
|
|
758
|
+
push_quoted((String(value)));
|
|
759
|
+
return true;
|
|
760
|
+
} else {
|
|
761
|
+
if (!((kind === "object"))) {
|
|
762
|
+
if ((array_element === true)) {
|
|
763
|
+
push("null");
|
|
764
|
+
}
|
|
765
|
+
return false;
|
|
766
|
+
} else {
|
|
767
|
+
if (__eliscript_numeric_relation(">=", depth, 96)) {
|
|
768
|
+
append(value, array_element);
|
|
769
|
+
drain_frames();
|
|
770
|
+
return true;
|
|
771
|
+
} else {
|
|
772
|
+
if (((ancestors)["has"](value) === true)) {
|
|
773
|
+
((__eliscript_value_13) => { throw __eliscript_value_13; })(new (globalThis.TypeError)("compiler IR cannot contain cycles"));
|
|
774
|
+
}
|
|
775
|
+
(ancestors)["add"](value);
|
|
776
|
+
if ((Array.isArray(value) === true)) {
|
|
777
|
+
{
|
|
778
|
+
let i = 0;
|
|
779
|
+
push("[");
|
|
780
|
+
while (__eliscript_numeric_relation("<", i, ((value) ?? []).length)) {
|
|
781
|
+
if (__eliscript_numeric_relation(">", i, 0)) {
|
|
782
|
+
push(",");
|
|
783
|
+
}
|
|
784
|
+
emit_rec((value)[i], true, (depth + 1));
|
|
785
|
+
((i = (i + 1)));
|
|
786
|
+
}
|
|
787
|
+
push("]");
|
|
788
|
+
}
|
|
789
|
+
} else {
|
|
790
|
+
{
|
|
791
|
+
let keys = Object.keys(value);
|
|
792
|
+
let len = ((keys) ?? []).length;
|
|
793
|
+
let i = 0;
|
|
794
|
+
let first = true;
|
|
795
|
+
push("{");
|
|
796
|
+
while (__eliscript_numeric_relation("<", i, len)) {
|
|
797
|
+
{
|
|
798
|
+
let key = (keys)[i];
|
|
799
|
+
let item = (value)[key];
|
|
800
|
+
if ((item === null)) {
|
|
801
|
+
push_key(key, first);
|
|
802
|
+
((first = false));
|
|
803
|
+
push("null");
|
|
804
|
+
} else {
|
|
805
|
+
{
|
|
806
|
+
let item_kind = session_value_type(item);
|
|
807
|
+
if ((item_kind === "string")) {
|
|
808
|
+
push_key(key, first);
|
|
809
|
+
((first = false));
|
|
810
|
+
push_quoted(item);
|
|
811
|
+
} else {
|
|
812
|
+
if ((item_kind === "number")) {
|
|
813
|
+
push_key(key, first);
|
|
814
|
+
((first = false));
|
|
815
|
+
push((((item === 0) && __eliscript_numeric_relation("<", __eliscript_numeric_div(1, item), 0)) ? "-0" : ((Number.isFinite(item) === true) ? (String(item)) : "null")));
|
|
816
|
+
} else {
|
|
817
|
+
if ((item_kind === "boolean")) {
|
|
818
|
+
push_key(key, first);
|
|
819
|
+
((first = false));
|
|
820
|
+
push(((item === true) ? "true" : "false"));
|
|
821
|
+
} else {
|
|
822
|
+
if ((item_kind === "object")) {
|
|
823
|
+
push_key(key, first);
|
|
824
|
+
((first = false));
|
|
825
|
+
emit_rec(item, false, (depth + 1));
|
|
826
|
+
} else {
|
|
827
|
+
if ((item_kind === "bigint")) {
|
|
828
|
+
if ((!(metadata === true))) {
|
|
829
|
+
((__eliscript_value_14) => { throw __eliscript_value_14; })(new (globalThis.TypeError)("compiler IR cannot contain BigInt values"));
|
|
830
|
+
}
|
|
831
|
+
push_key(key, first);
|
|
832
|
+
((first = false));
|
|
833
|
+
push_quoted((String(item)));
|
|
834
|
+
} else {
|
|
835
|
+
null;
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
}
|
|
844
|
+
((i = (i + 1)));
|
|
845
|
+
}
|
|
846
|
+
push("}");
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
(ancestors)["delete"](value);
|
|
850
|
+
return true;
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
}
|
|
711
856
|
}
|
|
712
857
|
}
|
|
713
858
|
}
|
|
859
|
+
})));
|
|
860
|
+
if ((!(emit_rec(program, false, 0) === true))) {
|
|
861
|
+
((__eliscript_value_15) => { throw __eliscript_value_15; })(new (globalThis.TypeError)("compiler IR must be JSON data"));
|
|
862
|
+
}
|
|
863
|
+
if (__eliscript_numeric_relation(">", ((frames) ?? []).length, 0)) {
|
|
864
|
+
drain_frames();
|
|
714
865
|
}
|
|
715
866
|
flush();
|
|
716
867
|
if ((chunks === undefined)) {
|
|
@@ -728,13 +879,13 @@ function encodeCompilerMetadata(value) {
|
|
|
728
879
|
}
|
|
729
880
|
function forEachCompilerMetadataChunk(value, consume) {
|
|
730
881
|
if ((!(session_value_type(consume) === "function"))) {
|
|
731
|
-
((
|
|
882
|
+
((__eliscript_value_16) => { throw __eliscript_value_16; })(new (globalThis.TypeError)("compiler metadata chunk consumer must be a function"));
|
|
732
883
|
}
|
|
733
884
|
return encode_compiler_data(value, true, consume);
|
|
734
885
|
}
|
|
735
886
|
function forEachCompilerIRChunk(value, consume) {
|
|
736
887
|
if ((!(session_value_type(consume) === "function"))) {
|
|
737
|
-
((
|
|
888
|
+
((__eliscript_value_17) => { throw __eliscript_value_17; })(new (globalThis.TypeError)("compiler IR chunk consumer must be a function"));
|
|
738
889
|
}
|
|
739
890
|
return encode_compiler_data(value, false, consume);
|
|
740
891
|
}
|
|
@@ -743,7 +894,7 @@ function compilerOwnedDataMemo(...rest_args) {
|
|
|
743
894
|
let segment_size_arg = (rest_args)[0];
|
|
744
895
|
let segment_size = ((segment_size_arg === undefined) ? 1048576 : segment_size_arg);
|
|
745
896
|
if ((!((Number.isSafeInteger(segment_size) === true) && (Math.min(Math.max(segment_size, 1), 1048576) === segment_size)))) {
|
|
746
|
-
((
|
|
897
|
+
((__eliscript_value_18) => { throw __eliscript_value_18; })(new (globalThis.TypeError)("invalid owned compiler memo segment size"));
|
|
747
898
|
}
|
|
748
899
|
{
|
|
749
900
|
let segments = [new (globalThis.Map)()];
|
|
@@ -796,7 +947,7 @@ function ownedCompilerDataNormalizer(...rest_args) {
|
|
|
796
947
|
let segment_size = ((segment_size_opt === undefined) ? 1048576 : segment_size_opt);
|
|
797
948
|
let complete_limit = ((complete_limit_opt === undefined) ? 65536 : complete_limit_opt);
|
|
798
949
|
if ((!((Number.isSafeInteger(complete_limit) === true) && (Math.min(Math.max(complete_limit, 1), 65536) === complete_limit)))) {
|
|
799
|
-
((
|
|
950
|
+
((__eliscript_value_19) => { throw __eliscript_value_19; })(new (globalThis.TypeError)("invalid owned compiler completion cache size"));
|
|
800
951
|
}
|
|
801
952
|
{
|
|
802
953
|
let omitted = globalThis.Symbol("omitted compiler field");
|
|
@@ -847,7 +998,7 @@ function ownedCompilerDataNormalizer(...rest_args) {
|
|
|
847
998
|
{
|
|
848
999
|
let kind = __eliscript_value_type(value);
|
|
849
1000
|
if ((kind === "bigint")) {
|
|
850
|
-
return ((
|
|
1001
|
+
return ((__eliscript_value_20) => { throw __eliscript_value_20; })(new (globalThis.TypeError)("compiler IR cannot contain BigInt values"));
|
|
851
1002
|
} else {
|
|
852
1003
|
if ((kind === "number")) {
|
|
853
1004
|
if ((Number.isFinite(value) === true)) {
|
|
@@ -874,7 +1025,7 @@ function ownedCompilerDataNormalizer(...rest_args) {
|
|
|
874
1025
|
{
|
|
875
1026
|
let result = scalar(root, false);
|
|
876
1027
|
if ((result === omitted)) {
|
|
877
|
-
((
|
|
1028
|
+
((__eliscript_value_21) => { throw __eliscript_value_21; })(new (globalThis.TypeError)("compiler IR must be JSON data"));
|
|
878
1029
|
}
|
|
879
1030
|
return result;
|
|
880
1031
|
}
|
|
@@ -911,7 +1062,7 @@ function ownedCompilerDataNormalizer(...rest_args) {
|
|
|
911
1062
|
((frame)["index"] = (idx + 1));
|
|
912
1063
|
if ((!((property === undefined)) && !((Object.hasOwn(property, "value") === true)))) {
|
|
913
1064
|
Reflect.get((frame)["value"], key);
|
|
914
|
-
((
|
|
1065
|
+
((__eliscript_value_22) => { throw __eliscript_value_22; })(new (globalThis.TypeError)("owned compiler data must contain data properties"));
|
|
915
1066
|
}
|
|
916
1067
|
{
|
|
917
1068
|
let value = Reflect.get((frame)["value"], key);
|
|
@@ -926,7 +1077,7 @@ function ownedCompilerDataNormalizer(...rest_args) {
|
|
|
926
1077
|
}
|
|
927
1078
|
if ((!((normalized === null) || !((__eliscript_value_type(normalized) === "object"))))) {
|
|
928
1079
|
if (((active)["has"](value) === true)) {
|
|
929
|
-
((
|
|
1080
|
+
((__eliscript_value_23) => { throw __eliscript_value_23; })(new (globalThis.TypeError)("compiler IR cannot contain cycles"));
|
|
930
1081
|
}
|
|
931
1082
|
{
|
|
932
1083
|
let borrowed = (((frame)["borrowed"] === true) || (key === "source") || (key === "span") || (key === "macroOrigins") || (key === "hostCapabilities"));
|
|
@@ -992,46 +1143,40 @@ function withRoots(runtime, operation) {
|
|
|
992
1143
|
let result = undefined;
|
|
993
1144
|
let failed = false;
|
|
994
1145
|
let failure = undefined;
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
}
|
|
1007
|
-
})();
|
|
1146
|
+
try {
|
|
1147
|
+
((result = operation(((value) => {
|
|
1148
|
+
if ((!((value == null)) && (__eliscript_value_type(value) === "object"))) {
|
|
1149
|
+
(roots)["push"](value);
|
|
1150
|
+
}
|
|
1151
|
+
return value;
|
|
1152
|
+
}))));
|
|
1153
|
+
} catch (error) {
|
|
1154
|
+
((failed = true));
|
|
1155
|
+
((failure = error));
|
|
1156
|
+
}
|
|
1008
1157
|
{
|
|
1009
1158
|
let i = __eliscript_numeric_decrement(((roots) ?? []).length);
|
|
1010
1159
|
while (__eliscript_numeric_relation(">=", i, 0)) {
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
return ((failure = error));
|
|
1018
|
-
} else {
|
|
1019
|
-
return null;
|
|
1020
|
-
}
|
|
1160
|
+
try {
|
|
1161
|
+
(runtime)["release"]((roots)[i]);
|
|
1162
|
+
} catch (error) {
|
|
1163
|
+
if ((!__eliscript_truthy(failed))) {
|
|
1164
|
+
((failed = true));
|
|
1165
|
+
((failure = error));
|
|
1021
1166
|
}
|
|
1022
|
-
}
|
|
1167
|
+
}
|
|
1023
1168
|
((i = __eliscript_numeric_decrement(i)));
|
|
1024
1169
|
}
|
|
1025
1170
|
}
|
|
1026
1171
|
if (__eliscript_truthy(failed)) {
|
|
1027
|
-
((
|
|
1172
|
+
((__eliscript_value_24) => { throw __eliscript_value_24; })(failure);
|
|
1028
1173
|
}
|
|
1029
1174
|
return result;
|
|
1030
1175
|
}
|
|
1031
1176
|
}
|
|
1032
1177
|
function property(runtime, object, name, read, options = null) {
|
|
1033
1178
|
{
|
|
1034
|
-
let optional_engine_stack = ((
|
|
1179
|
+
let optional_engine_stack = ((__eliscript_value_25) => (__eliscript_truthy(__eliscript_value_25) ? (options)["optionalEngineStack"] : __eliscript_value_25))((!(options == null)));
|
|
1035
1180
|
return withRoots(runtime, ((own) => {
|
|
1036
1181
|
{
|
|
1037
1182
|
let key = own((runtime)["string"](name));
|
|
@@ -1071,7 +1216,7 @@ function diagnostic_data(runtime, value, ancestors_arg = null, memo = null) {
|
|
|
1071
1216
|
if ((__eliscript_numeric_relation(">=", ((ancestors) ?? []).length, 64) || __eliscript_truthy((ancestors)["some"](((parent) => {
|
|
1072
1217
|
return (runtime)["keyEqual"](parent, value);
|
|
1073
1218
|
}))))) {
|
|
1074
|
-
((
|
|
1219
|
+
((__eliscript_value_26) => { throw __eliscript_value_26; })(new (globalThis.TypeError)("compiler diagnostic is cyclic or exceeds its nesting limit"));
|
|
1075
1220
|
}
|
|
1076
1221
|
{
|
|
1077
1222
|
let completed = (__eliscript_truthy(memo) ? ((memo)["entries"])["find"](((entry) => {
|
|
@@ -1101,7 +1246,7 @@ function diagnostic_data(runtime, value, ancestors_arg = null, memo = null) {
|
|
|
1101
1246
|
}
|
|
1102
1247
|
} else {
|
|
1103
1248
|
if ((!(kind === 13))) {
|
|
1104
|
-
((
|
|
1249
|
+
((__eliscript_value_27) => { throw __eliscript_value_27; })(new (globalThis.TypeError)("compiler diagnostic contains an opaque value"));
|
|
1105
1250
|
}
|
|
1106
1251
|
return withRoots(runtime, ((own) => {
|
|
1107
1252
|
{
|
|
@@ -1146,7 +1291,7 @@ function exception_entries(runtime, value, ancestors, memo) {
|
|
|
1146
1291
|
if ((__eliscript_numeric_relation(">=", ((ancestors) ?? []).length, 64) || __eliscript_truthy((ancestors)["some"](((parent) => {
|
|
1147
1292
|
return (runtime)["keyEqual"](parent, value);
|
|
1148
1293
|
}))))) {
|
|
1149
|
-
((
|
|
1294
|
+
((__eliscript_value_28) => { throw __eliscript_value_28; })(new (globalThis.TypeError)("compiler exception errors are cyclic or exceed their nesting limit"));
|
|
1150
1295
|
}
|
|
1151
1296
|
{
|
|
1152
1297
|
let completed = ((memo)["entries"])["find"](((entry) => {
|
|
@@ -1198,13 +1343,13 @@ function source_exception(runtime, value, ancestors_arg = null, memo = null) {
|
|
|
1198
1343
|
if (__eliscript_truthy(([7, 8, 14])["includes"]((value)["kind"]))) {
|
|
1199
1344
|
return exception_entries(runtime, value, ancestors, memo);
|
|
1200
1345
|
} else {
|
|
1201
|
-
if (((
|
|
1346
|
+
if (((value)["kind"] !== 13)) {
|
|
1202
1347
|
return diagnostic_data(runtime, value, ancestors, memo);
|
|
1203
1348
|
} else {
|
|
1204
1349
|
if ((__eliscript_numeric_relation(">=", ((ancestors) ?? []).length, 64) || __eliscript_truthy((ancestors)["some"](((parent) => {
|
|
1205
1350
|
return (runtime)["keyEqual"](parent, value);
|
|
1206
1351
|
}))))) {
|
|
1207
|
-
((
|
|
1352
|
+
((__eliscript_value_29) => { throw __eliscript_value_29; })(new (globalThis.TypeError)("compiler exception cause is cyclic or exceeds its nesting limit"));
|
|
1208
1353
|
}
|
|
1209
1354
|
{
|
|
1210
1355
|
let completed = ((memo)["entries"])["find"](((entry) => {
|
|
@@ -1313,53 +1458,39 @@ function source_exception(runtime, value, ancestors_arg = null, memo = null) {
|
|
|
1313
1458
|
}
|
|
1314
1459
|
((source_exception_fn = source_exception));
|
|
1315
1460
|
function transfer_error(runtime, error) {
|
|
1316
|
-
if ((!(__eliscript_truthy(runtime)) || (error === null) || ((
|
|
1461
|
+
if ((!(__eliscript_truthy(runtime)) || (error === null) || (__eliscript_value_type(error) !== "object") || (__eliscript_value_type((error)["kind"]) !== "number") || __eliscript_truthy(__eliscript_at(globalThis.Error, (globalThis.Symbol)["hasInstance"])(error)))) {
|
|
1317
1462
|
return error;
|
|
1318
1463
|
} else {
|
|
1319
1464
|
{
|
|
1320
1465
|
let result = undefined;
|
|
1321
1466
|
let release = true;
|
|
1322
|
-
|
|
1467
|
+
try {
|
|
1468
|
+
((result = source_exception(runtime, error)));
|
|
1469
|
+
} catch (conversion_error) {
|
|
1323
1470
|
try {
|
|
1324
|
-
|
|
1325
|
-
} catch (
|
|
1326
|
-
((
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1471
|
+
((result = (runtime)["toHostValue"](error)));
|
|
1472
|
+
} catch (ignored) {
|
|
1473
|
+
((result = error));
|
|
1474
|
+
((release = false));
|
|
1475
|
+
}
|
|
1476
|
+
if ((!((conversion_error === error)) && !((conversion_error == null)) && !(((conversion_error)["kind"] === undefined)))) {
|
|
1477
|
+
try {
|
|
1478
|
+
(runtime)["release"](conversion_error);
|
|
1479
|
+
} catch (ignored) {
|
|
1480
|
+
null;
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
} finally {
|
|
1484
|
+
try {
|
|
1485
|
+
if (__eliscript_truthy(release)) {
|
|
1486
|
+
(runtime)["release"](error);
|
|
1487
|
+
}
|
|
1488
|
+
} catch (release_error) {
|
|
1489
|
+
if (__eliscript_truthy(__eliscript_at(globalThis.Error, (globalThis.Symbol)["hasInstance"])(result))) {
|
|
1490
|
+
((result)["releaseError"] = release_error);
|
|
1344
1491
|
}
|
|
1345
|
-
} finally {
|
|
1346
|
-
(() => {
|
|
1347
|
-
try {
|
|
1348
|
-
if (__eliscript_truthy(release)) {
|
|
1349
|
-
return (runtime)["release"](error);
|
|
1350
|
-
} else {
|
|
1351
|
-
return null;
|
|
1352
|
-
}
|
|
1353
|
-
} catch (release_error) {
|
|
1354
|
-
if (__eliscript_truthy(__eliscript_at(globalThis.Error, (globalThis.Symbol)["hasInstance"])(result))) {
|
|
1355
|
-
return ((result)["releaseError"] = release_error);
|
|
1356
|
-
} else {
|
|
1357
|
-
return null;
|
|
1358
|
-
}
|
|
1359
|
-
}
|
|
1360
|
-
})();
|
|
1361
1492
|
}
|
|
1362
|
-
}
|
|
1493
|
+
}
|
|
1363
1494
|
return result;
|
|
1364
1495
|
}
|
|
1365
1496
|
}
|
|
@@ -1370,21 +1501,19 @@ function close_compiler_session_owned(runtime, driver, state, has_state) {
|
|
|
1370
1501
|
let failure = undefined;
|
|
1371
1502
|
let attempt = null;
|
|
1372
1503
|
((attempt = ((operation) => {
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
return null;
|
|
1384
|
-
}
|
|
1504
|
+
try {
|
|
1505
|
+
return operation();
|
|
1506
|
+
} catch (error) {
|
|
1507
|
+
{
|
|
1508
|
+
let transferred = transfer_error(runtime, error);
|
|
1509
|
+
if ((!__eliscript_truthy(failed))) {
|
|
1510
|
+
((failed = true));
|
|
1511
|
+
return ((failure = transferred));
|
|
1512
|
+
} else {
|
|
1513
|
+
return null;
|
|
1385
1514
|
}
|
|
1386
1515
|
}
|
|
1387
|
-
}
|
|
1516
|
+
}
|
|
1388
1517
|
})));
|
|
1389
1518
|
if (__eliscript_truthy(has_state)) {
|
|
1390
1519
|
if (__eliscript_truthy(runtime)) {
|
|
@@ -1419,7 +1548,7 @@ function close_compiler_session_owned(runtime, driver, state, has_state) {
|
|
|
1419
1548
|
}));
|
|
1420
1549
|
}
|
|
1421
1550
|
if (__eliscript_truthy(failed)) {
|
|
1422
|
-
return ((
|
|
1551
|
+
return ((__eliscript_value_30) => { throw __eliscript_value_30; })(failure);
|
|
1423
1552
|
} else {
|
|
1424
1553
|
return null;
|
|
1425
1554
|
}
|
|
@@ -1449,57 +1578,47 @@ function create_compiler_session_handle(host, runtime, driver, state, has_state)
|
|
|
1449
1578
|
let result = undefined;
|
|
1450
1579
|
let failed = false;
|
|
1451
1580
|
let failure = undefined;
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
if (!((
|
|
1470
|
-
|
|
1471
|
-
(()
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
return ((failure = transfer_error(runtime, error)));
|
|
1478
|
-
} else {
|
|
1479
|
-
return null;
|
|
1480
|
-
}
|
|
1481
|
-
}
|
|
1482
|
-
})();
|
|
1581
|
+
try {
|
|
1582
|
+
if (!((runtime === undefined))) {
|
|
1583
|
+
((input = (runtime)["string"](text)));
|
|
1584
|
+
((output = (runtime)["invoke"](((__eliscript_tdz_ready_0 === true ? names : __eliscript_tdz_error("names")))["request"], [state, input])));
|
|
1585
|
+
((result = (runtime)["readString"](output)));
|
|
1586
|
+
} else {
|
|
1587
|
+
((result = __eliscript_at(Reflect, "apply")((driver)["request"], (driver)["module"], [state, text])));
|
|
1588
|
+
}
|
|
1589
|
+
if ((!(session_value_type(result) === "string"))) {
|
|
1590
|
+
((__eliscript_value_31) => { throw __eliscript_value_31; })(new (globalThis.TypeError)("compiler driver returned a non-JSON response"));
|
|
1591
|
+
}
|
|
1592
|
+
((result = JSON.parse(result)));
|
|
1593
|
+
} catch (error) {
|
|
1594
|
+
((failed = true));
|
|
1595
|
+
((failure = transfer_error(runtime, error)));
|
|
1596
|
+
} finally {
|
|
1597
|
+
if (!((runtime === undefined))) {
|
|
1598
|
+
if (!((output === undefined))) {
|
|
1599
|
+
try {
|
|
1600
|
+
(runtime)["release"](output);
|
|
1601
|
+
} catch (error) {
|
|
1602
|
+
if ((!(failed === true))) {
|
|
1603
|
+
((failed = true));
|
|
1604
|
+
((failure = transfer_error(runtime, error)));
|
|
1605
|
+
}
|
|
1483
1606
|
}
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
return null;
|
|
1494
|
-
}
|
|
1495
|
-
}
|
|
1496
|
-
})();
|
|
1607
|
+
}
|
|
1608
|
+
if (!((input === undefined))) {
|
|
1609
|
+
try {
|
|
1610
|
+
(runtime)["release"](input);
|
|
1611
|
+
} catch (error) {
|
|
1612
|
+
if ((!(failed === true))) {
|
|
1613
|
+
((failed = true));
|
|
1614
|
+
((failure = transfer_error(runtime, error)));
|
|
1615
|
+
}
|
|
1497
1616
|
}
|
|
1498
1617
|
}
|
|
1499
1618
|
}
|
|
1500
|
-
}
|
|
1619
|
+
}
|
|
1501
1620
|
if ((failed === true)) {
|
|
1502
|
-
((
|
|
1621
|
+
((__eliscript_value_32) => { throw __eliscript_value_32; })(failure);
|
|
1503
1622
|
}
|
|
1504
1623
|
return result;
|
|
1505
1624
|
}
|
|
@@ -1514,19 +1633,19 @@ function create_compiler_session_handle(host, runtime, driver, state, has_state)
|
|
|
1514
1633
|
let response_string_chunks = (req_options)["responseStringChunks"];
|
|
1515
1634
|
let allow_owned = ((allow_owned_arg === undefined) ? false : globalThis.Boolean(allow_owned_arg));
|
|
1516
1635
|
if (__eliscript_truthy(closed)) {
|
|
1517
|
-
((
|
|
1636
|
+
((__eliscript_value_33) => { throw __eliscript_value_33; })(new (globalThis.Error)("compiler session is closed"));
|
|
1518
1637
|
}
|
|
1519
1638
|
if (__eliscript_truthy(busy)) {
|
|
1520
|
-
((
|
|
1639
|
+
((__eliscript_value_34) => { throw __eliscript_value_34; })(new (globalThis.Error)("compiler session is busy"));
|
|
1521
1640
|
}
|
|
1522
|
-
if ((!((response_mode === undefined)) && (
|
|
1523
|
-
((
|
|
1641
|
+
if ((!((response_mode === undefined)) && (response_mode !== "events") && (response_mode !== "graph-events"))) {
|
|
1642
|
+
((__eliscript_value_35) => { throw __eliscript_value_35; })(new (globalThis.TypeError)("unsupported compiler response mode"));
|
|
1524
1643
|
}
|
|
1525
|
-
if ((!((response_string_chunks === undefined)) && ((
|
|
1526
|
-
((
|
|
1644
|
+
if ((!((response_string_chunks === undefined)) && (__eliscript_value_type(response_string_chunks) !== "boolean"))) {
|
|
1645
|
+
((__eliscript_value_36) => { throw __eliscript_value_36; })(new (globalThis.TypeError)("compiler response string chunks must be a boolean"));
|
|
1527
1646
|
}
|
|
1528
1647
|
if (((response_string_chunks === true) && (response_mode === undefined))) {
|
|
1529
|
-
((
|
|
1648
|
+
((__eliscript_value_37) => { throw __eliscript_value_37; })(new (globalThis.TypeError)("compiler response string chunks require an event response mode"));
|
|
1530
1649
|
}
|
|
1531
1650
|
check_signal(signal);
|
|
1532
1651
|
((busy = true));
|
|
@@ -1538,148 +1657,139 @@ function create_compiler_session_handle(host, runtime, driver, state, has_state)
|
|
|
1538
1657
|
let pending = false;
|
|
1539
1658
|
let transferred = false;
|
|
1540
1659
|
let receive = ((text) => {
|
|
1541
|
-
return (() => {
|
|
1542
|
-
try {
|
|
1543
|
-
return exchange(text);
|
|
1544
|
-
} catch (error) {
|
|
1545
|
-
((transferred = true));
|
|
1546
|
-
return ((__eliscript_value_51) => { throw __eliscript_value_51; })(error);
|
|
1547
|
-
}
|
|
1548
|
-
})();
|
|
1549
|
-
});
|
|
1550
|
-
(() => {
|
|
1551
1660
|
try {
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1661
|
+
return exchange(text);
|
|
1662
|
+
} catch (error) {
|
|
1663
|
+
((transferred = true));
|
|
1664
|
+
return ((__eliscript_value_38) => { throw __eliscript_value_38; })(error);
|
|
1665
|
+
}
|
|
1666
|
+
});
|
|
1667
|
+
try {
|
|
1668
|
+
{
|
|
1669
|
+
let text = encode_request(request);
|
|
1670
|
+
let owned = false;
|
|
1671
|
+
check_signal(signal);
|
|
1672
|
+
if ((response_string_chunks === true)) {
|
|
1673
|
+
{
|
|
1674
|
+
let capabilities = receive(JSON.stringify(({"operation": "capabilities"})));
|
|
1675
|
+
check_signal(signal);
|
|
1676
|
+
if ((!(!((capabilities == null)) && ((capabilities)["responseStringChunks"] === true)))) {
|
|
1677
|
+
((__eliscript_value_39) => { throw __eliscript_value_39; })(new (globalThis.TypeError)("compiler driver does not support response string chunks"));
|
|
1563
1678
|
}
|
|
1564
1679
|
}
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1680
|
+
}
|
|
1681
|
+
if ((__eliscript_truthy(allow_owned) && !(__eliscript_truthy(runtime)))) {
|
|
1682
|
+
{
|
|
1683
|
+
let entry = ((driver)["module"])["compiler_session_project_owned"];
|
|
1684
|
+
if ((__eliscript_value_type(entry) === "function")) {
|
|
1685
|
+
{
|
|
1686
|
+
let input = JSON.parse(text);
|
|
1687
|
+
let target = session_optional(input, "target");
|
|
1688
|
+
let native_target = session_optional(input, "nativeTarget");
|
|
1689
|
+
let native_format = session_nullish(session_optional(input, "nativeFormat"), "library");
|
|
1690
|
+
let eligible = ((!(input === null)) && (__eliscript_value_type(input) === "object") && (!__eliscript_truthy(Array.isArray(input))) && ((input)["operation"] === "project") && ((target === "wasm") || (target === "native")) && (!__eliscript_truthy(Object.hasOwn(input, "responseMode"))));
|
|
1691
|
+
((input = undefined));
|
|
1569
1692
|
{
|
|
1570
|
-
let
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
if ((!(__eliscript_truthy(envelope)) || ((__eliscript_value_53, __eliscript_value_54) => (__eliscript_value_53 !== __eliscript_value_54))(__eliscript_value_type(envelope), "object") || __eliscript_truthy(Array.isArray(envelope)) || !(__eliscript_truthy(Object.hasOwn(envelope, "format"))) || ((__eliscript_value_55, __eliscript_value_56) => (__eliscript_value_55 !== __eliscript_value_56))((envelope)["format"], "eliscript-compiler-owned-project") || !(__eliscript_truthy(Object.hasOwn(envelope, "value"))))) {
|
|
1580
|
-
((__eliscript_value_57) => { throw __eliscript_value_57; })(new (globalThis.TypeError)("compiler returned an invalid owned project envelope"));
|
|
1693
|
+
let envelope = (__eliscript_truthy(eligible) ? __eliscript_at(Reflect, "apply")(entry, (driver)["module"], [(driver)["request"], state, text]) : null);
|
|
1694
|
+
if ((!(envelope === null))) {
|
|
1695
|
+
if ((!(__eliscript_truthy(envelope)) || (__eliscript_value_type(envelope) !== "object") || __eliscript_truthy(Array.isArray(envelope)) || !(__eliscript_truthy(Object.hasOwn(envelope, "format"))) || ((envelope)["format"] !== "eliscript-compiler-owned-project") || !(__eliscript_truthy(Object.hasOwn(envelope, "value"))))) {
|
|
1696
|
+
((__eliscript_value_40) => { throw __eliscript_value_40; })(new (globalThis.TypeError)("compiler returned an invalid owned project envelope"));
|
|
1697
|
+
}
|
|
1698
|
+
{
|
|
1699
|
+
let product = (envelope)["value"];
|
|
1700
|
+
if ((!(__eliscript_truthy(product)) || (__eliscript_value_type(product) !== "object") || __eliscript_truthy(Array.isArray(product)) || ((product)["target"] !== target) || __eliscript_truthy(((target === "wasm") ? (!((product)["typed"] === undefined)) : ((__eliscript_value_41) => (__eliscript_truthy(__eliscript_value_41) ? __eliscript_value_41 : ((__eliscript_value_42) => (__eliscript_truthy(__eliscript_value_42) ? __eliscript_value_42 : ((__eliscript_value_43) => (__eliscript_truthy(__eliscript_value_43) ? __eliscript_value_43 : ((((product)["typed"])["abi"] !== "memory-u32") || (!__eliscript_truthy(Array.isArray(((product)["typed"])["functions"]))) || (!__eliscript_truthy(Array.isArray(((product)["typed"])["exports"]))) || (__eliscript_value_type((product)["nativeTarget"]) !== "string") || ((product)["nativeTarget"] !== native_target) || (!__eliscript_truthy((["library", "object"])["includes"]((product)["nativeFormat"]))) || ((product)["nativeFormat"] !== native_format))))(Array.isArray((product)["typed"]))))((__eliscript_value_type((product)["typed"]) !== "object"))))((!__eliscript_truthy((product)["typed"]))))) || !(__eliscript_truthy((product)["descriptor"])) || (__eliscript_value_type((product)["descriptor"]) !== "object") || __eliscript_truthy(Array.isArray((product)["descriptor"])) || ((product)["bytes"] === undefined))) {
|
|
1701
|
+
((__eliscript_value_44) => { throw __eliscript_value_44; })(new (globalThis.TypeError)(("compiler returned an invalid owned " + target + " project")));
|
|
1581
1702
|
}
|
|
1703
|
+
((result = session_copy_properties(({}), product)));
|
|
1704
|
+
((result)["descriptor"] = JSON.parse(encodeCompilerIR((product)["descriptor"])));
|
|
1582
1705
|
{
|
|
1583
|
-
let
|
|
1584
|
-
if ((
|
|
1585
|
-
((
|
|
1706
|
+
let normalize = ownedCompilerDataNormalizer();
|
|
1707
|
+
if ((target === "native")) {
|
|
1708
|
+
((result)["typed"] = normalize((product)["typed"]));
|
|
1586
1709
|
}
|
|
1587
|
-
((
|
|
1588
|
-
|
|
1589
|
-
{
|
|
1590
|
-
let normalize = ownedCompilerDataNormalizer();
|
|
1591
|
-
if ((target === "native")) {
|
|
1592
|
-
((result)["typed"] = normalize((product)["typed"]));
|
|
1593
|
-
}
|
|
1594
|
-
if (!(((product)["debug"] === undefined))) {
|
|
1595
|
-
((result)["debug"] = normalize((product)["debug"]));
|
|
1596
|
-
}
|
|
1710
|
+
if (!(((product)["debug"] === undefined))) {
|
|
1711
|
+
((result)["debug"] = normalize((product)["debug"]));
|
|
1597
1712
|
}
|
|
1598
|
-
((__eliscript_tdz_ready_4 === true ? ownedCompilerBuildProducts : __eliscript_tdz_error("ownedCompilerBuildProducts")))["add"](result);
|
|
1599
|
-
((owned = true));
|
|
1600
1713
|
}
|
|
1714
|
+
((__eliscript_tdz_ready_4 === true ? ownedCompilerBuildProducts : __eliscript_tdz_error("ownedCompilerBuildProducts")))["add"](result);
|
|
1715
|
+
((owned = true));
|
|
1601
1716
|
}
|
|
1602
1717
|
}
|
|
1603
1718
|
}
|
|
1604
1719
|
}
|
|
1605
1720
|
}
|
|
1606
1721
|
}
|
|
1607
|
-
|
|
1722
|
+
}
|
|
1723
|
+
if ((!(__eliscript_truthy(owned)) && !((response_mode === undefined)))) {
|
|
1724
|
+
{
|
|
1725
|
+
let input = JSON.parse(text);
|
|
1726
|
+
if (((input === null) || (__eliscript_value_type(input) !== "object") || __eliscript_truthy(Array.isArray(input)))) {
|
|
1727
|
+
((__eliscript_value_45) => { throw __eliscript_value_45; })(new (globalThis.TypeError)("compiler event request must be an object"));
|
|
1728
|
+
}
|
|
1608
1729
|
{
|
|
1609
|
-
let
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
{
|
|
1614
|
-
let patched = session_copy_properties(({}), input);
|
|
1615
|
-
((patched)["responseMode"] = response_mode);
|
|
1616
|
-
if ((response_string_chunks === true)) {
|
|
1617
|
-
((patched)["responseStringChunks"] = true);
|
|
1618
|
-
}
|
|
1619
|
-
((text = encodeCompilerIR(patched)));
|
|
1730
|
+
let patched = session_copy_properties(({}), input);
|
|
1731
|
+
((patched)["responseMode"] = response_mode);
|
|
1732
|
+
if ((response_string_chunks === true)) {
|
|
1733
|
+
((patched)["responseStringChunks"] = true);
|
|
1620
1734
|
}
|
|
1735
|
+
((text = encodeCompilerIR(patched)));
|
|
1621
1736
|
}
|
|
1622
1737
|
}
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
}
|
|
1653
|
-
((result = receive(next_request)));
|
|
1654
|
-
}
|
|
1738
|
+
}
|
|
1739
|
+
if ((!__eliscript_truthy(owned))) {
|
|
1740
|
+
((result = receive(text)));
|
|
1741
|
+
}
|
|
1742
|
+
if ((!(__eliscript_truthy(owned)) && !((response_mode === undefined)))) {
|
|
1743
|
+
{
|
|
1744
|
+
let graph = (response_mode === "graph-events");
|
|
1745
|
+
let expected_mode = ((graph === true) ? "graph-events" : "events");
|
|
1746
|
+
let decoder = compiler_response_events(graph, (response_string_chunks === true));
|
|
1747
|
+
let next_request = undefined;
|
|
1748
|
+
let done_loop = false;
|
|
1749
|
+
try {
|
|
1750
|
+
while (!((done_loop === true))) {
|
|
1751
|
+
if (((result == null) || !(((result)["format"] === "eliscript-compiler-response-events")) || !(((result)["mode"] === expected_mode)) || !((Number.isSafeInteger((result)["token"]) === true)) || __eliscript_numeric_relation("<", (result)["token"], 1) || !((session_value_type((result)["done"]) === "boolean")) || (!((token === undefined)) && !((token === (result)["token"]))))) {
|
|
1752
|
+
((__eliscript_value_46) => { throw __eliscript_value_46; })(new (globalThis.TypeError)("compiler returned an invalid response envelope"));
|
|
1753
|
+
}
|
|
1754
|
+
if ((token === undefined)) {
|
|
1755
|
+
((token = (result)["token"]));
|
|
1756
|
+
((next_request = JSON.stringify(({"operation": "response-next", "token": token}))));
|
|
1757
|
+
}
|
|
1758
|
+
((pending = (!((result)["done"] === true))));
|
|
1759
|
+
(decoder)["append"]((result)["events"]);
|
|
1760
|
+
check_signal(signal);
|
|
1761
|
+
if (((result)["done"] === true)) {
|
|
1762
|
+
((result = (decoder)["value"]));
|
|
1763
|
+
((done_loop = true));
|
|
1764
|
+
} else {
|
|
1765
|
+
if (((decoder)["complete"] === true)) {
|
|
1766
|
+
((__eliscript_value_47) => { throw __eliscript_value_47; })(new (globalThis.TypeError)("compiler response completed before its final envelope"));
|
|
1655
1767
|
}
|
|
1656
|
-
|
|
1657
|
-
} finally {
|
|
1658
|
-
(decoder)["release"]();
|
|
1768
|
+
((result = receive(next_request)));
|
|
1659
1769
|
}
|
|
1660
|
-
}
|
|
1770
|
+
}
|
|
1771
|
+
} finally {
|
|
1772
|
+
(decoder)["release"]();
|
|
1661
1773
|
}
|
|
1662
1774
|
}
|
|
1663
|
-
return check_signal(signal);
|
|
1664
1775
|
}
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
})();
|
|
1776
|
+
check_signal(signal);
|
|
1777
|
+
}
|
|
1778
|
+
} catch (error) {
|
|
1779
|
+
((failed = true));
|
|
1780
|
+
((failure = (__eliscript_truthy(transferred) ? error : transfer_error(runtime, error))));
|
|
1781
|
+
} finally {
|
|
1782
|
+
if (__eliscript_truthy(pending)) {
|
|
1783
|
+
try {
|
|
1784
|
+
exchange(JSON.stringify(({"operation": "response-close", "token": token})));
|
|
1785
|
+
} catch (ignored) {
|
|
1786
|
+
null;
|
|
1677
1787
|
}
|
|
1678
|
-
((busy = false));
|
|
1679
1788
|
}
|
|
1680
|
-
|
|
1789
|
+
((busy = false));
|
|
1790
|
+
}
|
|
1681
1791
|
if (__eliscript_truthy(failed)) {
|
|
1682
|
-
((
|
|
1792
|
+
((__eliscript_value_48) => { throw __eliscript_value_48; })(failure);
|
|
1683
1793
|
}
|
|
1684
1794
|
return result;
|
|
1685
1795
|
}
|
|
@@ -1690,7 +1800,7 @@ function create_compiler_session_handle(host, runtime, driver, state, has_state)
|
|
|
1690
1800
|
}), "close": (() => {
|
|
1691
1801
|
if ((!__eliscript_truthy(closed))) {
|
|
1692
1802
|
if (__eliscript_truthy(busy)) {
|
|
1693
|
-
((
|
|
1803
|
+
((__eliscript_value_49) => { throw __eliscript_value_49; })(new (globalThis.Error)("cannot close a compiler session during a request"));
|
|
1694
1804
|
}
|
|
1695
1805
|
((closed = true));
|
|
1696
1806
|
close_owned();
|
|
@@ -1725,10 +1835,10 @@ async function createCompilerSession(...session_args) {
|
|
|
1725
1835
|
((session_args = undefined));
|
|
1726
1836
|
((config = undefined));
|
|
1727
1837
|
if ((!__eliscript_truthy((["javascript", "wasm", "native"])["includes"](host)))) {
|
|
1728
|
-
((
|
|
1838
|
+
((__eliscript_value_50) => { throw __eliscript_value_50; })(new (globalThis.TypeError)("unknown compiler session host"));
|
|
1729
1839
|
}
|
|
1730
|
-
if (((options === null) || ((
|
|
1731
|
-
((
|
|
1840
|
+
if (((options === null) || (__eliscript_value_type(options) !== "object") || __eliscript_truthy(Array.isArray(options)) || (memory === null) || (__eliscript_value_type(memory) !== "object") || __eliscript_truthy(Array.isArray(memory)))) {
|
|
1841
|
+
((__eliscript_value_51) => { throw __eliscript_value_51; })(new (globalThis.TypeError)("compiler session memory and options must be objects"));
|
|
1732
1842
|
}
|
|
1733
1843
|
return (await (async (runtime) => {
|
|
1734
1844
|
return (await (async (driver) => {
|
|
@@ -1739,20 +1849,20 @@ async function createCompilerSession(...session_args) {
|
|
|
1739
1849
|
return (await (async () => {
|
|
1740
1850
|
((options = undefined));
|
|
1741
1851
|
if ((!(__eliscript_truthy(Number.isInteger(auto)) && __eliscript_numeric_relation(">=", auto, 0) && __eliscript_numeric_relation("<=", auto, 4294967295)))) {
|
|
1742
|
-
((
|
|
1852
|
+
((__eliscript_value_52) => { throw __eliscript_value_52; })(new (globalThis.RangeError)("invalid compiler collection threshold"));
|
|
1743
1853
|
}
|
|
1744
1854
|
(await (async () => {
|
|
1745
1855
|
try {
|
|
1746
1856
|
return ((host === "javascript") ? (() => {
|
|
1747
1857
|
if ((!(__eliscript_truthy(compiler) && (__eliscript_value_type(compiler) === "object")))) {
|
|
1748
|
-
((
|
|
1858
|
+
((__eliscript_value_53) => { throw __eliscript_value_53; })(new (globalThis.TypeError)("JavaScript compiler session requires a driver module"));
|
|
1749
1859
|
}
|
|
1750
1860
|
((driver = ({"module": compiler, "create": (compiler)[((__eliscript_tdz_ready_0 === true ? names : __eliscript_tdz_error("names")))["create"]], "request": (compiler)[((__eliscript_tdz_ready_0 === true ? names : __eliscript_tdz_error("names")))["request"]], "close": (compiler)[((__eliscript_tdz_ready_0 === true ? names : __eliscript_tdz_error("names")))["close"]]})));
|
|
1751
1861
|
((compiler = undefined));
|
|
1752
1862
|
if (__eliscript_truthy(([(driver)["create"], (driver)["request"], (driver)["close"]])["some"](((value) => {
|
|
1753
|
-
return ((
|
|
1863
|
+
return (__eliscript_value_type(value) !== "function");
|
|
1754
1864
|
})))) {
|
|
1755
|
-
((
|
|
1865
|
+
((__eliscript_value_54) => { throw __eliscript_value_54; })(new (globalThis.TypeError)("compiler driver is missing its session exports"));
|
|
1756
1866
|
}
|
|
1757
1867
|
((state = __eliscript_at(Reflect, "apply")((driver)["create"], (driver)["module"], [])));
|
|
1758
1868
|
return ((has_state = true));
|
|
@@ -1761,7 +1871,7 @@ async function createCompilerSession(...session_args) {
|
|
|
1761
1871
|
((settings)["initializeModule"] = false);
|
|
1762
1872
|
((host === "wasm") ? (() => {
|
|
1763
1873
|
if ((bytes === undefined)) {
|
|
1764
|
-
((
|
|
1874
|
+
((__eliscript_value_55) => { throw __eliscript_value_55; })(new (globalThis.TypeError)("WASM compiler session requires an artifact"));
|
|
1765
1875
|
}
|
|
1766
1876
|
{
|
|
1767
1877
|
let input_bytes = bytes;
|
|
@@ -1770,7 +1880,7 @@ async function createCompilerSession(...session_args) {
|
|
|
1770
1880
|
}
|
|
1771
1881
|
})() : (await (async () => {
|
|
1772
1882
|
if ((!((__eliscript_value_type(path) === "string") && __eliscript_numeric_relation(">", ((path) ?? []).length, 0) && (session_optional(session_optional(descriptor, "typed"), "abi") === "memory-u32") && __eliscript_truthy(session_optional(descriptor, "descriptor"))))) {
|
|
1773
|
-
((
|
|
1883
|
+
((__eliscript_value_56) => { throw __eliscript_value_56; })(new (globalThis.TypeError)("native compiler session requires its library path and complete lowering descriptor"));
|
|
1774
1884
|
}
|
|
1775
1885
|
return (await (async (native_module) => {
|
|
1776
1886
|
return (await (async (native_mod) => {
|
|
@@ -1800,14 +1910,12 @@ async function createCompilerSession(...session_args) {
|
|
|
1800
1910
|
} catch (error) {
|
|
1801
1911
|
{
|
|
1802
1912
|
let primary = transfer_error(runtime, error);
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
})();
|
|
1810
|
-
return ((__eliscript_value_98) => { throw __eliscript_value_98; })(primary);
|
|
1913
|
+
try {
|
|
1914
|
+
close_compiler_session_owned(runtime, driver, state, has_state);
|
|
1915
|
+
} catch (ignored) {
|
|
1916
|
+
null;
|
|
1917
|
+
}
|
|
1918
|
+
return ((__eliscript_value_57) => { throw __eliscript_value_57; })(primary);
|
|
1811
1919
|
}
|
|
1812
1920
|
}
|
|
1813
1921
|
})());
|