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
|
@@ -17,11 +17,22 @@ var __eliscript_tdz_ready_20;
|
|
|
17
17
|
var __eliscript_tdz_ready_21;
|
|
18
18
|
var __eliscript_tdz_ready_22;
|
|
19
19
|
var __eliscript_tdz_ready_23;
|
|
20
|
+
var __eliscript_tdz_ready_26;
|
|
21
|
+
var __eliscript_tdz_ready_29;
|
|
22
|
+
var __eliscript_tdz_ready_30;
|
|
23
|
+
function __eliscript_tdz_write_30(__eliscript_tdz_value_30) { if (__eliscript_tdz_ready_30 !== true) __eliscript_tdz_error("map_entry_vector_factory"); return (map_entry_vector_factory = __eliscript_tdz_value_30); }
|
|
24
|
+
var __eliscript_tdz_ready_31;
|
|
25
|
+
function __eliscript_tdz_write_31(__eliscript_tdz_value_31) { if (__eliscript_tdz_ready_31 !== true) __eliscript_tdz_error("map_entry_is_vector"); return (map_entry_is_vector = __eliscript_tdz_value_31); }
|
|
26
|
+
var __eliscript_tdz_ready_32;
|
|
27
|
+
var __eliscript_tdz_ready_34;
|
|
20
28
|
import "eliscript/runtime/unicode-case.mjs";
|
|
21
29
|
import { __eliscript_to_number, __eliscript_numeric_decrement, __eliscript_numeric_relation, __eliscript_numeric_sub, __eliscript_numeric_mul, __eliscript_numeric_div, __eliscript_numeric_rem, __eliscript_numeric_and, __eliscript_numeric_or, __eliscript_numeric_xor, __eliscript_numeric_shl, __eliscript_numeric_shr, __eliscript_numeric_ushr, __eliscript_numeric_neg, __eliscript_numeric_int32, __eliscript_numeric_uint32, __eliscript_numeric_not } from "eliscript/runtime/prelude.mjs";
|
|
22
30
|
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
23
31
|
|
|
24
32
|
import {equalValues, hashValue} from "./value.mjs";
|
|
33
|
+
import {VALUE_EQUAL, VALUE_HASH, orderedCollectionHash} from "./value-internals.mjs";
|
|
34
|
+
import {COLLECTION_COUNT, COLLECTION_EMPTY, COLLECTION_CONJ, COLLECTION_GET, COLLECTION_ASSOC, COLLECTION_CONTAINS, COLLECTION_NTH, COLLECTION_SEQ, COLLECTION_REDUCE, COLLECTION_REDUCE_KV, COLLECTION_PEEK, COLLECTION_POP, COLLECTION_RSEQ, COLLECTION_ENTRY_KEY, COLLECTION_ENTRY_VAL, isReducedValue, reducedValue, sequenceView, unreducedValue} from "./collection-internals.mjs";
|
|
35
|
+
import {METADATA_READ, METADATA_WITH} from "./metadata-internals.mjs";
|
|
25
36
|
import {bit_count} from "../../stdlib/bit.mjs";
|
|
26
37
|
const host_class = (implementation, name) => ({ [name]: class { constructor(...args) { return implementation(this, ...args); } } })[name];
|
|
27
38
|
const host_method = (implementation, name) => ({ [name](...args) { return implementation(this, ...args); } })[name];
|
|
@@ -228,17 +239,13 @@ function findCollisionValue(node, key, notFound) {
|
|
|
228
239
|
if ((!__eliscript_truthy(complete))) {
|
|
229
240
|
{
|
|
230
241
|
let entry = (step)["value"];
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
return ((value = (entry)["value"]), (found = true));
|
|
235
|
-
} else {
|
|
236
|
-
return null;
|
|
237
|
-
}
|
|
238
|
-
} catch (error) {
|
|
239
|
-
return close_entry_frames(({"frames": [({"iterator": iterator, "active": true})]}), true, error);
|
|
242
|
+
try {
|
|
243
|
+
if (__eliscript_truthy(keysEqual((entry)["key"], key))) {
|
|
244
|
+
((value = (entry)["value"]), (found = true));
|
|
240
245
|
}
|
|
241
|
-
}
|
|
246
|
+
} catch (error) {
|
|
247
|
+
close_entry_frames(({"frames": [({"iterator": iterator, "active": true})]}), true, error);
|
|
248
|
+
}
|
|
242
249
|
}
|
|
243
250
|
}
|
|
244
251
|
}
|
|
@@ -256,7 +263,7 @@ function promoteBitmapNode(node, shift, hash, key, value, owner = null) {
|
|
|
256
263
|
let packed = 0;
|
|
257
264
|
let index = 0;
|
|
258
265
|
while (__eliscript_numeric_relation("<", index, 32)) {
|
|
259
|
-
if ((
|
|
266
|
+
if ((__eliscript_numeric_and((node)["bitmap"], __eliscript_numeric_uint32(__eliscript_numeric_shl(1, index))) !== 0)) {
|
|
260
267
|
((children)[index] = ((node)["items"])[packed]);
|
|
261
268
|
((packed = (packed + 1)));
|
|
262
269
|
}
|
|
@@ -337,7 +344,7 @@ function findInNode(node, shift, hash, key, notFound) {
|
|
|
337
344
|
}
|
|
338
345
|
}
|
|
339
346
|
} else {
|
|
340
|
-
if (((
|
|
347
|
+
if (((node)["hash"] !== hash)) {
|
|
341
348
|
return notFound;
|
|
342
349
|
} else {
|
|
343
350
|
return findCollisionValue(node, key, notFound);
|
|
@@ -414,13 +421,13 @@ function assocNode(node, shift, hash, key, value) {
|
|
|
414
421
|
}
|
|
415
422
|
} else {
|
|
416
423
|
{
|
|
417
|
-
const
|
|
424
|
+
const __eliscript_value_2 = (items)[index];
|
|
418
425
|
{
|
|
419
|
-
let existing =
|
|
426
|
+
let existing = __eliscript_value_2;
|
|
420
427
|
{
|
|
421
|
-
const
|
|
428
|
+
const __eliscript_value_3 = (__eliscript_truthy(existing instanceof MapEntry) ? assocEntry(existing, (shift + 5), hash, key, value) : assocNode(existing, (shift + 5), hash, key, value));
|
|
422
429
|
{
|
|
423
|
-
let result =
|
|
430
|
+
let result = __eliscript_value_3;
|
|
424
431
|
if (!(__eliscript_truthy((result)["changed"]))) {
|
|
425
432
|
return ({"item": node, "added": false, "changed": false});
|
|
426
433
|
} else {
|
|
@@ -465,7 +472,7 @@ function assocNode(node, shift, hash, key, value) {
|
|
|
465
472
|
}
|
|
466
473
|
}
|
|
467
474
|
} else {
|
|
468
|
-
if (((
|
|
475
|
+
if (((node)["hash"] !== hash)) {
|
|
469
476
|
return ({"item": mergeCollisionAndEntry(shift, node, new ((__eliscript_tdz_ready_18 === true ? MapEntry : __eliscript_tdz_error("MapEntry")))(key, value, hash)), "added": true, "changed": true});
|
|
470
477
|
} else {
|
|
471
478
|
{
|
|
@@ -606,7 +613,7 @@ function dissocNode(node, shift, hash, key) {
|
|
|
606
613
|
}
|
|
607
614
|
}
|
|
608
615
|
} else {
|
|
609
|
-
if (((
|
|
616
|
+
if (((node)["hash"] !== hash)) {
|
|
610
617
|
return ({"item": node, "removed": false});
|
|
611
618
|
} else {
|
|
612
619
|
{
|
|
@@ -696,7 +703,7 @@ function transientAssocNode(node, shift, hash, key, value, owner) {
|
|
|
696
703
|
}
|
|
697
704
|
}
|
|
698
705
|
} else {
|
|
699
|
-
if (((
|
|
706
|
+
if (((node)["hash"] !== hash)) {
|
|
700
707
|
return ({"item": mergeCollisionAndEntry(shift, node, new ((__eliscript_tdz_ready_18 === true ? MapEntry : __eliscript_tdz_error("MapEntry")))(key, value, hash), owner), "added": true, "changed": true});
|
|
701
708
|
} else {
|
|
702
709
|
{
|
|
@@ -813,7 +820,7 @@ function transientDissocNode(node, shift, hash, key, owner) {
|
|
|
813
820
|
}
|
|
814
821
|
}
|
|
815
822
|
} else {
|
|
816
|
-
if (((
|
|
823
|
+
if (((node)["hash"] !== hash)) {
|
|
817
824
|
return ({"item": node, "removed": false});
|
|
818
825
|
} else {
|
|
819
826
|
{
|
|
@@ -896,7 +903,7 @@ function iterator_object_QMARK_(value) {
|
|
|
896
903
|
return ((__eliscript_tdz_ready_5 === true ? host_object : __eliscript_tdz_error("host_object"))(value) === value);
|
|
897
904
|
}
|
|
898
905
|
function iterator_fail(message) {
|
|
899
|
-
return ((
|
|
906
|
+
return ((__eliscript_value_4) => { throw __eliscript_value_4; })(new (globalThis.TypeError)(message));
|
|
900
907
|
}
|
|
901
908
|
function entry_frame(node) {
|
|
902
909
|
return ({"node": node, "initialized": false, "active": false});
|
|
@@ -917,37 +924,29 @@ function close_entry_frames(state, failed, failure) {
|
|
|
917
924
|
{
|
|
918
925
|
let frame = (frames)["pop"]();
|
|
919
926
|
if (__eliscript_truthy((frame)["active"])) {
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
return iterator_fail("iterator return must return an object");
|
|
930
|
-
} else {
|
|
931
|
-
return null;
|
|
932
|
-
}
|
|
927
|
+
try {
|
|
928
|
+
{
|
|
929
|
+
let iterator = (frame)["iterator"];
|
|
930
|
+
let close = (iterator)["return"];
|
|
931
|
+
if ((!(close == null))) {
|
|
932
|
+
{
|
|
933
|
+
let result = (__eliscript_tdz_ready_6 === true ? host_apply : __eliscript_tdz_error("host_apply"))(close, iterator, (__eliscript_tdz_ready_7 === true ? no_arguments : __eliscript_tdz_error("no_arguments")));
|
|
934
|
+
if ((!__eliscript_truthy(iterator_object_QMARK_(result)))) {
|
|
935
|
+
iterator_fail("iterator return must return an object");
|
|
933
936
|
}
|
|
934
|
-
} else {
|
|
935
|
-
return null;
|
|
936
937
|
}
|
|
937
938
|
}
|
|
938
|
-
} catch (error) {
|
|
939
|
-
if ((!__eliscript_truthy(failed))) {
|
|
940
|
-
return ((failed = true), (failure = error));
|
|
941
|
-
} else {
|
|
942
|
-
return null;
|
|
943
|
-
}
|
|
944
939
|
}
|
|
945
|
-
}
|
|
940
|
+
} catch (error) {
|
|
941
|
+
if ((!__eliscript_truthy(failed))) {
|
|
942
|
+
((failed = true), (failure = error));
|
|
943
|
+
}
|
|
944
|
+
}
|
|
946
945
|
}
|
|
947
946
|
}
|
|
948
947
|
}
|
|
949
948
|
if (__eliscript_truthy(failed)) {
|
|
950
|
-
((
|
|
949
|
+
((__eliscript_value_5) => { throw __eliscript_value_5; })(failure);
|
|
951
950
|
}
|
|
952
951
|
}
|
|
953
952
|
return undefined;
|
|
@@ -968,7 +967,7 @@ function advance_entry_frames(state) {
|
|
|
968
967
|
} else {
|
|
969
968
|
{
|
|
970
969
|
let bitmap = node_instance_QMARK_(node, (__eliscript_tdz_ready_19 === true ? BitmapIndexedNode : __eliscript_tdz_error("BitmapIndexedNode")));
|
|
971
|
-
let array = ((
|
|
970
|
+
let array = ((__eliscript_value_6) => (__eliscript_truthy(__eliscript_value_6) ? node_instance_QMARK_(node, (__eliscript_tdz_ready_20 === true ? ArrayNode : __eliscript_tdz_error("ArrayNode"))) : __eliscript_value_6))((!__eliscript_truthy(bitmap)));
|
|
972
971
|
let items = (__eliscript_truthy(bitmap) ? (node)["items"] : (__eliscript_truthy(array) ? (node)["children"] : (node)["entries"]));
|
|
973
972
|
let iterator = (__eliscript_tdz_ready_6 === true ? host_apply : __eliscript_tdz_error("host_apply"))((items)[(__eliscript_tdz_ready_4 === true ? iterator_symbol : __eliscript_tdz_error("iterator_symbol"))], items, (__eliscript_tdz_ready_7 === true ? no_arguments : __eliscript_tdz_error("no_arguments")));
|
|
974
973
|
if ((!__eliscript_truthy(iterator_object_QMARK_(iterator)))) {
|
|
@@ -1025,16 +1024,14 @@ function entry_next(self, value) {
|
|
|
1025
1024
|
return ({"value": undefined, "done": true});
|
|
1026
1025
|
} else {
|
|
1027
1026
|
((state)["running"] = true);
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
}
|
|
1037
|
-
})();
|
|
1027
|
+
try {
|
|
1028
|
+
return advance_entry_frames(state);
|
|
1029
|
+
} catch (error) {
|
|
1030
|
+
((state)["closed"] = true);
|
|
1031
|
+
return close_entry_frames(state, true, error);
|
|
1032
|
+
} finally {
|
|
1033
|
+
((state)["running"] = false);
|
|
1034
|
+
}
|
|
1038
1035
|
}
|
|
1039
1036
|
}
|
|
1040
1037
|
}
|
|
@@ -1046,14 +1043,12 @@ function entry_return(self, value) {
|
|
|
1046
1043
|
}
|
|
1047
1044
|
((state)["running"] = true);
|
|
1048
1045
|
((state)["closed"] = true);
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
}
|
|
1056
|
-
})();
|
|
1046
|
+
try {
|
|
1047
|
+
close_entry_frames(state, false, undefined);
|
|
1048
|
+
return ({"value": value, "done": true});
|
|
1049
|
+
} finally {
|
|
1050
|
+
((state)["running"] = false);
|
|
1051
|
+
}
|
|
1057
1052
|
}
|
|
1058
1053
|
}
|
|
1059
1054
|
function entry_throw(self, error) {
|
|
@@ -1064,13 +1059,11 @@ function entry_throw(self, error) {
|
|
|
1064
1059
|
}
|
|
1065
1060
|
((state)["running"] = true);
|
|
1066
1061
|
((state)["closed"] = true);
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
}
|
|
1073
|
-
})();
|
|
1062
|
+
try {
|
|
1063
|
+
return close_entry_frames(state, true, error);
|
|
1064
|
+
} finally {
|
|
1065
|
+
((state)["running"] = false);
|
|
1066
|
+
}
|
|
1074
1067
|
}
|
|
1075
1068
|
}
|
|
1076
1069
|
function iterator_method(implementation, name, arity) {
|
|
@@ -1096,5 +1089,300 @@ function create_entry_iterator(item) {
|
|
|
1096
1089
|
}
|
|
1097
1090
|
const mapEntries = host_entry_generator(create_entry_iterator);
|
|
1098
1091
|
const EMPTY_BITMAP_NODE = new (BitmapIndexedNode)();
|
|
1099
|
-
|
|
1092
|
+
const PERSISTENT_MAP_ENTRY_TOKEN = globalThis.Symbol("eliscript.map-entry.constructor");
|
|
1093
|
+
__eliscript_tdz_ready_26 = true;
|
|
1094
|
+
const PERSISTENT_MAP_ENTRY_MISSING = globalThis.Symbol("eliscript.map-entry.missing");
|
|
1095
|
+
const MAP_ENTRY_VECTOR_HASH_TAG = 1327180861;
|
|
1096
|
+
const persistent_map_entry_states = new (globalThis.WeakMap)();
|
|
1097
|
+
__eliscript_tdz_ready_29 = true;
|
|
1098
|
+
let map_entry_vector_factory = undefined;
|
|
1099
|
+
__eliscript_tdz_ready_30 = true;
|
|
1100
|
+
let map_entry_is_vector = undefined;
|
|
1101
|
+
__eliscript_tdz_ready_31 = true;
|
|
1102
|
+
function registerMapEntryVectorFactory(factory, is_vector_fn) {
|
|
1103
|
+
(__eliscript_tdz_write_30(factory), __eliscript_tdz_write_31(is_vector_fn));
|
|
1104
|
+
return undefined;
|
|
1105
|
+
}
|
|
1106
|
+
function persistent_entry_state(entry) {
|
|
1107
|
+
return ((__eliscript_tdz_ready_29 === true ? persistent_map_entry_states : __eliscript_tdz_error("persistent_map_entry_states")))["get"](entry);
|
|
1108
|
+
}
|
|
1109
|
+
function persistent_entry_callable_QMARK_(value) {
|
|
1110
|
+
return (typeof value === "function");
|
|
1111
|
+
}
|
|
1112
|
+
function make_vector_from_entry(...items) {
|
|
1113
|
+
if ((!__eliscript_truthy(persistent_entry_callable_QMARK_((__eliscript_tdz_ready_30 === true ? map_entry_vector_factory : __eliscript_tdz_error("map_entry_vector_factory")))))) {
|
|
1114
|
+
((__eliscript_value_7) => { throw __eliscript_value_7; })(new (globalThis.TypeError)("vector factory must be registered before converting map entries to vectors"));
|
|
1115
|
+
}
|
|
1116
|
+
return (__eliscript_tdz_ready_6 === true ? host_apply : __eliscript_tdz_error("host_apply"))((__eliscript_tdz_ready_30 === true ? map_entry_vector_factory : __eliscript_tdz_error("map_entry_vector_factory")), undefined, items);
|
|
1117
|
+
}
|
|
1118
|
+
const host_entry_getter = (implementation, name) => Object.getOwnPropertyDescriptor({ get [name]() { return implementation(this); } }, name).get;
|
|
1119
|
+
__eliscript_tdz_ready_32 = true;
|
|
1120
|
+
const host_entry_value_generator = (states) => function* () { const s = states.get(this); yield s.key; yield s.val; };
|
|
1121
|
+
function entry_define_method(target, key, name, arity, implementation) {
|
|
1122
|
+
{
|
|
1123
|
+
let fn = (__eliscript_tdz_ready_1 === true ? host_method : __eliscript_tdz_error("host_method"))(implementation, name);
|
|
1124
|
+
Object.defineProperty(fn, "length", ({"value": arity, "configurable": true}));
|
|
1125
|
+
return Object.defineProperty(target, key, ({"value": fn, "writable": true, "configurable": true}));
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
function entry_define_getter(target, key, name, implementation) {
|
|
1129
|
+
return Object.defineProperty(target, key, ({"get": (__eliscript_tdz_ready_32 === true ? host_entry_getter : __eliscript_tdz_error("host_entry_getter"))(implementation, name), "configurable": true}));
|
|
1130
|
+
}
|
|
1131
|
+
const PersistentMapEntry = host_class(((self, token, key, val, metadata) => {
|
|
1132
|
+
if ((!(token === PERSISTENT_MAP_ENTRY_TOKEN))) {
|
|
1133
|
+
((__eliscript_value_8) => { throw __eliscript_value_8; })(new (globalThis.TypeError)("PersistentMapEntry values must be created with mapEntry"));
|
|
1134
|
+
}
|
|
1135
|
+
if ((metadata === undefined)) {
|
|
1136
|
+
((metadata = null));
|
|
1137
|
+
}
|
|
1138
|
+
Object.defineProperty(self, "0", ({"value": key, "writable": false, "enumerable": true, "configurable": false}));
|
|
1139
|
+
Object.defineProperty(self, "1", ({"value": val, "writable": false, "enumerable": true, "configurable": false}));
|
|
1140
|
+
Object.defineProperty(self, "length", ({"value": 2, "writable": false, "enumerable": false, "configurable": false}));
|
|
1141
|
+
(persistent_map_entry_states)["set"](self, Object.freeze(({"key": key, "val": val, "metadata": metadata})));
|
|
1142
|
+
return Object.freeze(self);
|
|
1143
|
+
}), "PersistentMapEntry");
|
|
1144
|
+
__eliscript_tdz_ready_34 = true;
|
|
1145
|
+
function make_persistent_map_entry(key, val, metadata = null) {
|
|
1146
|
+
return new ((__eliscript_tdz_ready_34 === true ? PersistentMapEntry : __eliscript_tdz_error("PersistentMapEntry")))((__eliscript_tdz_ready_26 === true ? PERSISTENT_MAP_ENTRY_TOKEN : __eliscript_tdz_error("PERSISTENT_MAP_ENTRY_TOKEN")), key, val, ((metadata === undefined) ? null : metadata));
|
|
1147
|
+
}
|
|
1148
|
+
function mapEntry(key, val) {
|
|
1149
|
+
return make_persistent_map_entry(key, val, null);
|
|
1150
|
+
}
|
|
1151
|
+
function isMapEntry(value) {
|
|
1152
|
+
return node_instance_QMARK_(value, (__eliscript_tdz_ready_34 === true ? PersistentMapEntry : __eliscript_tdz_error("PersistentMapEntry")));
|
|
1153
|
+
}
|
|
1154
|
+
((eproto) => {
|
|
1155
|
+
entry_define_getter(eproto, "key", "key", ((self) => {
|
|
1156
|
+
return (persistent_entry_state(self))["key"];
|
|
1157
|
+
}));
|
|
1158
|
+
entry_define_getter(eproto, "val", "val", ((self) => {
|
|
1159
|
+
return (persistent_entry_state(self))["val"];
|
|
1160
|
+
}));
|
|
1161
|
+
entry_define_getter(eproto, "count", "count", ((_self) => {
|
|
1162
|
+
return 2;
|
|
1163
|
+
}));
|
|
1164
|
+
entry_define_getter(eproto, "size", "size", ((_self) => {
|
|
1165
|
+
return 2;
|
|
1166
|
+
}));
|
|
1167
|
+
entry_define_method(eproto, "nth", "nth", 1, ((self, index, ...args) => {
|
|
1168
|
+
{
|
|
1169
|
+
let state = persistent_entry_state(self);
|
|
1170
|
+
let not_found = ((((args) ?? []).length === 0) ? PERSISTENT_MAP_ENTRY_MISSING : (args)[0]);
|
|
1171
|
+
if ((index === 0)) {
|
|
1172
|
+
return (state)["key"];
|
|
1173
|
+
} else {
|
|
1174
|
+
if ((index === 1)) {
|
|
1175
|
+
return (state)["val"];
|
|
1176
|
+
} else {
|
|
1177
|
+
if (!((not_found === PERSISTENT_MAP_ENTRY_MISSING))) {
|
|
1178
|
+
return not_found;
|
|
1179
|
+
} else {
|
|
1180
|
+
return ((__eliscript_value_9) => { throw __eliscript_value_9; })(new (globalThis.RangeError)((String("map entry nth index ") + String(globalThis.String(index)) + String(" is outside [0, 2)"))));
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
}));
|
|
1186
|
+
entry_define_method(eproto, "get", "get", 1, ((self, key, ...args) => {
|
|
1187
|
+
{
|
|
1188
|
+
let state = persistent_entry_state(self);
|
|
1189
|
+
let not_found = ((((args) ?? []).length === 0) ? null : (args)[0]);
|
|
1190
|
+
if ((key === 0)) {
|
|
1191
|
+
return (state)["key"];
|
|
1192
|
+
} else {
|
|
1193
|
+
if ((key === 1)) {
|
|
1194
|
+
return (state)["val"];
|
|
1195
|
+
} else {
|
|
1196
|
+
return not_found;
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
}
|
|
1200
|
+
}));
|
|
1201
|
+
entry_define_method(eproto, "has", "has", 1, ((_self, key) => {
|
|
1202
|
+
return ((key === 0) || (key === 1));
|
|
1203
|
+
}));
|
|
1204
|
+
entry_define_method(eproto, "contains", "contains", 1, ((_self, key) => {
|
|
1205
|
+
return ((key === 0) || (key === 1));
|
|
1206
|
+
}));
|
|
1207
|
+
entry_define_method(eproto, "peek", "peek", 0, ((self) => {
|
|
1208
|
+
return (persistent_entry_state(self))["val"];
|
|
1209
|
+
}));
|
|
1210
|
+
entry_define_method(eproto, "pop", "pop", 0, ((self) => {
|
|
1211
|
+
return make_vector_from_entry((persistent_entry_state(self))["key"]);
|
|
1212
|
+
}));
|
|
1213
|
+
entry_define_method(eproto, "assoc", "assoc", 2, ((self, index, value) => {
|
|
1214
|
+
{
|
|
1215
|
+
let state = persistent_entry_state(self);
|
|
1216
|
+
if ((index === 0)) {
|
|
1217
|
+
return make_vector_from_entry(value, (state)["val"]);
|
|
1218
|
+
} else {
|
|
1219
|
+
if ((index === 1)) {
|
|
1220
|
+
return make_vector_from_entry((state)["key"], value);
|
|
1221
|
+
} else {
|
|
1222
|
+
if ((index === 2)) {
|
|
1223
|
+
return make_vector_from_entry((state)["key"], (state)["val"], value);
|
|
1224
|
+
} else {
|
|
1225
|
+
return ((__eliscript_value_10) => { throw __eliscript_value_10; })(new (globalThis.RangeError)((String("map entry assoc index ") + String(globalThis.String(index)) + String(" is outside [0, 2]"))));
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
}));
|
|
1231
|
+
entry_define_method(eproto, "conj", "conj", 1, ((self, value) => {
|
|
1232
|
+
{
|
|
1233
|
+
let state = persistent_entry_state(self);
|
|
1234
|
+
return make_vector_from_entry((state)["key"], (state)["val"], value);
|
|
1235
|
+
}
|
|
1236
|
+
}));
|
|
1237
|
+
entry_define_method(eproto, "empty", "empty", 0, ((self) => {
|
|
1238
|
+
{
|
|
1239
|
+
let empty = make_vector_from_entry();
|
|
1240
|
+
let meta_value = (persistent_entry_state(self))["metadata"];
|
|
1241
|
+
if ((meta_value === null)) {
|
|
1242
|
+
return empty;
|
|
1243
|
+
} else {
|
|
1244
|
+
return host_apply((empty)[METADATA_WITH], empty, [meta_value]);
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
}));
|
|
1248
|
+
entry_define_method(eproto, "seq", "seq", 0, ((self) => {
|
|
1249
|
+
return sequenceView((() => {
|
|
1250
|
+
return host_apply((self)[iterator_symbol], self, no_arguments);
|
|
1251
|
+
}), 2);
|
|
1252
|
+
}));
|
|
1253
|
+
entry_define_method(eproto, "rseq", "rseq", 0, ((self) => {
|
|
1254
|
+
return sequenceView((() => {
|
|
1255
|
+
{
|
|
1256
|
+
let state = persistent_entry_state(self);
|
|
1257
|
+
let items = [(state)["val"], (state)["key"]];
|
|
1258
|
+
return host_apply((items)[iterator_symbol], items, no_arguments);
|
|
1259
|
+
}
|
|
1260
|
+
}), 2);
|
|
1261
|
+
}));
|
|
1262
|
+
entry_define_method(eproto, "reduce", "reduce", 1, ((self, reducer, ...args) => {
|
|
1263
|
+
if ((!__eliscript_truthy(persistent_entry_callable_QMARK_(reducer)))) {
|
|
1264
|
+
((__eliscript_value_11) => { throw __eliscript_value_11; })(new (globalThis.TypeError)("collection reducer must be a function"));
|
|
1265
|
+
}
|
|
1266
|
+
{
|
|
1267
|
+
let state = persistent_entry_state(self);
|
|
1268
|
+
let acc = ((((args) ?? []).length === 0) ? reducer((state)["key"], (state)["val"]) : ((first_acc) => {
|
|
1269
|
+
if (__eliscript_truthy(isReducedValue(first_acc))) {
|
|
1270
|
+
return first_acc;
|
|
1271
|
+
} else {
|
|
1272
|
+
return reducer(first_acc, (state)["val"]);
|
|
1273
|
+
}
|
|
1274
|
+
})(reducer((args)[0], (state)["key"])));
|
|
1275
|
+
return unreducedValue(acc);
|
|
1276
|
+
}
|
|
1277
|
+
}));
|
|
1278
|
+
entry_define_method(eproto, "toJSON", "toJSON", 0, ((self) => {
|
|
1279
|
+
{
|
|
1280
|
+
let state = persistent_entry_state(self);
|
|
1281
|
+
return [(state)["key"], (state)["val"]];
|
|
1282
|
+
}
|
|
1283
|
+
}));
|
|
1284
|
+
entry_define_method(eproto, COLLECTION_ENTRY_KEY, "[eliscript.map-entry.key]", 0, ((self) => {
|
|
1285
|
+
return (persistent_entry_state(self))["key"];
|
|
1286
|
+
}));
|
|
1287
|
+
entry_define_method(eproto, COLLECTION_ENTRY_VAL, "[eliscript.map-entry.val]", 0, ((self) => {
|
|
1288
|
+
return (persistent_entry_state(self))["val"];
|
|
1289
|
+
}));
|
|
1290
|
+
entry_define_method(eproto, COLLECTION_COUNT, "[eliscript.collection.count]", 0, ((_self) => {
|
|
1291
|
+
return 2;
|
|
1292
|
+
}));
|
|
1293
|
+
entry_define_method(eproto, COLLECTION_EMPTY, "[eliscript.collection.empty]", 0, ((self) => {
|
|
1294
|
+
return (self)["empty"]();
|
|
1295
|
+
}));
|
|
1296
|
+
entry_define_method(eproto, COLLECTION_CONJ, "[eliscript.collection.conj]", 1, ((self, value) => {
|
|
1297
|
+
return (self)["conj"](value);
|
|
1298
|
+
}));
|
|
1299
|
+
entry_define_method(eproto, COLLECTION_GET, "[eliscript.collection.get]", 1, ((self, key, ...args) => {
|
|
1300
|
+
return host_apply((eproto)["get"], self, ([key])["concat"](args));
|
|
1301
|
+
}));
|
|
1302
|
+
entry_define_method(eproto, COLLECTION_ASSOC, "[eliscript.collection.assoc]", 2, ((self, key, value) => {
|
|
1303
|
+
return (self)["assoc"](key, value);
|
|
1304
|
+
}));
|
|
1305
|
+
entry_define_method(eproto, COLLECTION_CONTAINS, "[eliscript.collection.contains]", 1, ((self, key) => {
|
|
1306
|
+
return (self)["has"](key);
|
|
1307
|
+
}));
|
|
1308
|
+
entry_define_method(eproto, COLLECTION_NTH, "[eliscript.collection.nth]", 1, ((self, index, ...args) => {
|
|
1309
|
+
return host_apply((eproto)["nth"], self, ([index])["concat"](args));
|
|
1310
|
+
}));
|
|
1311
|
+
entry_define_method(eproto, COLLECTION_SEQ, "[eliscript.collection.seq]", 0, ((self) => {
|
|
1312
|
+
return (self)["seq"]();
|
|
1313
|
+
}));
|
|
1314
|
+
entry_define_method(eproto, COLLECTION_REDUCE, "[eliscript.collection.reduce]", 1, ((self, reducer, ...args) => {
|
|
1315
|
+
return host_apply((eproto)["reduce"], self, ([reducer])["concat"](args));
|
|
1316
|
+
}));
|
|
1317
|
+
entry_define_method(eproto, COLLECTION_REDUCE_KV, "[eliscript.collection.reduceKv]", 2, ((self, reducer, initial) => {
|
|
1318
|
+
if ((!__eliscript_truthy(persistent_entry_callable_QMARK_(reducer)))) {
|
|
1319
|
+
((__eliscript_value_12) => { throw __eliscript_value_12; })(new (globalThis.TypeError)("key/value reducer must be a function"));
|
|
1320
|
+
}
|
|
1321
|
+
{
|
|
1322
|
+
let state = persistent_entry_state(self);
|
|
1323
|
+
let acc = reducer(initial, 0, (state)["key"]);
|
|
1324
|
+
if (__eliscript_truthy(isReducedValue(acc))) {
|
|
1325
|
+
return unreducedValue(acc);
|
|
1326
|
+
} else {
|
|
1327
|
+
return unreducedValue(reducer(acc, 1, (state)["val"]));
|
|
1328
|
+
}
|
|
1329
|
+
}
|
|
1330
|
+
}));
|
|
1331
|
+
entry_define_method(eproto, COLLECTION_PEEK, "[eliscript.collection.peek]", 0, ((self) => {
|
|
1332
|
+
return (self)["peek"]();
|
|
1333
|
+
}));
|
|
1334
|
+
entry_define_method(eproto, COLLECTION_POP, "[eliscript.collection.pop]", 0, ((self) => {
|
|
1335
|
+
return (self)["pop"]();
|
|
1336
|
+
}));
|
|
1337
|
+
entry_define_method(eproto, COLLECTION_RSEQ, "[eliscript.collection.rseq]", 0, ((self) => {
|
|
1338
|
+
return (self)["rseq"]();
|
|
1339
|
+
}));
|
|
1340
|
+
entry_define_method(eproto, VALUE_EQUAL, "[eliscript.value.equal]", 2, ((self, other, equal) => {
|
|
1341
|
+
{
|
|
1342
|
+
let state = persistent_entry_state(self);
|
|
1343
|
+
if ((self === other)) {
|
|
1344
|
+
return true;
|
|
1345
|
+
} else {
|
|
1346
|
+
if (__eliscript_truthy(isMapEntry(other))) {
|
|
1347
|
+
{
|
|
1348
|
+
let other_state = persistent_entry_state(other);
|
|
1349
|
+
return ((__eliscript_value_13) => (__eliscript_truthy(__eliscript_value_13) ? globalThis.Boolean(equal((state)["val"], (other_state)["val"])) : __eliscript_value_13))(globalThis.Boolean(equal((state)["key"], (other_state)["key"])));
|
|
1350
|
+
}
|
|
1351
|
+
} else {
|
|
1352
|
+
if ((__eliscript_truthy(persistent_entry_callable_QMARK_(map_entry_is_vector)) && __eliscript_truthy(map_entry_is_vector(other)) && ((other)["count"] === 2))) {
|
|
1353
|
+
return ((__eliscript_value_14) => (__eliscript_truthy(__eliscript_value_14) ? globalThis.Boolean(equal((state)["val"], (other)["nth"](1))) : __eliscript_value_14))(globalThis.Boolean(equal((state)["key"], (other)["nth"](0))));
|
|
1354
|
+
} else {
|
|
1355
|
+
return false;
|
|
1356
|
+
}
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
}));
|
|
1361
|
+
entry_define_method(eproto, VALUE_HASH, "[eliscript.value.hash]", 1, ((self, hash) => {
|
|
1362
|
+
return orderedCollectionHash(self, hash, MAP_ENTRY_VECTOR_HASH_TAG);
|
|
1363
|
+
}));
|
|
1364
|
+
entry_define_method(eproto, METADATA_READ, "[eliscript.metadata.read]", 0, ((self) => {
|
|
1365
|
+
return (persistent_entry_state(self))["metadata"];
|
|
1366
|
+
}));
|
|
1367
|
+
entry_define_method(eproto, METADATA_WITH, "[eliscript.metadata.with]", 1, ((self, metadata) => {
|
|
1368
|
+
{
|
|
1369
|
+
let state = persistent_entry_state(self);
|
|
1370
|
+
if ((metadata === (state)["metadata"])) {
|
|
1371
|
+
return self;
|
|
1372
|
+
} else {
|
|
1373
|
+
return make_persistent_map_entry((state)["key"], (state)["val"], metadata);
|
|
1374
|
+
}
|
|
1375
|
+
}
|
|
1376
|
+
}));
|
|
1377
|
+
{
|
|
1378
|
+
let gen_fn = host_entry_value_generator(persistent_map_entry_states);
|
|
1379
|
+
Object.defineProperty(gen_fn, "name", ({"value": "[Symbol.iterator]", "configurable": true}));
|
|
1380
|
+
Object.defineProperty(gen_fn, "length", ({"value": 0, "configurable": true}));
|
|
1381
|
+
Object.defineProperty(eproto, iterator_symbol, ({"value": gen_fn, "writable": true, "configurable": true}));
|
|
1382
|
+
}
|
|
1383
|
+
return entry_define_getter(eproto, (globalThis.Symbol)["toStringTag"], "[Symbol.toStringTag]", ((_self) => {
|
|
1384
|
+
return "EliscriptPersistentMapEntry";
|
|
1385
|
+
}));
|
|
1386
|
+
})((PersistentMapEntry)["prototype"]);
|
|
1387
|
+
export {MAP_STATE, MAP_CONSTRUCTOR_TOKEN, MAP_NOT_FOUND, TRANSIENT_MAP_STATE, TRANSIENT_MAP_CONSTRUCTOR_TOKEN, ARRAY_NODE_THRESHOLD, BITMAP_NODE_THRESHOLD, MapEntry, PersistentMapEntry, BitmapIndexedNode, ArrayNode, HashCollisionNode, mapEntry, isMapEntry, registerMapEntryVectorFactory, mapFind, mapAssoc, mapDissoc, mapAssocTransient, mapDissocTransient, mapEntries, mapHash, resetMapMetrics, readMapMetrics, resetTransientMapMetrics, readTransientMapMetrics, recordTransientMapPersistent, recordInvalidTransientMapCall, EMPTY_BITMAP_NODE};
|
|
1100
1388
|
//# sourceMappingURL=map-internals.mjs.map
|