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
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
// Generated by Eliscript. Do not edit.
|
|
2
|
+
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "eliscript/runtime/errors.mjs";
|
|
3
|
+
var __eliscript_tdz_ready_0;
|
|
4
|
+
import "eliscript/runtime/unicode-case.mjs";
|
|
5
|
+
import "eliscript/runtime/math.mjs";
|
|
6
|
+
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";
|
|
7
|
+
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
8
|
+
|
|
9
|
+
import * as Collection from "../../runtime/core/collection.mjs";
|
|
10
|
+
import {EMPTY_MAP} from "../../runtime/core/map.mjs";
|
|
11
|
+
import {EMPTY_SET} from "../../runtime/core/set.mjs";
|
|
12
|
+
import {difference, intersection} from "../../runtime/core/set-algebra.mjs";
|
|
13
|
+
import {assocBang, persistentBang, transient} from "../../runtime/core/transient.mjs";
|
|
14
|
+
import {equalValues} from "../../runtime/core/value.mjs";
|
|
15
|
+
import {PersistentVector, persistentVector} from "../../runtime/core/vector.mjs";
|
|
16
|
+
const diff_missing = ({});
|
|
17
|
+
__eliscript_tdz_ready_0 = true;
|
|
18
|
+
function sequential_container_QMARK_(value) {
|
|
19
|
+
return ((__eliscript_value_1) => (__eliscript_truthy(__eliscript_value_1) ? ((__eliscript_value_2) => (__eliscript_truthy(__eliscript_value_2) ? __eliscript_value_2 : ((__eliscript_value_3) => (__eliscript_truthy(__eliscript_value_3) ? __eliscript_value_3 : Array.isArray(value)))(Collection.isList(value))))(Collection.isVector(value)) : __eliscript_value_1))((!(value == null)));
|
|
20
|
+
}
|
|
21
|
+
function sequential_array(value) {
|
|
22
|
+
if (__eliscript_truthy(Array.isArray(value))) {
|
|
23
|
+
return value;
|
|
24
|
+
} else {
|
|
25
|
+
{
|
|
26
|
+
let items = [];
|
|
27
|
+
Collection.reduce(value, ((_acc, item) => {
|
|
28
|
+
(items)["push"](item);
|
|
29
|
+
return null;
|
|
30
|
+
}), null);
|
|
31
|
+
return items;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function trim_trailing_nils(items) {
|
|
36
|
+
{
|
|
37
|
+
let end = ((items) ?? []).length;
|
|
38
|
+
while ((__eliscript_numeric_relation(">", end, 0) && ((items)[__eliscript_numeric_decrement(end)] === null))) {
|
|
39
|
+
((end = __eliscript_numeric_decrement(end)));
|
|
40
|
+
}
|
|
41
|
+
if ((end === 0)) {
|
|
42
|
+
return null;
|
|
43
|
+
} else {
|
|
44
|
+
return (PersistentVector)["from"](((end === ((items) ?? []).length) ? items : (items)["slice"](0, end)));
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function diff_maps(left, right) {
|
|
49
|
+
{
|
|
50
|
+
let left_entries = [];
|
|
51
|
+
let right_keys = [];
|
|
52
|
+
let only_a = transient(EMPTY_MAP);
|
|
53
|
+
let only_b = transient(EMPTY_MAP);
|
|
54
|
+
let both = transient(EMPTY_MAP);
|
|
55
|
+
Collection.reduceKV(left, ((_acc, key, val_a) => {
|
|
56
|
+
(left_entries)["push"]([key, val_a]);
|
|
57
|
+
return null;
|
|
58
|
+
}), null);
|
|
59
|
+
Collection.reduceKV(right, ((_acc, key, val_b) => {
|
|
60
|
+
(right_keys)["push"]([key, val_b]);
|
|
61
|
+
return null;
|
|
62
|
+
}), null);
|
|
63
|
+
{
|
|
64
|
+
let li = 0;
|
|
65
|
+
while (__eliscript_numeric_relation("<", li, ((left_entries) ?? []).length)) {
|
|
66
|
+
{
|
|
67
|
+
let pair = (left_entries)[li];
|
|
68
|
+
let key = (pair)[0];
|
|
69
|
+
let val_a = (pair)[1];
|
|
70
|
+
let val_b = Collection.get(right, key, (__eliscript_tdz_ready_0 === true ? diff_missing : __eliscript_tdz_error("diff_missing")));
|
|
71
|
+
if ((val_b === (__eliscript_tdz_ready_0 === true ? diff_missing : __eliscript_tdz_error("diff_missing")))) {
|
|
72
|
+
assocBang(only_a, key, val_a);
|
|
73
|
+
} else {
|
|
74
|
+
{
|
|
75
|
+
let sub = diff(val_a, val_b);
|
|
76
|
+
if ((!((sub)["nth"](0) === null))) {
|
|
77
|
+
assocBang(only_a, key, (sub)["nth"](0));
|
|
78
|
+
}
|
|
79
|
+
if ((!((sub)["nth"](1) === null))) {
|
|
80
|
+
assocBang(only_b, key, (sub)["nth"](1));
|
|
81
|
+
}
|
|
82
|
+
if ((!((sub)["nth"](2) === null))) {
|
|
83
|
+
assocBang(both, key, (sub)["nth"](2));
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
((li = (li + 1)));
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
{
|
|
92
|
+
let ri = 0;
|
|
93
|
+
while (__eliscript_numeric_relation("<", ri, ((right_keys) ?? []).length)) {
|
|
94
|
+
{
|
|
95
|
+
let pair = (right_keys)[ri];
|
|
96
|
+
let key = (pair)[0];
|
|
97
|
+
let val_b = (pair)[1];
|
|
98
|
+
if ((!__eliscript_truthy(Collection.contains(left, key)))) {
|
|
99
|
+
assocBang(only_b, key, val_b);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
((ri = (ri + 1)));
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
{
|
|
106
|
+
let res_a = persistentBang(only_a);
|
|
107
|
+
let res_b = persistentBang(only_b);
|
|
108
|
+
let res_c = persistentBang(both);
|
|
109
|
+
return persistentVector(((Collection.count(res_a) === 0) ? null : res_a), ((Collection.count(res_b) === 0) ? null : res_b), ((Collection.count(res_c) === 0) ? null : res_c));
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function diff_sets(left, right) {
|
|
114
|
+
{
|
|
115
|
+
let only_a = difference(left, right);
|
|
116
|
+
let only_b = difference(right, left);
|
|
117
|
+
let both = intersection(left, right);
|
|
118
|
+
return persistentVector(((Collection.count(only_a) === 0) ? null : only_a), ((Collection.count(only_b) === 0) ? null : only_b), ((Collection.count(both) === 0) ? null : both));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function diff_sequentials(left, right) {
|
|
122
|
+
{
|
|
123
|
+
let arr_a = sequential_array(left);
|
|
124
|
+
let arr_b = sequential_array(right);
|
|
125
|
+
let len_a = ((arr_a) ?? []).length;
|
|
126
|
+
let len_b = ((arr_b) ?? []).length;
|
|
127
|
+
let limit = Math.max(len_a, len_b);
|
|
128
|
+
let out_a = [];
|
|
129
|
+
let out_b = [];
|
|
130
|
+
let out_c = [];
|
|
131
|
+
let index = 0;
|
|
132
|
+
while (__eliscript_numeric_relation("<", index, limit)) {
|
|
133
|
+
if (__eliscript_numeric_relation(">=", index, len_a)) {
|
|
134
|
+
(out_a)["push"](null);
|
|
135
|
+
(out_b)["push"]((arr_b)[index]);
|
|
136
|
+
(out_c)["push"](null);
|
|
137
|
+
} else {
|
|
138
|
+
if (__eliscript_numeric_relation(">=", index, len_b)) {
|
|
139
|
+
(out_a)["push"]((arr_a)[index]);
|
|
140
|
+
(out_b)["push"](null);
|
|
141
|
+
(out_c)["push"](null);
|
|
142
|
+
} else {
|
|
143
|
+
{
|
|
144
|
+
let sub = diff((arr_a)[index], (arr_b)[index]);
|
|
145
|
+
(out_a)["push"]((sub)["nth"](0));
|
|
146
|
+
(out_b)["push"]((sub)["nth"](1));
|
|
147
|
+
(out_c)["push"]((sub)["nth"](2));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
((index = (index + 1)));
|
|
152
|
+
}
|
|
153
|
+
return persistentVector(trim_trailing_nils(out_a), trim_trailing_nils(out_b), trim_trailing_nils(out_c));
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
function diff(left, right) {
|
|
157
|
+
if (__eliscript_truthy(equalValues(left, right))) {
|
|
158
|
+
return persistentVector(null, null, left);
|
|
159
|
+
} else {
|
|
160
|
+
if (((left == null) || (right == null))) {
|
|
161
|
+
return persistentVector(((left == null) ? null : left), ((right == null) ? null : right), null);
|
|
162
|
+
} else {
|
|
163
|
+
if ((__eliscript_truthy(Collection.isMap(left)) && __eliscript_truthy(Collection.isMap(right)))) {
|
|
164
|
+
return diff_maps(left, right);
|
|
165
|
+
} else {
|
|
166
|
+
if ((__eliscript_truthy(Collection.isSet(left)) && __eliscript_truthy(Collection.isSet(right)))) {
|
|
167
|
+
return diff_sets(left, right);
|
|
168
|
+
} else {
|
|
169
|
+
if ((__eliscript_truthy(sequential_container_QMARK_(left)) && __eliscript_truthy(sequential_container_QMARK_(right)))) {
|
|
170
|
+
return diff_sequentials(left, right);
|
|
171
|
+
} else {
|
|
172
|
+
return persistentVector(left, right, null);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
export {diff};
|
|
180
|
+
//# sourceMappingURL=diff.mjs.map
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// Generated by Eliscript. Do not edit.
|
|
2
|
+
import "eliscript/runtime/unicode-case.mjs";
|
|
3
|
+
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";
|
|
4
|
+
import { valueType as __eliscript_value_type } from "eliscript/runtime/primitives.mjs";
|
|
5
|
+
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
6
|
+
|
|
7
|
+
import {empty_persistent_vector, persistent_vector_conj} from "./persistent-vector.mjs";
|
|
8
|
+
function reverse_values(values) {
|
|
9
|
+
{
|
|
10
|
+
let result = [];
|
|
11
|
+
let index = 0;
|
|
12
|
+
while (__eliscript_numeric_relation("<", index, ((values) ?? []).length)) {
|
|
13
|
+
((result = [(values)[index], ...((result) ?? [])]), (index = (index + 1)));
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function append_values(left, right) {
|
|
19
|
+
{
|
|
20
|
+
let result = [];
|
|
21
|
+
let index = 0;
|
|
22
|
+
while (__eliscript_numeric_relation("<", index, ((left) ?? []).length)) {
|
|
23
|
+
((result = [(left)[index], ...((result) ?? [])]), (index = (index + 1)));
|
|
24
|
+
}
|
|
25
|
+
((index = 0));
|
|
26
|
+
while (__eliscript_numeric_relation("<", index, ((right) ?? []).length)) {
|
|
27
|
+
((result = [(right)[index], ...((result) ?? [])]), (index = (index + 1)));
|
|
28
|
+
}
|
|
29
|
+
return reverse_values(result);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function identity(value) {
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
function constantly(value) {
|
|
36
|
+
return ((...arguments$) => {
|
|
37
|
+
return value;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
function complement(predicate) {
|
|
41
|
+
return ((...arguments$) => {
|
|
42
|
+
return (!__eliscript_truthy(predicate(...(arguments$ ?? []))));
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
function comp(...functions) {
|
|
46
|
+
{
|
|
47
|
+
let length = ((functions) ?? []).length;
|
|
48
|
+
if ((length === 0)) {
|
|
49
|
+
return identity;
|
|
50
|
+
} else {
|
|
51
|
+
if ((length === 1)) {
|
|
52
|
+
return (functions)[0];
|
|
53
|
+
} else {
|
|
54
|
+
return ((...arguments$) => {
|
|
55
|
+
{
|
|
56
|
+
let index = __eliscript_numeric_decrement(length);
|
|
57
|
+
let result = null;
|
|
58
|
+
((result = ((functions)[index])(...(arguments$ ?? []))), (index = __eliscript_numeric_decrement(index)));
|
|
59
|
+
while (__eliscript_numeric_relation(">=", index, 0)) {
|
|
60
|
+
((result = ((functions)[index])(result)), (index = __eliscript_numeric_decrement(index)));
|
|
61
|
+
}
|
|
62
|
+
return result;
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
function partial(function$, ...bound_arguments) {
|
|
70
|
+
if ((((bound_arguments) ?? []).length === 0)) {
|
|
71
|
+
return function$;
|
|
72
|
+
} else {
|
|
73
|
+
return ((...arguments$) => {
|
|
74
|
+
return function$(...(append_values(bound_arguments, arguments$) ?? []));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
function juxt(...functions) {
|
|
79
|
+
return ((...arguments$) => {
|
|
80
|
+
{
|
|
81
|
+
let result = empty_persistent_vector();
|
|
82
|
+
let index = 0;
|
|
83
|
+
while (__eliscript_numeric_relation("<", index, ((functions) ?? []).length)) {
|
|
84
|
+
((result = persistent_vector_conj(result, ((functions)[index])(...(arguments$ ?? [])))), (index = (index + 1)));
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
function fnil(function$, ...defaults) {
|
|
91
|
+
return ((...arguments$) => {
|
|
92
|
+
{
|
|
93
|
+
let normalized = [];
|
|
94
|
+
let index = 0;
|
|
95
|
+
while (__eliscript_numeric_relation("<", index, ((arguments$) ?? []).length)) {
|
|
96
|
+
{
|
|
97
|
+
let value = (arguments$)[index];
|
|
98
|
+
((normalized = [((__eliscript_numeric_relation("<", index, ((defaults) ?? []).length) && (value === null)) ? (defaults)[index] : value), ...((normalized) ?? [])]), (index = (index + 1)));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return function$(...(reverse_values(normalized) ?? []));
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function every_pred(...predicates) {
|
|
106
|
+
return ((...arguments$) => {
|
|
107
|
+
{
|
|
108
|
+
let predicate_index = 0;
|
|
109
|
+
let matched = true;
|
|
110
|
+
while ((__eliscript_truthy(matched) && __eliscript_numeric_relation("<", predicate_index, ((predicates) ?? []).length))) {
|
|
111
|
+
{
|
|
112
|
+
let argument_index = 0;
|
|
113
|
+
let predicate = (predicates)[predicate_index];
|
|
114
|
+
while ((__eliscript_truthy(matched) && __eliscript_numeric_relation("<", argument_index, ((arguments$) ?? []).length))) {
|
|
115
|
+
if ((!__eliscript_truthy(predicate((arguments$)[argument_index])))) {
|
|
116
|
+
((matched = false));
|
|
117
|
+
}
|
|
118
|
+
((argument_index = (argument_index + 1)));
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
((predicate_index = (predicate_index + 1)));
|
|
122
|
+
}
|
|
123
|
+
return matched;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
function some_fn(...predicates) {
|
|
128
|
+
return ((...arguments$) => {
|
|
129
|
+
{
|
|
130
|
+
let predicate_index = 0;
|
|
131
|
+
let argument_index = 0;
|
|
132
|
+
let found = false;
|
|
133
|
+
let result = null;
|
|
134
|
+
while ((!(__eliscript_truthy(found)) && __eliscript_numeric_relation("<", predicate_index, ((predicates) ?? []).length))) {
|
|
135
|
+
((argument_index = 0));
|
|
136
|
+
while ((!(__eliscript_truthy(found)) && __eliscript_numeric_relation("<", argument_index, ((arguments$) ?? []).length))) {
|
|
137
|
+
{
|
|
138
|
+
let candidate = ((predicates)[predicate_index])((arguments$)[argument_index]);
|
|
139
|
+
if (__eliscript_truthy(candidate)) {
|
|
140
|
+
((found = true), (result = candidate));
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
((argument_index = (argument_index + 1)));
|
|
144
|
+
}
|
|
145
|
+
((predicate_index = (predicate_index + 1)));
|
|
146
|
+
}
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function trampoline(function$, ...arguments$) {
|
|
152
|
+
{
|
|
153
|
+
let result = function$(...(arguments$ ?? []));
|
|
154
|
+
while ((__eliscript_value_type(result) === "function")) {
|
|
155
|
+
((result = result()));
|
|
156
|
+
}
|
|
157
|
+
return result;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
export {comp, complement, constantly, every_pred, fnil, identity, juxt, partial, some_fn, trampoline};
|
|
161
|
+
|
|
162
|
+
export {reverse_values, append_values};
|
|
163
|
+
export const __eliscript_portable__ = Object.freeze(Object.fromEntries([["reverse-values", reverse_values], ["append-values", append_values], ["identity", identity], ["constantly", constantly], ["complement", complement], ["comp", comp], ["partial", partial], ["juxt", juxt], ["fnil", fnil], ["every-pred", every_pred], ["some-fn", some_fn], ["trampoline", trampoline]]));
|
|
164
|
+
//# sourceMappingURL=fn.mjs.map
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
// Generated by Eliscript. Do not edit.
|
|
2
|
+
import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "eliscript/runtime/errors.mjs";
|
|
3
|
+
var __eliscript_tdz_ready_0;
|
|
4
|
+
var __eliscript_tdz_ready_1;
|
|
5
|
+
import "eliscript/runtime/unicode-case.mjs";
|
|
6
|
+
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";
|
|
7
|
+
import { valueType as __eliscript_value_type } from "eliscript/runtime/primitives.mjs";
|
|
8
|
+
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
9
|
+
|
|
10
|
+
import {persistent_map_assoc, persistent_map_dissoc, persistent_map_get, persistent_map_reduce} from "./persistent-map.mjs";
|
|
11
|
+
import {persistent_set_conj, persistent_set_count, persistent_set_disj, persistent_set_has_QMARK_, persistent_set_reduce, persistent_set_union} from "./persistent-set.mjs";
|
|
12
|
+
import {persistent_vector_QMARK_, persistent_vector_count, persistent_vector_nth} from "./persistent-vector.mjs";
|
|
13
|
+
import {empty_value_map, empty_value_set, value_equal_QMARK_} from "./value.mjs";
|
|
14
|
+
const hierarchy_registry = new WeakMap();
|
|
15
|
+
__eliscript_tdz_ready_0 = true;
|
|
16
|
+
const hierarchy_missing = ({});
|
|
17
|
+
__eliscript_tdz_ready_1 = true;
|
|
18
|
+
function hierarchy_fail(code, message, child, parent) {
|
|
19
|
+
return ((__eliscript_value_1) => { throw __eliscript_value_1; })(({"kind": "eliscript/hierarchy-error", "code": code, "message": message, "child": child, "parent": parent}));
|
|
20
|
+
}
|
|
21
|
+
function hierarchy_QMARK_(candidate) {
|
|
22
|
+
{
|
|
23
|
+
let type = __eliscript_value_type(candidate);
|
|
24
|
+
if (((type === "object") || (type === "function"))) {
|
|
25
|
+
try {
|
|
26
|
+
return ((__eliscript_tdz_ready_0 === true ? hierarchy_registry : __eliscript_tdz_error("hierarchy_registry")))["has"](candidate);
|
|
27
|
+
} catch (_error) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
function hierarchy_state(hierarchy) {
|
|
36
|
+
if (__eliscript_truthy(hierarchy_QMARK_(hierarchy))) {
|
|
37
|
+
return ((__eliscript_tdz_ready_0 === true ? hierarchy_registry : __eliscript_tdz_error("hierarchy_registry")))["get"](hierarchy);
|
|
38
|
+
} else {
|
|
39
|
+
return hierarchy_fail("ELI-HIERARCHY-INVALID", "operation requires a hierarchy", null, null);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function hierarchy_close_ancestors(direct_parents) {
|
|
43
|
+
{
|
|
44
|
+
let result = direct_parents;
|
|
45
|
+
let changed = true;
|
|
46
|
+
while (__eliscript_truthy(changed)) {
|
|
47
|
+
((changed = false));
|
|
48
|
+
((result = persistent_map_reduce(((next, child, known_ancestors) => {
|
|
49
|
+
{
|
|
50
|
+
let expanded = persistent_set_reduce(((values, ancestor) => {
|
|
51
|
+
{
|
|
52
|
+
let ancestor_values = persistent_map_get(result, ancestor, (__eliscript_tdz_ready_1 === true ? hierarchy_missing : __eliscript_tdz_error("hierarchy_missing")));
|
|
53
|
+
if ((ancestor_values === (__eliscript_tdz_ready_1 === true ? hierarchy_missing : __eliscript_tdz_error("hierarchy_missing")))) {
|
|
54
|
+
return values;
|
|
55
|
+
} else {
|
|
56
|
+
return persistent_set_union(values, ancestor_values);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}), known_ancestors, known_ancestors);
|
|
60
|
+
if (__eliscript_numeric_relation(">", persistent_set_count(expanded), persistent_set_count(known_ancestors))) {
|
|
61
|
+
((changed = true));
|
|
62
|
+
}
|
|
63
|
+
return persistent_map_assoc(next, child, expanded);
|
|
64
|
+
}
|
|
65
|
+
}), result, result)));
|
|
66
|
+
}
|
|
67
|
+
return result;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function hierarchy_invert_ancestors(ancestor_table) {
|
|
71
|
+
return persistent_map_reduce(((result, child, child_ancestors) => {
|
|
72
|
+
return persistent_set_reduce(((next, ancestor) => {
|
|
73
|
+
{
|
|
74
|
+
let known = persistent_map_get(next, ancestor, (__eliscript_tdz_ready_1 === true ? hierarchy_missing : __eliscript_tdz_error("hierarchy_missing")));
|
|
75
|
+
return persistent_map_assoc(next, ancestor, persistent_set_conj(((known === (__eliscript_tdz_ready_1 === true ? hierarchy_missing : __eliscript_tdz_error("hierarchy_missing"))) ? empty_value_set() : known), child));
|
|
76
|
+
}
|
|
77
|
+
}), result, child_ancestors);
|
|
78
|
+
}), empty_value_map(), ancestor_table);
|
|
79
|
+
}
|
|
80
|
+
function hierarchy_register(direct_parents, ancestor_table, descendant_table) {
|
|
81
|
+
{
|
|
82
|
+
let hierarchy = ({});
|
|
83
|
+
((__eliscript_tdz_ready_0 === true ? hierarchy_registry : __eliscript_tdz_error("hierarchy_registry")))["set"](hierarchy, ({"parents": direct_parents, "ancestors": ancestor_table, "descendants": descendant_table}));
|
|
84
|
+
return hierarchy;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function hierarchy_rebuild(direct_parents) {
|
|
88
|
+
{
|
|
89
|
+
let ancestor_table = hierarchy_close_ancestors(direct_parents);
|
|
90
|
+
return hierarchy_register(direct_parents, ancestor_table, hierarchy_invert_ancestors(ancestor_table));
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
function hierarchy_update_transitive(table, source, source_relations, target, target_relations) {
|
|
94
|
+
{
|
|
95
|
+
let source_values = persistent_map_get(source_relations, source, null);
|
|
96
|
+
let target_values = persistent_map_get(target_relations, target, null);
|
|
97
|
+
let affected = persistent_set_conj((__eliscript_truthy(source_values) ? source_values : empty_value_set()), source);
|
|
98
|
+
let additions = persistent_set_conj((__eliscript_truthy(target_values) ? target_values : empty_value_set()), target);
|
|
99
|
+
return persistent_set_reduce(((result, value) => {
|
|
100
|
+
{
|
|
101
|
+
let known = persistent_map_get(result, value, null);
|
|
102
|
+
return persistent_map_assoc(result, value, persistent_set_union((__eliscript_truthy(known) ? known : empty_value_set()), additions));
|
|
103
|
+
}
|
|
104
|
+
}), table, affected);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function empty_hierarchy() {
|
|
108
|
+
return hierarchy_rebuild(empty_value_map());
|
|
109
|
+
}
|
|
110
|
+
function hierarchy_relation(hierarchy, relation, value) {
|
|
111
|
+
return persistent_map_get(((hierarchy_state(hierarchy))[relation] ?? null), value, null);
|
|
112
|
+
}
|
|
113
|
+
function parents(hierarchy, value) {
|
|
114
|
+
return hierarchy_relation(hierarchy, "parents", value);
|
|
115
|
+
}
|
|
116
|
+
function ancestors(hierarchy, value) {
|
|
117
|
+
return hierarchy_relation(hierarchy, "ancestors", value);
|
|
118
|
+
}
|
|
119
|
+
function descendants(hierarchy, value) {
|
|
120
|
+
return hierarchy_relation(hierarchy, "descendants", value);
|
|
121
|
+
}
|
|
122
|
+
function is_a_QMARK_(hierarchy, child, parent) {
|
|
123
|
+
hierarchy_state(hierarchy);
|
|
124
|
+
if (__eliscript_truthy(value_equal_QMARK_(child, parent))) {
|
|
125
|
+
return true;
|
|
126
|
+
} else {
|
|
127
|
+
{
|
|
128
|
+
let known_ancestors = ancestors(hierarchy, child);
|
|
129
|
+
if ((__eliscript_truthy(known_ancestors) && __eliscript_truthy(persistent_set_has_QMARK_(known_ancestors, parent)))) {
|
|
130
|
+
return true;
|
|
131
|
+
} else {
|
|
132
|
+
if ((__eliscript_truthy(persistent_vector_QMARK_(child)) && __eliscript_truthy(persistent_vector_QMARK_(parent)) && (persistent_vector_count(child) === persistent_vector_count(parent)))) {
|
|
133
|
+
{
|
|
134
|
+
let matches = true;
|
|
135
|
+
let index = 0;
|
|
136
|
+
while ((__eliscript_truthy(matches) && __eliscript_numeric_relation("<", index, persistent_vector_count(child)))) {
|
|
137
|
+
((matches = is_a_QMARK_(hierarchy, persistent_vector_nth(child, index, null), persistent_vector_nth(parent, index, null))), (index = (index + 1)));
|
|
138
|
+
}
|
|
139
|
+
return matches;
|
|
140
|
+
}
|
|
141
|
+
} else {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
function derive(hierarchy, child, parent) {
|
|
149
|
+
{
|
|
150
|
+
let state = hierarchy_state(hierarchy);
|
|
151
|
+
let direct_parents = ((state)["parents"] ?? null);
|
|
152
|
+
let known = persistent_map_get(direct_parents, child, (__eliscript_tdz_ready_1 === true ? hierarchy_missing : __eliscript_tdz_error("hierarchy_missing")));
|
|
153
|
+
if (__eliscript_truthy(value_equal_QMARK_(child, parent))) {
|
|
154
|
+
hierarchy_fail("ELI-HIERARCHY-SELF-DERIVATION", "a hierarchy value cannot derive from itself", child, parent);
|
|
155
|
+
}
|
|
156
|
+
if ((!((known === (__eliscript_tdz_ready_1 === true ? hierarchy_missing : __eliscript_tdz_error("hierarchy_missing")))) && __eliscript_truthy(persistent_set_has_QMARK_(known, parent)))) {
|
|
157
|
+
return hierarchy;
|
|
158
|
+
} else {
|
|
159
|
+
if (__eliscript_truthy(is_a_QMARK_(hierarchy, parent, child))) {
|
|
160
|
+
hierarchy_fail("ELI-HIERARCHY-CYCLE", "hierarchy derivation would create a cycle", child, parent);
|
|
161
|
+
}
|
|
162
|
+
{
|
|
163
|
+
let ancestor_table = ((state)["ancestors"] ?? null);
|
|
164
|
+
let descendant_table = ((state)["descendants"] ?? null);
|
|
165
|
+
let next_parents = persistent_map_assoc(direct_parents, child, persistent_set_conj(((known === (__eliscript_tdz_ready_1 === true ? hierarchy_missing : __eliscript_tdz_error("hierarchy_missing"))) ? empty_value_set() : known), parent));
|
|
166
|
+
let next_ancestors = hierarchy_update_transitive(ancestor_table, child, descendant_table, parent, ancestor_table);
|
|
167
|
+
let next_descendants = hierarchy_update_transitive(descendant_table, parent, ancestor_table, child, descendant_table);
|
|
168
|
+
return hierarchy_register(next_parents, next_ancestors, next_descendants);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
function underive(hierarchy, child, parent) {
|
|
174
|
+
{
|
|
175
|
+
let state = hierarchy_state(hierarchy);
|
|
176
|
+
let direct_parents = ((state)["parents"] ?? null);
|
|
177
|
+
let known = persistent_map_get(direct_parents, child, (__eliscript_tdz_ready_1 === true ? hierarchy_missing : __eliscript_tdz_error("hierarchy_missing")));
|
|
178
|
+
if (((known === (__eliscript_tdz_ready_1 === true ? hierarchy_missing : __eliscript_tdz_error("hierarchy_missing"))) || !(__eliscript_truthy(persistent_set_has_QMARK_(known, parent))))) {
|
|
179
|
+
return hierarchy;
|
|
180
|
+
} else {
|
|
181
|
+
{
|
|
182
|
+
let remaining = persistent_set_disj(known, parent);
|
|
183
|
+
return hierarchy_rebuild(((persistent_set_count(remaining) === 0) ? persistent_map_dissoc(direct_parents, child) : persistent_map_assoc(direct_parents, child, remaining)));
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
export {ancestors, derive, descendants, empty_hierarchy, hierarchy_QMARK_, is_a_QMARK_, parents, underive};
|
|
189
|
+
//# sourceMappingURL=hierarchy.mjs.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// Generated by Eliscript. Do not edit.
|
|
2
|
+
import "eliscript/runtime/unicode-case.mjs";
|
|
3
|
+
const __eliscript_truthy = (value) => value !== false && value != null;
|
|
4
|
+
|
|
5
|
+
import * as Runtime from "../../runtime/core/identifier.mjs";
|
|
6
|
+
const Keyword = Runtime.Keyword;
|
|
7
|
+
const EliscriptSymbol = Runtime.EliscriptSymbol;
|
|
8
|
+
function keyword(...arguments$) {
|
|
9
|
+
return Runtime.keyword(...(arguments$ ?? []));
|
|
10
|
+
}
|
|
11
|
+
function keyword_QMARK_(value) {
|
|
12
|
+
return Runtime.isKeyword(value);
|
|
13
|
+
}
|
|
14
|
+
function symbol(...arguments$) {
|
|
15
|
+
return Runtime.eliscriptSymbol(...(arguments$ ?? []));
|
|
16
|
+
}
|
|
17
|
+
function symbol_QMARK_(value) {
|
|
18
|
+
return Runtime.isEliscriptSymbol(value);
|
|
19
|
+
}
|
|
20
|
+
function identifier_QMARK_(value) {
|
|
21
|
+
return Runtime.isIdentifier(value);
|
|
22
|
+
}
|
|
23
|
+
function identifier_name(value) {
|
|
24
|
+
return Runtime.identifierName(value);
|
|
25
|
+
}
|
|
26
|
+
function identifier_namespace(value) {
|
|
27
|
+
return Runtime.identifierNamespace(value);
|
|
28
|
+
}
|
|
29
|
+
function qualified_name(value) {
|
|
30
|
+
return Runtime.qualifiedIdentifierName(value);
|
|
31
|
+
}
|
|
32
|
+
export {EliscriptSymbol, Keyword, identifier_name, identifier_namespace, identifier_QMARK_, keyword, keyword_QMARK_, qualified_name, symbol, symbol_QMARK_};
|
|
33
|
+
//# sourceMappingURL=identifier.mjs.map
|