eliscript 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -0
- package/bootstrap/README.md +26 -0
- package/bootstrap/backends/README.md +515 -0
- package/bootstrap/backends/async.eli +230 -0
- package/bootstrap/backends/binary.eli +173 -0
- package/bootstrap/backends/capabilities.eli +74 -0
- package/bootstrap/backends/elf.eli +246 -0
- package/bootstrap/backends/managed.eli +5976 -0
- package/bootstrap/backends/memory.eli +100 -0
- package/bootstrap/backends/native.eli +2000 -0
- package/bootstrap/backends/numeric.eli +1362 -0
- package/bootstrap/backends/optimize.eli +79 -0
- package/bootstrap/backends/regexp.eli +2263 -0
- package/bootstrap/backends/sha256.eli +138 -0
- package/bootstrap/backends/wasm.eli +1161 -0
- package/bootstrap/compiler/analyzer.eli +165 -77
- package/bootstrap/compiler/compiler.eli +43 -19
- package/bootstrap/compiler/emitter.eli +780 -170
- package/bootstrap/compiler/expander.eli +136 -45
- package/bootstrap/compiler/formatter.eli +8 -1
- package/bootstrap/compiler/ir.eli +148 -45
- package/bootstrap/compiler/lower.eli +29 -2
- package/bootstrap/compiler/project.eli +51 -21
- package/bootstrap/compiler/reader.eli +128 -36
- package/bootstrap/compiler/source-map.eli +46 -4
- package/bootstrap/compiler/symbol.eli +2 -1
- package/bootstrap/compiler/syntax.eli +47 -12
- package/bootstrap/compiler/transient-analysis.eli +40 -4
- package/bootstrap/host/check-cli-legacy.mjs +163 -0
- package/bootstrap/host/check-cli.mjs +59 -158
- package/bootstrap/host/check-cli.mjs.map +1 -0
- package/bootstrap/host/compiler-session.eli +1579 -0
- package/bootstrap/host/compiler-tools.eli +513 -0
- package/bootstrap/host/eliscript-cli.mjs +53 -33
- package/bootstrap/host/eliscript-cli.mjs.map +1 -0
- package/bootstrap/host/project-cli-legacy.mjs +295 -0
- package/bootstrap/host/project-cli.mjs +74 -289
- package/bootstrap/host/project-cli.mjs.map +1 -0
- package/bootstrap/host/project-legacy.mjs +1080 -0
- package/bootstrap/host/project.mjs +210 -1060
- package/bootstrap/host/project.mjs.map +1 -0
- package/bootstrap/runtime/UNICODE-LICENSE.txt +39 -0
- package/bootstrap/runtime/memory.eli +30379 -0
- package/browser/host.mjs +732 -11
- package/browser/worker.mjs +6 -3
- package/compiler/eliscript-analyzer.el +371 -4
- package/compiler/eliscript-cli.el +84 -1
- package/compiler/eliscript-emitter.el +1189 -256
- package/compiler/eliscript-expander.el +147 -10
- package/compiler/eliscript-ir-emitter.el +725 -208
- package/compiler/eliscript-lower.el +127 -1
- package/compiler/eliscript-portable.el +177 -51
- package/compiler/eliscript-project.el +20 -2
- package/compiler/eliscript-reader.el +141 -57
- package/compiler/eliscript-source-map.el +26 -12
- package/compiler/eliscript-transient-analysis.el +382 -19
- package/dist/backends/async.mjs +561 -0
- package/dist/backends/async.mjs.macro-origins.json +1 -0
- package/dist/backends/async.mjs.map +1 -0
- package/dist/backends/binary.mjs +381 -0
- package/dist/backends/binary.mjs.macro-origins.json +1 -0
- package/dist/backends/binary.mjs.map +1 -0
- package/dist/backends/capabilities.mjs +237 -0
- package/dist/backends/capabilities.mjs.macro-origins.json +1 -0
- package/dist/backends/capabilities.mjs.map +1 -0
- package/dist/backends/elf.mjs +540 -0
- package/dist/backends/elf.mjs.macro-origins.json +1 -0
- package/dist/backends/elf.mjs.map +1 -0
- package/dist/backends/managed.mjs +10616 -0
- package/dist/backends/managed.mjs.macro-origins.json +1 -0
- package/dist/backends/managed.mjs.map +1 -0
- package/dist/backends/memory.mjs +278 -0
- package/dist/backends/memory.mjs.macro-origins.json +1 -0
- package/dist/backends/memory.mjs.map +1 -0
- package/dist/backends/native.mjs +4099 -0
- package/dist/backends/native.mjs.macro-origins.json +1 -0
- package/dist/backends/native.mjs.map +1 -0
- package/dist/backends/numeric.mjs +2458 -0
- package/dist/backends/numeric.mjs.macro-origins.json +1 -0
- package/dist/backends/numeric.mjs.map +1 -0
- package/dist/backends/optimize.mjs +204 -0
- package/dist/backends/optimize.mjs.macro-origins.json +1 -0
- package/dist/backends/optimize.mjs.map +1 -0
- package/dist/backends/regexp.mjs +2033 -0
- package/dist/backends/regexp.mjs.macro-origins.json +1 -0
- package/dist/backends/regexp.mjs.map +1 -0
- package/dist/backends/sha256.mjs +310 -0
- package/dist/backends/sha256.mjs.macro-origins.json +1 -0
- package/dist/backends/sha256.mjs.map +1 -0
- package/dist/backends/wasm.mjs +2258 -0
- package/dist/backends/wasm.mjs.macro-origins.json +1 -0
- package/dist/backends/wasm.mjs.map +1 -0
- package/dist/bootstrap/analyzer.mjs +1908 -776
- package/dist/bootstrap/analyzer.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/analyzer.mjs.map +1 -1
- package/dist/bootstrap/compiler.mjs +450 -142
- package/dist/bootstrap/compiler.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/compiler.mjs.map +1 -1
- package/dist/bootstrap/emitter.mjs +3083 -909
- package/dist/bootstrap/emitter.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/emitter.mjs.map +1 -1
- package/dist/bootstrap/expander.mjs +2887 -1233
- package/dist/bootstrap/expander.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/expander.mjs.map +1 -1
- package/dist/bootstrap/formatter.mjs +582 -218
- package/dist/bootstrap/formatter.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/formatter.mjs.map +1 -1
- package/dist/bootstrap/ir.mjs +670 -116
- package/dist/bootstrap/ir.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/ir.mjs.map +1 -1
- package/dist/bootstrap/lower.mjs +866 -257
- package/dist/bootstrap/lower.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/lower.mjs.map +1 -1
- package/dist/bootstrap/package.json +1 -0
- package/dist/bootstrap/project.mjs +1168 -498
- package/dist/bootstrap/project.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/project.mjs.map +1 -1
- package/dist/bootstrap/reader.mjs +674 -175
- package/dist/bootstrap/reader.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/reader.mjs.map +1 -1
- package/dist/bootstrap/runtime/math.mjs +1117 -0
- package/dist/bootstrap/runtime/math.mjs.map +1 -0
- package/dist/bootstrap/runtime/unicode-case-data.mjs +10125 -0
- package/dist/bootstrap/runtime/unicode-case-data.mjs.map +1 -0
- package/dist/bootstrap/runtime/unicode-case.mjs +281 -0
- package/dist/bootstrap/runtime/unicode-case.mjs.map +1 -0
- package/dist/bootstrap/source-map.mjs +430 -119
- package/dist/bootstrap/source-map.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/source-map.mjs.map +1 -1
- package/dist/bootstrap/symbol.mjs +229 -53
- package/dist/bootstrap/symbol.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/symbol.mjs.map +1 -1
- package/dist/bootstrap/syntax.mjs +205 -7
- package/dist/bootstrap/syntax.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/syntax.mjs.map +1 -1
- package/dist/bootstrap/transient-analysis.mjs +1185 -489
- package/dist/bootstrap/transient-analysis.mjs.macro-origins.json +1 -0
- package/dist/bootstrap/transient-analysis.mjs.map +1 -1
- package/dist/browser/compiler.js +199 -6478
- package/dist/browser/host.mjs +1078 -0
- package/dist/browser/loader.js +1 -0
- package/dist/browser/loader.mjs +231 -0
- package/dist/browser/worker.mjs +63 -0
- package/dist/compiler-artifact.json +1 -0
- package/dist/host/compiler-session.mjs +2980 -0
- package/dist/host/compiler-session.mjs.macro-origins.json +1 -0
- package/dist/host/compiler-session.mjs.map +1 -0
- package/dist/host/compiler-tools.mjs +1084 -0
- package/dist/host/compiler-tools.mjs.macro-origins.json +1 -0
- package/dist/host/compiler-tools.mjs.map +1 -0
- package/dist/literal-sources/runtime/core/collection-internals.eli +60 -0
- package/dist/literal-sources/runtime/core/collection.eli +639 -0
- package/dist/literal-sources/runtime/core/data-text.eli +290 -0
- package/dist/literal-sources/runtime/core/data.eli +22 -0
- package/dist/literal-sources/runtime/core/identifier.eli +44 -0
- package/dist/literal-sources/runtime/core/lazy-sequence.eli +131 -0
- package/dist/literal-sources/runtime/core/list.eli +19 -0
- package/dist/literal-sources/runtime/core/map.eli +9 -0
- package/dist/literal-sources/runtime/core/metadata-internals.eli +6 -0
- package/dist/literal-sources/runtime/core/metadata.eli +40 -0
- package/dist/literal-sources/runtime/core/object.eli +8 -0
- package/dist/literal-sources/runtime/core/order.eli +123 -0
- package/dist/literal-sources/runtime/core/persistent-kind.eli +28 -0
- package/dist/literal-sources/runtime/core/protocol-error.eli +32 -0
- package/dist/literal-sources/runtime/core/protocol.eli +28 -0
- package/dist/literal-sources/runtime/core/queue.eli +9 -0
- package/dist/literal-sources/runtime/core/record.eli +191 -0
- package/dist/literal-sources/runtime/core/regex.eli +158 -0
- package/dist/literal-sources/runtime/core/sequence.eli +305 -0
- package/dist/literal-sources/runtime/core/set-algebra.eli +28 -0
- package/dist/literal-sources/runtime/core/set.eli +9 -0
- package/dist/literal-sources/runtime/core/sorted.eli +408 -0
- package/dist/literal-sources/runtime/core/text.eli +14 -0
- package/dist/literal-sources/runtime/core/transducer.eli +268 -0
- package/dist/literal-sources/runtime/core/transient.eli +17 -0
- package/dist/literal-sources/runtime/core/truth.eli +4 -0
- package/dist/literal-sources/runtime/core/type.eli +232 -0
- package/dist/literal-sources/runtime/core/value-internals.eli +13 -0
- package/dist/literal-sources/runtime/core/value.eli +19 -0
- package/dist/literal-sources/runtime/core/vector.eli +25 -0
- package/dist/literal-sources/runtime/literals.eli +23 -0
- package/dist/literal-sources/runtime/testing/value.eli +6 -0
- package/dist/literal-sources/runtime/wire/http-rpc.eli +362 -0
- package/dist/literal-sources/runtime/wire/markdown.eli +275 -0
- package/dist/literal-sources/runtime/wire/schema.eli +193 -0
- package/dist/literal-sources/stdlib/bit.eli +36 -0
- package/dist/literal-sources/stdlib/core/data.eli +306 -0
- package/dist/literal-sources/stdlib/core/object.eli +89 -0
- package/dist/literal-sources/stdlib/core/protocol.eli +451 -0
- package/dist/literal-sources/stdlib/core/set.eli +312 -0
- package/dist/literal-sources/stdlib/core/text.eli +103 -0
- package/dist/literal-sources/stdlib/managed-literal-protocols.eli +494 -0
- package/dist/literal-sources/stdlib/managed-literals.eli +1469 -0
- package/dist/literal-sources/stdlib/managed-queue-state.eli +65 -0
- package/dist/literal-sources/stdlib/managed-sorted-state.eli +233 -0
- package/dist/literal-sources/stdlib/managed-transient-state.eli +348 -0
- package/dist/literal-sources/stdlib/managed-value-state.eli +153 -0
- package/dist/literal-sources/stdlib/managed-vector-view-state.eli +102 -0
- package/dist/literal-sources/stdlib/persistent-list.eli +145 -0
- package/dist/literal-sources/stdlib/persistent-map.eli +724 -0
- package/dist/literal-sources/stdlib/persistent-set.eli +236 -0
- package/dist/literal-sources/stdlib/persistent-vector.eli +359 -0
- package/dist/literal-sources/stdlib/value.eli +325 -0
- package/dist/package.json +10 -0
- package/dist/runtime/math.mjs +1116 -0
- package/dist/runtime/math.mjs.macro-origins.json +1 -0
- package/dist/runtime/math.mjs.map +1 -0
- package/dist/runtime/unicode-case-data.mjs +10124 -0
- package/dist/runtime/unicode-case-data.mjs.macro-origins.json +1 -0
- package/dist/runtime/unicode-case-data.mjs.map +1 -0
- package/dist/runtime/unicode-case.mjs +280 -0
- package/dist/runtime/unicode-case.mjs.macro-origins.json +1 -0
- package/dist/runtime/unicode-case.mjs.map +1 -0
- package/dist/runtime.eli +30379 -0
- package/dist/stage3-release.json +1 -0
- package/editor/README.md +1 -1
- package/editor/eliscript-mode.el +1 -1
- package/editor/eliscript-repl.el +1 -1
- package/package.json +106 -11
- package/platform/http.mjs +20 -0
- package/runtime/array-text.mjs +159 -0
- package/runtime/core/map-internals.mjs +27 -9
- package/runtime/core/object-impl.mjs +26 -17
- package/runtime/core/object-impl.mjs.map +1 -1
- package/runtime/core/protocol-impl.mjs +682 -255
- package/runtime/core/protocol-impl.mjs.map +1 -1
- package/runtime/core/protocol.mjs +4 -0
- package/runtime/core/record.mjs +23 -2
- package/runtime/core/regex.mjs +4 -0
- package/runtime/core/sorted.mjs +53 -0
- package/runtime/core/text-impl.mjs +167 -48
- package/runtime/core/text-impl.mjs.map +1 -1
- package/runtime/core/type.mjs +75 -3
- package/runtime/core/vector.mjs +6 -0
- package/runtime/math.eli +429 -0
- package/runtime/math.mjs +1116 -0
- package/runtime/math.mjs.map +1 -0
- package/runtime/number-radix.mjs +105 -0
- package/runtime/unicode-case-data.eli +29 -0
- package/runtime/unicode-case-data.mjs +10124 -0
- package/runtime/unicode-case-data.mjs.map +1 -0
- package/runtime/unicode-case.eli +100 -0
- package/runtime/unicode-case.mjs +280 -0
- package/runtime/unicode-case.mjs.map +1 -0
- package/runtime/wire/http-rpc.mjs +168 -0
- package/runtime/wire/markdown.mjs +196 -0
- package/runtime/wire/schema.mjs +109 -0
- package/stdlib/README.md +54 -0
- package/stdlib/core/protocol.eli +81 -17
- package/stdlib/core/seq.eli +1 -1
- package/stdlib/core/zipper.eli +172 -72
- package/stdlib/gepo.eli +12 -0
- package/stdlib/interop/js.eli +56 -15
- package/stdlib/managed-literal-protocols.eli +494 -0
- package/stdlib/managed-literals.eli +1469 -0
- package/stdlib/managed-protocol-error.eli +32 -0
- package/stdlib/managed-queue-state.eli +65 -0
- package/stdlib/managed-runtime-collection-internals.eli +60 -0
- package/stdlib/managed-runtime-collection.eli +639 -0
- package/stdlib/managed-runtime-data-text.eli +290 -0
- package/stdlib/managed-runtime-data.eli +22 -0
- package/stdlib/managed-runtime-identifier.eli +44 -0
- package/stdlib/managed-runtime-lazy-sequence.eli +131 -0
- package/stdlib/managed-runtime-list.eli +19 -0
- package/stdlib/managed-runtime-literals.eli +23 -0
- package/stdlib/managed-runtime-map.eli +9 -0
- package/stdlib/managed-runtime-metadata-internals.eli +6 -0
- package/stdlib/managed-runtime-metadata.eli +40 -0
- package/stdlib/managed-runtime-object.eli +8 -0
- package/stdlib/managed-runtime-order.eli +123 -0
- package/stdlib/managed-runtime-persistent-kind.eli +28 -0
- package/stdlib/managed-runtime-protocol.eli +28 -0
- package/stdlib/managed-runtime-queue.eli +9 -0
- package/stdlib/managed-runtime-record.eli +191 -0
- package/stdlib/managed-runtime-regex.eli +158 -0
- package/stdlib/managed-runtime-sequence.eli +305 -0
- package/stdlib/managed-runtime-set-algebra.eli +28 -0
- package/stdlib/managed-runtime-set.eli +9 -0
- package/stdlib/managed-runtime-sorted.eli +408 -0
- package/stdlib/managed-runtime-text.eli +14 -0
- package/stdlib/managed-runtime-transducer.eli +268 -0
- package/stdlib/managed-runtime-transient.eli +17 -0
- package/stdlib/managed-runtime-truth.eli +4 -0
- package/stdlib/managed-runtime-type.eli +232 -0
- package/stdlib/managed-runtime-value-internals.eli +13 -0
- package/stdlib/managed-runtime-value.eli +19 -0
- package/stdlib/managed-runtime-vector.eli +25 -0
- package/stdlib/managed-sorted-state.eli +233 -0
- package/stdlib/managed-testing-value.eli +6 -0
- package/stdlib/managed-transient-state.eli +348 -0
- package/stdlib/managed-value-state.eli +153 -0
- package/stdlib/managed-vector-view-state.eli +102 -0
- package/stdlib/managed-wire-http-rpc.eli +362 -0
- package/stdlib/managed-wire-markdown.eli +275 -0
- package/stdlib/managed-wire-schema.eli +193 -0
- package/stdlib/mdp.eli +7 -0
- package/stdlib/mds.eli +4 -0
- package/stdlib/persistent-vector.eli +23 -6
- package/tools/acceptance/check-legacy.mjs +687 -0
- package/tools/acceptance/check.eli +431 -0
- package/tools/acceptance/compile-evidence.el +49 -0
- package/tools/acceptance/finalize-legacy.mjs +498 -0
- package/tools/acceptance/finalize.eli +270 -0
- package/tools/backends/benchmark.mjs +175 -0
- package/tools/backends/build.mjs +135 -0
- package/tools/backends/compile.mjs +94 -0
- package/tools/backends/compiler-bootstrap.mjs +1001 -0
- package/tools/backends/compiler-browser.mjs +361 -0
- package/tools/backends/compiler-build.mjs +1628 -0
- package/tools/backends/compiler-cli-legacy.mjs +334 -0
- package/tools/backends/compiler-cli.mjs +29 -0
- package/tools/backends/compiler-corpus-bit.mjs +234 -0
- package/tools/backends/compiler-corpus-cli-adapters-legacy.mjs +362 -0
- package/tools/backends/compiler-corpus-cli-adapters.mjs +247 -0
- package/tools/backends/compiler-corpus-debugging.mjs +221 -0
- package/tools/backends/compiler-corpus-emitter.mjs +324 -0
- package/tools/backends/compiler-corpus-evaluation-adapters.mjs +65 -0
- package/tools/backends/compiler-corpus-execution-legacy.mjs +769 -0
- package/tools/backends/compiler-corpus-execution.mjs +3324 -0
- package/tools/backends/compiler-corpus-fuzz.mjs +229 -0
- package/tools/backends/compiler-corpus-generations.mjs +208 -0
- package/tools/backends/compiler-corpus-host-context-legacy.mjs +114 -0
- package/tools/backends/compiler-corpus-host-context.mjs +550 -0
- package/tools/backends/compiler-corpus-identity-host.mjs +553 -0
- package/tools/backends/compiler-corpus-identity-value-adapters-legacy.mjs +298 -0
- package/tools/backends/compiler-corpus-identity-value-adapters.mjs +69 -0
- package/tools/backends/compiler-corpus-isolated-exports.mjs +21 -0
- package/tools/backends/compiler-corpus-legacy.mjs +1155 -0
- package/tools/backends/compiler-corpus-literal-provider.mjs +282 -0
- package/tools/backends/compiler-corpus-managed-adapters-legacy.mjs +334 -0
- package/tools/backends/compiler-corpus-managed-adapters.mjs +937 -0
- package/tools/backends/compiler-corpus-managed-cases.mjs +179 -0
- package/tools/backends/compiler-corpus-managed-fixtures-legacy.mjs +879 -0
- package/tools/backends/compiler-corpus-managed-fixtures.mjs +1287 -0
- package/tools/backends/compiler-corpus-matchers.mjs +173 -0
- package/tools/backends/compiler-corpus-original-program.mjs +612 -0
- package/tools/backends/compiler-corpus-process.mjs +765 -0
- package/tools/backends/compiler-corpus-program-driver.mjs +306 -0
- package/tools/backends/compiler-corpus-project-adapters-legacy.mjs +497 -0
- package/tools/backends/compiler-corpus-project-adapters.mjs +340 -0
- package/tools/backends/compiler-corpus-project-entry-host.mjs +511 -0
- package/tools/backends/compiler-corpus-project-transport.mjs +151 -0
- package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1438 -0
- package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1456 -0
- package/tools/backends/compiler-corpus-raw-math-fixture.mjs +346 -0
- package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +523 -0
- package/tools/backends/compiler-corpus-reference-legacy.mjs +263 -0
- package/tools/backends/compiler-corpus-reference.mjs +241 -0
- package/tools/backends/compiler-corpus-runtime-adapters-legacy.mjs +843 -0
- package/tools/backends/compiler-corpus-runtime-adapters.mjs +663 -0
- package/tools/backends/compiler-corpus-source-archive.mjs +206 -0
- package/tools/backends/compiler-corpus-tools-artifact-adapters.mjs +410 -0
- package/tools/backends/compiler-corpus-tools-cli.mjs +363 -0
- package/tools/backends/compiler-corpus-tools-reference.mjs +264 -0
- package/tools/backends/compiler-corpus.mjs +2054 -0
- package/tools/backends/compiler-debug.mjs +142 -0
- package/tools/backends/compiler-matrix.mjs +1955 -0
- package/tools/backends/compiler-metadata.mjs +203 -0
- package/tools/backends/compiler-package-browser.mjs +120 -0
- package/tools/backends/compiler-package-legacy.mjs +654 -0
- package/tools/backends/compiler-package.mjs +464 -0
- package/tools/backends/compiler-project.mjs +126 -0
- package/tools/backends/compiler-session.mjs +843 -0
- package/tools/backends/compiler-sha256.mjs +152 -0
- package/tools/backends/compiler-unicode-profile-host.mjs +196 -0
- package/tools/backends/compiler-worker.mjs +573 -0
- package/tools/backends/dist/bootstrap-js-stages.mjs +919 -0
- package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -0
- package/tools/backends/dist/managed-ir-inventory.mjs +488 -0
- package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -0
- package/tools/backends/dist/record-grid.mjs +1256 -0
- package/tools/backends/dist/record-grid.mjs.map +1 -0
- package/tools/backends/dist/release-cli.mjs +462 -0
- package/tools/backends/dist/release-cli.mjs.map +1 -0
- package/tools/backends/dist/run-artifact.mjs +517 -0
- package/tools/backends/dist/run-artifact.mjs.map +1 -0
- package/tools/backends/eliscript/compiler-corpus-bit.eli +77 -0
- package/tools/backends/eliscript/compiler-corpus-debugging.eli +70 -0
- package/tools/backends/eliscript/compiler-corpus-project-entry-host.eli +256 -0
- package/tools/backends/managed-foreign-binding.mjs +497 -0
- package/tools/backends/managed-host-legacy.mjs +1181 -0
- package/tools/backends/managed-host-lifecycle.mjs +310 -0
- package/tools/backends/managed-host-object-provider.mjs +155 -0
- package/tools/backends/managed-host-object-realm.mjs +797 -0
- package/tools/backends/managed-host-proxy.mjs +71 -0
- package/tools/backends/managed-host-runtime.mjs +5868 -0
- package/tools/backends/managed-host.mjs +716 -0
- package/tools/backends/managed-module-graph-legacy.mjs +308 -0
- package/tools/backends/managed-module-graph.mjs +694 -0
- package/tools/backends/managed-runtime-host-legacy.mjs +195 -0
- package/tools/backends/managed-runtime.mjs +939 -0
- package/tools/backends/managed-source-view-legacy.mjs +332 -0
- package/tools/backends/managed-source-view.mjs +959 -0
- package/tools/backends/memory-runtime.mjs +100 -0
- package/tools/backends/native-benchmark.mjs +88 -0
- package/tools/backends/native-managed-runtime.mjs +677 -0
- package/tools/backends/native-memory.mjs +768 -0
- package/tools/backends/native-node-memory.mjs +142 -0
- package/tools/backends/native-node-runner.mjs +99 -0
- package/tools/backends/native-node-watchdog.mjs +19 -0
- package/tools/backends/native-node-worker.mjs +75 -0
- package/tools/backends/stage3-targets.mjs +493 -0
- package/tools/bootstrap-command.el +13 -0
- package/tools/bootstrap-runtime.el +101 -0
- package/tools/bootstrap-seed.el +55 -0
- package/tools/project/check-cli.eli +31 -0
- package/tools/project/project-cli.eli +42 -0
- package/tools/project/project.eli +122 -0
- package/tools/runtime/unicode-case-profiles.mjs +13 -0
- package/tools/runtime/unicode-case-runtime.el +57 -0
- package/tools/testing/source-debugging-corpus-host.eli +16 -0
- package/tools/testing/source-debugging.eli +139 -0
- package/tools/testing/stdlib-bit-corpus-host.eli +21 -0
- package/tools/testing/stdlib-bit-corpus-host.mjs +118 -0
- package/tools/testing/stdlib-bit.eli +104 -0
- package/tools/testing/stdlib-bit.mjs +255 -0
- package/bin/eliscript-bootstrap +0 -15
package/stdlib/core/zipper.eli
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
(import "../../runtime/core/list.mjs" EMPTY_LIST first persistentList rest)
|
|
4
4
|
(import "../../runtime/core/map.mjs" persistentHashMap)
|
|
5
5
|
(import "../../runtime/core/metadata.mjs" meta withMeta)
|
|
6
|
-
(import "../../runtime/core/vector.mjs" EMPTY_VECTOR persistentVector)
|
|
6
|
+
(import "../../runtime/core/vector.mjs" EMPTY_VECTOR PersistentVector persistentVector)
|
|
7
7
|
(defconst zipper-branch-key "eliscript.zipper/branch")
|
|
8
8
|
(defconst zipper-children-key "eliscript.zipper/children")
|
|
9
9
|
(defconst zipper-make-node-key "eliscript.zipper/make-node")
|
|
@@ -14,6 +14,18 @@
|
|
|
14
14
|
(defconst zipper-parent-path-index 2)
|
|
15
15
|
(defconst zipper-parent-nodes-index 3)
|
|
16
16
|
(defconst zipper-changed-index 4)
|
|
17
|
+
(defconst zipper-single-parent-index 5)
|
|
18
|
+
(defconst zipper-public-path-cache (new globalThis/WeakMap))
|
|
19
|
+
(defconst zipper-private-tuples (new globalThis/WeakSet))
|
|
20
|
+
(defconst zipper-valid-configs (new globalThis/WeakSet))
|
|
21
|
+
(defconst zipper-config-callbacks (new globalThis/WeakMap))
|
|
22
|
+
(defconst zipper-freeze Object/freeze)
|
|
23
|
+
(defconst zipper-is-array Array/isArray)
|
|
24
|
+
(defconst zipper-is-integer Number/isInteger)
|
|
25
|
+
(defun zipper-private-array
|
|
26
|
+
(&rest values)
|
|
27
|
+
(js-call zipper-private-tuples :add values)
|
|
28
|
+
(funcall zipper-freeze values))
|
|
17
29
|
(defun zipper-require-function
|
|
18
30
|
(value label)
|
|
19
31
|
(if (= (value-type value) "function")
|
|
@@ -21,34 +33,92 @@
|
|
|
21
33
|
(throw (new globalThis/TypeError (str label " must be a function")))))
|
|
22
34
|
(defun zipper-slot
|
|
23
35
|
(values target-index)
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
;; Registered work arrays need no structural probe. Compact copies retain
|
|
37
|
+
;; their format marker without a public persistent wrapper or traversal.
|
|
38
|
+
;; Original Vector/List paths retain their existing indexed/reducible path.
|
|
39
|
+
(if (or (js-call zipper-private-tuples :has values) (zipper-compact-array? values))
|
|
40
|
+
(if (and (>= target-index 0) (< target-index (js-length values)))
|
|
41
|
+
(aref values target-index)
|
|
42
|
+
(throw (new globalThis/TypeError "invalid zipper internal slot")))
|
|
43
|
+
(if (Collection/isVector values)
|
|
44
|
+
(let ((value (js-call values :nth target-index zipper-missing)))
|
|
45
|
+
(if (eq value zipper-missing)
|
|
46
|
+
(throw (new globalThis/TypeError "invalid zipper internal slot"))
|
|
47
|
+
value))
|
|
48
|
+
(let ((index 0) (box zipper-missing))
|
|
49
|
+
(Collection/reduce
|
|
50
|
+
values
|
|
51
|
+
(lambda
|
|
52
|
+
(state value)
|
|
53
|
+
(if (= index target-index)
|
|
54
|
+
(progn (setq box (js-object :value value)) (Collection/reduced state))
|
|
55
|
+
(progn (setq index (1+ index)) state)))
|
|
56
|
+
nil)
|
|
57
|
+
(if (eq box zipper-missing)
|
|
58
|
+
(throw (new globalThis/TypeError "invalid zipper internal slot"))
|
|
59
|
+
(get box :value))))))
|
|
36
60
|
(defun zipper-path-value (location) (zipper-slot location 1))
|
|
37
|
-
(defun zipper-config-value
|
|
61
|
+
(defun zipper-config-value
|
|
62
|
+
(location key)
|
|
63
|
+
(let* ((configuration (meta location))
|
|
64
|
+
(callbacks (if (not (nullish? configuration))
|
|
65
|
+
(js-call zipper-config-callbacks :get configuration)
|
|
66
|
+
undefined)))
|
|
67
|
+
(if (not (undefined? callbacks))
|
|
68
|
+
(aref callbacks key)
|
|
69
|
+
(Collection/get configuration key))))
|
|
38
70
|
(defun zipper-location
|
|
39
71
|
(node-value path-value configuration)
|
|
40
72
|
(withMeta (persistentVector node-value path-value) configuration))
|
|
41
73
|
(defun zipper-path
|
|
42
74
|
(left-values right-values parent-path parent-nodes changed)
|
|
43
|
-
|
|
75
|
+
;; These frozen work arrays stay lazy at a host boundary. A persistent
|
|
76
|
+
;; wrapper here would materialize the entire private parent graph there.
|
|
77
|
+
(zipper-private-array left-values right-values parent-path parent-nodes changed t))
|
|
78
|
+
(defun zipper-compact-array?
|
|
79
|
+
(value)
|
|
80
|
+
(and (funcall zipper-is-array value) (= (js-length value) 6)
|
|
81
|
+
(eq (aref value zipper-single-parent-index) t)))
|
|
82
|
+
(defun zipper-path-assoc
|
|
83
|
+
(path-value target-index value)
|
|
84
|
+
(if (or (js-call zipper-private-tuples :has path-value) (zipper-compact-array? path-value))
|
|
85
|
+
(progn
|
|
86
|
+
(unless (and (funcall zipper-is-integer target-index) (>= target-index 0) (<= target-index 4))
|
|
87
|
+
(throw (new globalThis/TypeError "invalid zipper internal slot")))
|
|
88
|
+
;; Copy the five state slots and retain the shared parent holder.
|
|
89
|
+
;; Do not route private work through public persistent-vector assoc.
|
|
90
|
+
(zipper-path
|
|
91
|
+
(if (= target-index 0) value (aref path-value 0))
|
|
92
|
+
(if (= target-index 1) value (aref path-value 1))
|
|
93
|
+
(if (= target-index 2) value (aref path-value 2))
|
|
94
|
+
(if (= target-index 3) value (aref path-value 3))
|
|
95
|
+
(if (= target-index 4) value (aref path-value 4))))
|
|
96
|
+
(Collection/assoc path-value target-index value)))
|
|
97
|
+
(defun zipper-single-parent?
|
|
98
|
+
(path-value)
|
|
99
|
+
(or (zipper-compact-array? path-value)
|
|
100
|
+
(and (Collection/isVector path-value)
|
|
101
|
+
(= (Collection/count path-value) 6)
|
|
102
|
+
(eq (zipper-slot path-value zipper-single-parent-index) t))))
|
|
103
|
+
(defun zipper-parent-node
|
|
104
|
+
(path-value)
|
|
105
|
+
(let ((parents (zipper-slot path-value zipper-parent-nodes-index)))
|
|
106
|
+
(if (zipper-single-parent? path-value)
|
|
107
|
+
(if (funcall zipper-is-array parents)
|
|
108
|
+
(if (> (js-length parents) 0) (aref parents 0)
|
|
109
|
+
(throw (new globalThis/TypeError "invalid zipper internal slot")))
|
|
110
|
+
(zipper-slot parents 0))
|
|
111
|
+
(zipper-slot parents (1- (Collection/count parents))))))
|
|
44
112
|
(defun zipper-materialize
|
|
45
113
|
(values)
|
|
46
114
|
(if (nullish? values)
|
|
47
115
|
EMPTY_VECTOR
|
|
48
|
-
(Collection/
|
|
116
|
+
(if (and (Collection/isVector values) (nil? (meta values)))
|
|
49
117
|
values
|
|
50
|
-
(
|
|
51
|
-
|
|
118
|
+
(Collection/reduce
|
|
119
|
+
values
|
|
120
|
+
(lambda (result value) (Collection/conj result value))
|
|
121
|
+
EMPTY_VECTOR))))
|
|
52
122
|
(defun zipper-right-list
|
|
53
123
|
(values start-index)
|
|
54
124
|
(let ((result EMPTY_LIST) (index (1- (Collection/count values))))
|
|
@@ -62,21 +132,24 @@
|
|
|
62
132
|
(funcall (zipper-config-value location zipper-children-key) (node location))))
|
|
63
133
|
(defun zipper-rebuild-children
|
|
64
134
|
(left-values node-value right-values)
|
|
65
|
-
(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
(
|
|
76
|
-
|
|
135
|
+
(if (and (Collection/isVector left-values) (= (get left-values :count) 0)
|
|
136
|
+
(Collection/isList right-values) (= (get right-values :count) 0))
|
|
137
|
+
(persistentVector node-value)
|
|
138
|
+
(let
|
|
139
|
+
(
|
|
140
|
+
(result
|
|
141
|
+
(Collection/reduce
|
|
142
|
+
left-values
|
|
143
|
+
(lambda (values value) (Collection/conj values value))
|
|
144
|
+
EMPTY_VECTOR)))
|
|
145
|
+
(setq result (Collection/conj result node-value))
|
|
146
|
+
(Collection/reduce
|
|
147
|
+
right-values
|
|
148
|
+
(lambda (values value) (Collection/conj values value))
|
|
149
|
+
result))))
|
|
77
150
|
(defun zipper-mark-changed
|
|
78
151
|
(path-value)
|
|
79
|
-
(if (nil? path-value) nil (
|
|
152
|
+
(if (nil? path-value) nil (zipper-path-assoc path-value zipper-changed-index t)))
|
|
80
153
|
(defun zipper-active?
|
|
81
154
|
(location)
|
|
82
155
|
(not (= (zipper-path-value location) zipper-end-path)))
|
|
@@ -114,6 +187,12 @@
|
|
|
114
187
|
(js-array zipper-branch-key branch-predicate)
|
|
115
188
|
(js-array zipper-children-key child-reader)
|
|
116
189
|
(js-array zipper-make-node-key node-builder))))
|
|
190
|
+
(js-call zipper-valid-configs :add configuration)
|
|
191
|
+
(js-call zipper-config-callbacks :set configuration
|
|
192
|
+
(js-object
|
|
193
|
+
"eliscript.zipper/branch" branch-predicate
|
|
194
|
+
"eliscript.zipper/children" child-reader
|
|
195
|
+
"eliscript.zipper/make-node" node-builder))
|
|
117
196
|
(zipper-location root-node nil configuration)))
|
|
118
197
|
(defun vector-zipper
|
|
119
198
|
(root-node)
|
|
@@ -123,15 +202,22 @@
|
|
|
123
202
|
(zipper Collection/isList (lambda (value) value) zipper-list-node root-node))
|
|
124
203
|
(defun zipper?
|
|
125
204
|
(value)
|
|
126
|
-
(if (and (Collection/isVector value) (= (
|
|
205
|
+
(if (and (Collection/isVector value) (= (get value :count) 2))
|
|
127
206
|
(let ((configuration (meta value)))
|
|
128
|
-
(and
|
|
129
|
-
|
|
130
|
-
(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
207
|
+
(if (and (not (nullish? configuration)) (js-call zipper-valid-configs :has configuration))
|
|
208
|
+
t
|
|
209
|
+
(let
|
|
210
|
+
(
|
|
211
|
+
(valid
|
|
212
|
+
(and
|
|
213
|
+
(Collection/isMap configuration)
|
|
214
|
+
(= (value-type (Collection/get configuration zipper-branch-key)) "function")
|
|
215
|
+
(= (value-type (Collection/get configuration zipper-children-key)) "function")
|
|
216
|
+
(=
|
|
217
|
+
(value-type (Collection/get configuration zipper-make-node-key))
|
|
218
|
+
"function"))))
|
|
219
|
+
(when valid (js-call zipper-valid-configs :add configuration))
|
|
220
|
+
valid)))
|
|
135
221
|
false))
|
|
136
222
|
(defun node
|
|
137
223
|
(location)
|
|
@@ -140,15 +226,18 @@
|
|
|
140
226
|
(defun end?
|
|
141
227
|
(location)
|
|
142
228
|
(zipper-require-location location "end?")
|
|
143
|
-
(
|
|
229
|
+
(not (zipper-active? location)))
|
|
230
|
+
(defun zipper-branch-value
|
|
231
|
+
(location)
|
|
232
|
+
;; The caller has validated the location. Read the callback dynamically;
|
|
233
|
+
;; callers still validate again after user callbacks can change protocols.
|
|
234
|
+
(if (funcall (zipper-config-value location zipper-branch-key) (zipper-slot location 0))
|
|
235
|
+
t
|
|
236
|
+
false))
|
|
144
237
|
(defun branch?
|
|
145
238
|
(location)
|
|
146
239
|
(zipper-require-location location "branch?")
|
|
147
|
-
(if (
|
|
148
|
-
false
|
|
149
|
-
(if (funcall (zipper-config-value location zipper-branch-key) (node location))
|
|
150
|
-
t
|
|
151
|
-
false)))
|
|
240
|
+
(if (zipper-active? location) (zipper-branch-value location) false))
|
|
152
241
|
(defun children
|
|
153
242
|
(location)
|
|
154
243
|
(zipper-require-active-location location "children")
|
|
@@ -168,7 +257,26 @@
|
|
|
168
257
|
(let ((path-value (zipper-path-value location)))
|
|
169
258
|
(if (or (nil? path-value) (= path-value zipper-end-path))
|
|
170
259
|
nil
|
|
171
|
-
(zipper-
|
|
260
|
+
(if (not (zipper-single-parent? path-value))
|
|
261
|
+
(zipper-slot path-value zipper-parent-nodes-index)
|
|
262
|
+
(let ((holder (zipper-slot path-value zipper-parent-nodes-index)))
|
|
263
|
+
(if (js-call zipper-public-path-cache :has holder)
|
|
264
|
+
(js-call zipper-public-path-cache :get holder)
|
|
265
|
+
(let ((pending (js-array)) (current path-value) (result EMPTY_VECTOR))
|
|
266
|
+
(while (and (not (nil? current)) (zipper-single-parent? current))
|
|
267
|
+
(js-call pending :push (zipper-parent-node current))
|
|
268
|
+
(setq current (zipper-slot current zipper-parent-path-index)))
|
|
269
|
+
;; A caller-created original path keeps its original ancestry;
|
|
270
|
+
;; new descents may use it as an unchanged prefix.
|
|
271
|
+
(if (nil? current)
|
|
272
|
+
(setq result (js-call PersistentVector :from (js-call pending :reverse)))
|
|
273
|
+
(progn
|
|
274
|
+
(setq result (zipper-materialize (zipper-slot current zipper-parent-nodes-index)))
|
|
275
|
+
(let ((index (js-length pending)))
|
|
276
|
+
(while (> index 0)
|
|
277
|
+
(setq index (1- index) result (Collection/conj result (aref pending index)))))))
|
|
278
|
+
(js-call zipper-public-path-cache :set holder result)
|
|
279
|
+
result)))))))
|
|
172
280
|
(defun lefts
|
|
173
281
|
(location)
|
|
174
282
|
(zipper-require-location location "lefts")
|
|
@@ -186,7 +294,7 @@
|
|
|
186
294
|
(defun down
|
|
187
295
|
(location)
|
|
188
296
|
(zipper-require-location location "down")
|
|
189
|
-
(if (or (
|
|
297
|
+
(if (or (not (zipper-active? location)) (not (zipper-branch-value location)))
|
|
190
298
|
nil
|
|
191
299
|
(let*
|
|
192
300
|
((child-values (zipper-children-vector location))
|
|
@@ -195,11 +303,7 @@
|
|
|
195
303
|
nil
|
|
196
304
|
(let*
|
|
197
305
|
((path-value (zipper-path-value location))
|
|
198
|
-
(parent-nodes
|
|
199
|
-
(if (nil? path-value)
|
|
200
|
-
EMPTY_VECTOR
|
|
201
|
-
(zipper-slot path-value zipper-parent-nodes-index)))
|
|
202
|
-
(next-parent-nodes (Collection/conj parent-nodes (node location))))
|
|
306
|
+
(next-parent-nodes (zipper-private-array (node location))))
|
|
203
307
|
(zipper-location
|
|
204
308
|
(zipper-slot child-values 0)
|
|
205
309
|
(zipper-path
|
|
@@ -217,9 +321,7 @@
|
|
|
217
321
|
nil
|
|
218
322
|
(let*
|
|
219
323
|
((parent-path (zipper-slot path-value zipper-parent-path-index))
|
|
220
|
-
(parent-
|
|
221
|
-
(parent-node
|
|
222
|
-
(zipper-slot parent-nodes (1- (Collection/count parent-nodes)))))
|
|
324
|
+
(parent-node (zipper-parent-node path-value)))
|
|
223
325
|
(if (zipper-slot path-value zipper-changed-index)
|
|
224
326
|
(zipper-location
|
|
225
327
|
(make-node
|
|
@@ -243,8 +345,8 @@
|
|
|
243
345
|
nil
|
|
244
346
|
(zipper-location
|
|
245
347
|
(first right-values)
|
|
246
|
-
(
|
|
247
|
-
(
|
|
348
|
+
(zipper-path-assoc
|
|
349
|
+
(zipper-path-assoc
|
|
248
350
|
path-value
|
|
249
351
|
zipper-lefts-index
|
|
250
352
|
(Collection/conj
|
|
@@ -266,8 +368,8 @@
|
|
|
266
368
|
nil
|
|
267
369
|
(zipper-location
|
|
268
370
|
(zipper-slot left-values (1- left-count))
|
|
269
|
-
(
|
|
270
|
-
(
|
|
371
|
+
(zipper-path-assoc
|
|
372
|
+
(zipper-path-assoc
|
|
271
373
|
path-value
|
|
272
374
|
zipper-lefts-index
|
|
273
375
|
(Collection/pop left-values))
|
|
@@ -303,8 +405,8 @@
|
|
|
303
405
|
(setq index (1+ index)))
|
|
304
406
|
(zipper-location
|
|
305
407
|
(zipper-slot right-values (1- right-count))
|
|
306
|
-
(
|
|
307
|
-
(
|
|
408
|
+
(zipper-path-assoc
|
|
409
|
+
(zipper-path-assoc path-value zipper-lefts-index next-lefts)
|
|
308
410
|
zipper-rights-index
|
|
309
411
|
EMPTY_LIST)
|
|
310
412
|
(meta location))))))))
|
|
@@ -333,8 +435,8 @@
|
|
|
333
435
|
(setq index (1- index)))
|
|
334
436
|
(zipper-location
|
|
335
437
|
(zipper-slot left-values 0)
|
|
336
|
-
(
|
|
337
|
-
(
|
|
438
|
+
(zipper-path-assoc
|
|
439
|
+
(zipper-path-assoc path-value zipper-lefts-index EMPTY_VECTOR)
|
|
338
440
|
zipper-rights-index
|
|
339
441
|
next-rights)
|
|
340
442
|
(meta location))))))))
|
|
@@ -354,8 +456,8 @@
|
|
|
354
456
|
(throw (new globalThis/TypeError "insert-left cannot insert at the root"))
|
|
355
457
|
(zipper-location
|
|
356
458
|
(node location)
|
|
357
|
-
(
|
|
358
|
-
(
|
|
459
|
+
(zipper-path-assoc
|
|
460
|
+
(zipper-path-assoc path-value zipper-changed-index t)
|
|
359
461
|
zipper-lefts-index
|
|
360
462
|
(Collection/conj (zipper-slot path-value zipper-lefts-index) item))
|
|
361
463
|
(meta location)))))
|
|
@@ -367,8 +469,8 @@
|
|
|
367
469
|
(throw (new globalThis/TypeError "insert-right cannot insert at the root"))
|
|
368
470
|
(zipper-location
|
|
369
471
|
(node location)
|
|
370
|
-
(
|
|
371
|
-
(
|
|
472
|
+
(zipper-path-assoc
|
|
473
|
+
(zipper-path-assoc path-value zipper-changed-index t)
|
|
372
474
|
zipper-rights-index
|
|
373
475
|
(Collection/conj (zipper-slot path-value zipper-rights-index) item))
|
|
374
476
|
(meta location)))))
|
|
@@ -422,8 +524,8 @@
|
|
|
422
524
|
(zipper-deepest-right
|
|
423
525
|
(zipper-location
|
|
424
526
|
(zipper-slot left-values (1- left-count))
|
|
425
|
-
(
|
|
426
|
-
(
|
|
527
|
+
(zipper-path-assoc
|
|
528
|
+
(zipper-path-assoc
|
|
427
529
|
path-value
|
|
428
530
|
zipper-lefts-index
|
|
429
531
|
(Collection/pop left-values))
|
|
@@ -432,9 +534,7 @@
|
|
|
432
534
|
(meta location)))
|
|
433
535
|
(let*
|
|
434
536
|
((parent-path (zipper-slot path-value zipper-parent-path-index))
|
|
435
|
-
(parent-
|
|
436
|
-
(parent-node
|
|
437
|
-
(zipper-slot parent-nodes (1- (Collection/count parent-nodes)))))
|
|
537
|
+
(parent-node (zipper-parent-node path-value)))
|
|
438
538
|
(zipper-location
|
|
439
539
|
(make-node
|
|
440
540
|
location
|
package/stdlib/gepo.eli
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
(module eliscript.gepo
|
|
2
|
+
(import "../runtime/wire/http-rpc.mjs" :as HTTP)
|
|
3
|
+
(defun gepo-operation (options) (HTTP/defineOperation options))
|
|
4
|
+
(defun gepo-usage (operation) (HTTP/usageMarkdown operation))
|
|
5
|
+
(defun gepo-index (title operations &rest path)
|
|
6
|
+
(apply HTTP/pathIndexMarkdown (js-cons title (js-cons operations path))))
|
|
7
|
+
(defun gepo-discovery-candidates (url) (HTTP/discoveryCandidates url))
|
|
8
|
+
(defun gepo-classify-discovery (response) (HTTP/classifyDiscovery response))
|
|
9
|
+
(defun gepo-service (&rest options) (apply HTTP/createService options))
|
|
10
|
+
(defun gepo-client (&rest options) (apply HTTP/createClient options))
|
|
11
|
+
(export gepo-classify-discovery gepo-client gepo-discovery-candidates
|
|
12
|
+
gepo-index gepo-operation gepo-service gepo-usage))
|
package/stdlib/interop/js.eli
CHANGED
|
@@ -25,32 +25,73 @@
|
|
|
25
25
|
|
|
26
26
|
(defconst interop-array-predicate (js* "Array.isArray"))
|
|
27
27
|
(defconst interop-map-predicate
|
|
28
|
-
(
|
|
28
|
+
(let ((sentinel (js-call globalThis/Object :freeze (js-object))))
|
|
29
|
+
(lambda (value)
|
|
30
|
+
(try
|
|
31
|
+
(progn
|
|
32
|
+
(js-call (get (get globalThis/Map :prototype) :has) :call value sentinel)
|
|
33
|
+
t)
|
|
34
|
+
(catch error false)))))
|
|
29
35
|
(defconst interop-set-predicate
|
|
30
|
-
(
|
|
36
|
+
(let ((sentinel (js-call globalThis/Object :freeze (js-object))))
|
|
37
|
+
(lambda (value)
|
|
38
|
+
(try
|
|
39
|
+
(progn
|
|
40
|
+
(js-call (get (get globalThis/Set :prototype) :has) :call value sentinel)
|
|
41
|
+
t)
|
|
42
|
+
(catch error false)))))
|
|
31
43
|
(defconst interop-object-predicate
|
|
32
|
-
(
|
|
44
|
+
(lambda (value)
|
|
45
|
+
(if (or (nil? value) (/= (js* "typeof value") "object"))
|
|
46
|
+
false
|
|
47
|
+
(try
|
|
48
|
+
(let ((prototype (js-call globalThis/Object :getPrototypeOf value)))
|
|
49
|
+
(or (nil? prototype)
|
|
50
|
+
(nil? (js-call globalThis/Object :getPrototypeOf prototype))))
|
|
51
|
+
(catch error false)))))
|
|
33
52
|
(defconst interop-safe-integer-predicate (js* "Number.isSafeInteger"))
|
|
34
|
-
(defconst interop-map-factory (
|
|
35
|
-
(defconst interop-set-factory (
|
|
36
|
-
(defconst interop-object-factory (
|
|
37
|
-
(defconst interop-weak-map-factory (
|
|
53
|
+
(defconst interop-map-factory (lambda () (new globalThis/Map)))
|
|
54
|
+
(defconst interop-set-factory (lambda () (new globalThis/Set)))
|
|
55
|
+
(defconst interop-object-factory (lambda () (js-object)))
|
|
56
|
+
(defconst interop-weak-map-factory (lambda () (new globalThis/WeakMap)))
|
|
38
57
|
(defconst interop-map-entries
|
|
39
|
-
(
|
|
58
|
+
(lambda (value)
|
|
59
|
+
(js-call globalThis/Array :from
|
|
60
|
+
(js-call (get (get globalThis/Map :prototype) :entries) :call value))))
|
|
40
61
|
(defconst interop-set-values
|
|
41
|
-
(
|
|
42
|
-
|
|
62
|
+
(lambda (value)
|
|
63
|
+
(js-call globalThis/Array :from
|
|
64
|
+
(js-call (get (get globalThis/Set :prototype) :values) :call value))))
|
|
65
|
+
(defconst interop-iterable-values
|
|
66
|
+
(lambda (value) (js-call globalThis/Array :from value)))
|
|
43
67
|
(defconst interop-json-string (js* "JSON.stringify"))
|
|
44
68
|
(defconst interop-enumerable-own-keys
|
|
45
|
-
(
|
|
69
|
+
(lambda (value)
|
|
70
|
+
(js-call (js-call globalThis/Reflect :ownKeys value) :filter
|
|
71
|
+
(lambda (key)
|
|
72
|
+
(js-call (get (get globalThis/Object :prototype) :propertyIsEnumerable)
|
|
73
|
+
:call value key)))))
|
|
46
74
|
(defconst interop-own-data-property
|
|
47
|
-
(
|
|
75
|
+
(lambda (value key)
|
|
76
|
+
(let ((descriptor (js-call globalThis/Object :getOwnPropertyDescriptor value key)))
|
|
77
|
+
(if (and (not (undefined? descriptor))
|
|
78
|
+
(js-call (get (get globalThis/Object :prototype) :hasOwnProperty)
|
|
79
|
+
:call descriptor "value"))
|
|
80
|
+
(js-object :ok t :value (get descriptor :value))
|
|
81
|
+
(js-object :ok false :value undefined)))))
|
|
48
82
|
(defconst interop-define-property
|
|
49
|
-
(
|
|
83
|
+
(lambda (target key value)
|
|
84
|
+
(js-call globalThis/Object :defineProperty target key
|
|
85
|
+
(js-object :value value :enumerable t :configurable t :writable t))
|
|
86
|
+
target))
|
|
50
87
|
(defconst interop-map-set
|
|
51
|
-
(
|
|
88
|
+
(lambda (target key value)
|
|
89
|
+
(js-call (get (get globalThis/Map :prototype) :set) :call target key value)
|
|
90
|
+
target))
|
|
52
91
|
(defconst interop-set-add
|
|
53
|
-
(
|
|
92
|
+
(lambda (target value)
|
|
93
|
+
(js-call (get (get globalThis/Set :prototype) :add) :call target value)
|
|
94
|
+
target))
|
|
54
95
|
|
|
55
96
|
(defun interop-fail (code message path &optional origin)
|
|
56
97
|
(throw
|