eliscript 0.0.2 → 0.0.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/README.md +13 -11
- package/bootstrap/README.md +13 -8
- package/bootstrap/host/build.eli +2 -0
- package/bootstrap/host/bun.eli +2 -0
- package/bootstrap/host/check-cli-legacy.eli +2 -0
- package/bootstrap/host/evaluation-cli.eli +2 -0
- package/bootstrap/host/evaluation.eli +2 -0
- package/bootstrap/host/format-cli.eli +2 -0
- package/bootstrap/host/project-cli-legacy.eli +2 -0
- package/bootstrap/host/project-legacy.eli +2 -0
- package/bootstrap/host/watch-cli.eli +2 -0
- package/bootstrap/host/watch.eli +2 -0
- package/browser/README.md +33 -0
- package/browser/host.eli +2 -0
- package/browser/host.mjs +643 -11
- package/browser/worker.eli +2 -0
- package/browser/worker.mjs +6 -3
- package/dist/browser/host.mjs +643 -11
- package/dist/browser/worker.mjs +6 -3
- package/dist/compiler-artifact.json +1 -1
- package/dist/literal-sources/runtime/core/collection.eli +76 -16
- package/dist/literal-sources/runtime/core/metadata.eli +25 -8
- package/dist/literal-sources/runtime/core/vector.eli +7 -2
- package/dist/literal-sources/stdlib/managed-literal-protocols.eli +18 -7
- package/dist/literal-sources/stdlib/managed-literals.eli +121 -66
- package/dist/stage3-release.json +1 -1
- package/package.json +11 -2
- package/platform/README.md +33 -12
- package/platform/browser.eli +2 -0
- package/platform/http.eli +2 -0
- package/platform/worker.eli +2 -0
- package/runtime/README.md +34 -14
- package/runtime/array-text.eli +2 -0
- package/runtime/core/collection-internals.eli +2 -0
- package/runtime/core/collection.eli +2 -0
- package/runtime/core/collection.mjs +99 -17
- package/runtime/core/data-text.eli +2 -0
- package/runtime/core/data.eli +2 -0
- package/runtime/core/data.mjs +7 -5
- package/runtime/core/identifier.eli +2 -0
- package/runtime/core/lazy-sequence.eli +2 -0
- package/runtime/core/list-internals.eli +2 -0
- package/runtime/core/list.eli +2 -0
- package/runtime/core/list.mjs +3 -0
- package/runtime/core/map-internals.eli +2 -0
- package/runtime/core/map.eli +2 -0
- package/runtime/core/map.mjs +5 -0
- package/runtime/core/metadata-internals.eli +2 -0
- package/runtime/core/metadata.eli +2 -0
- package/runtime/core/metadata.mjs +14 -0
- package/runtime/core/object.eli +2 -0
- package/runtime/core/order.eli +2 -0
- package/runtime/core/order.mjs +35 -6
- package/runtime/core/persistent-kind.eli +2 -0
- package/runtime/core/persistent-kind.mjs +6 -0
- package/runtime/core/protocol-error.eli +2 -0
- package/runtime/core/protocol.eli +2 -0
- package/runtime/core/queue-internals.eli +2 -0
- package/runtime/core/queue.eli +2 -0
- package/runtime/core/queue.mjs +3 -0
- package/runtime/core/record.eli +2 -0
- package/runtime/core/regex.eli +2 -0
- package/runtime/core/sequence.eli +2 -0
- package/runtime/core/sequence.mjs +75 -13
- package/runtime/core/set-algebra.eli +2 -0
- package/runtime/core/set-internals.eli +2 -0
- package/runtime/core/set.eli +2 -0
- package/runtime/core/sorted-internals.eli +2 -0
- package/runtime/core/sorted.eli +2 -0
- package/runtime/core/text.eli +2 -0
- package/runtime/core/transducer.eli +2 -0
- package/runtime/core/transient-internals.eli +2 -0
- package/runtime/core/transient.eli +2 -0
- package/runtime/core/transient.mjs +59 -10
- package/runtime/core/truth.eli +2 -0
- package/runtime/core/type.eli +2 -0
- package/runtime/core/value-internals.eli +2 -0
- package/runtime/core/value.eli +2 -0
- package/runtime/core/vector-internals.eli +2 -0
- package/runtime/core/vector-internals.mjs +3 -6
- package/runtime/core/vector.eli +2 -0
- package/runtime/core/vector.mjs +125 -7
- package/runtime/literals.eli +2 -0
- package/runtime/number-radix.eli +2 -0
- package/runtime/source-mapping.eli +2 -0
- package/runtime/testing/list.eli +2 -0
- package/runtime/testing/map.eli +2 -0
- package/runtime/testing/queue.eli +2 -0
- package/runtime/testing/set.eli +2 -0
- package/runtime/testing/sorted.eli +2 -0
- package/runtime/testing/value.eli +2 -0
- package/runtime/testing/vector.eli +2 -0
- package/runtime/wire/http-rpc.eli +2 -0
- package/runtime/wire/markdown.eli +2 -0
- package/runtime/wire/schema.eli +2 -0
- package/runtime/worker-value-codec.eli +2 -0
- package/runtime/worker-value-stream.eli +2 -0
- package/runtime/worker.eli +2 -0
- package/stdlib/README.md +2 -2
- package/stdlib/core/order.eli +36 -10
- package/stdlib/core/seq.eli +104 -75
- package/stdlib/core/zipper.eli +274 -101
- package/stdlib/managed-literal-protocols.eli +18 -7
- package/stdlib/managed-literals.eli +121 -66
- package/stdlib/managed-runtime-collection.eli +76 -16
- package/stdlib/managed-runtime-metadata.eli +25 -8
- package/stdlib/managed-runtime-order.eli +32 -10
- package/stdlib/managed-runtime-sequence.eli +69 -28
- package/stdlib/managed-runtime-vector.eli +7 -2
- package/tools/acceptance/check.eli +13 -3
- package/tools/backends/compiler-build.mjs +140 -140
- package/tools/backends/dist/release-cli.mjs +2 -0
- package/tools/backends/dist/release-cli.mjs.map +1 -1
- package/tools/backends/stage3-targets.mjs +121 -114
- package/bootstrap/host/eliscript-cli-legacy.mjs +0 -37
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(module capsules.browser.worker
|
|
2
|
+
(js* "// Module worker for the browser compile host.\n//\n// Compilation runs here so an editor stays responsive, and the host is imported\n// by a relative path because a worker realm has no document and therefore no\n// import map. The worker returns plain data: the main thread creates the blob\n// URLs and executes the entry, so no blob URL crosses a realm boundary.\n\nimport { compileProject, compileSource, outputPathFor } from \"./host.mjs\";\n\n// A function cannot cross the worker boundary, so the caller passes the URL the\n// package is served from and the worker builds the resolver. Pointing the\n// runtime at a URL rather than an import map is what lets compiled output run\n// from blob modules, which have no directory of their own.\nfunction externalResolver(runtimeBase) {\n if (typeof runtimeBase !== \"string\" || runtimeBase.length === 0) return undefined;\n const base = new URL(runtimeBase);\n return (specifier) => {\n if (!specifier.startsWith(\"eliscript/\")) return undefined;\n const subpath = specifier.slice(\"eliscript/\".length);\n const normalized = /\\.[a-z0-9]+$/iu.test(subpath) ? subpath : `${subpath}.mjs`;\n return new URL(normalized, base).href;\n };\n}\n\nfunction compile(request) {\n const resolveExternal = externalResolver(request.runtimeBase);\n if (request.mode === \"project\") {\n return compileProject({\n files: request.files,\n entry: request.entry,\n resolveExternal,\n });\n }\n const options = resolveExternal === undefined ? {} : { resolveExternal };\n const output = outputPathFor(request.filename);\n return {\n plan: { entries: [request.filename], modules: [{ id: request.filename, dependencies: [] }] },\n modules: {\n [output]: {\n id: request.filename,\n source: request.source,\n ...compileSource(request.source, request.filename, options),\n },\n },\n };\n}\n\nself.addEventListener(\"message\", (event) => {\n const { id, request } = event.data ?? {};\n try {\n const result = compile(request);\n self.postMessage({ id, ok: true, plan: result.plan, modules: result.modules });\n } catch (error) {\n self.postMessage({\n id,\n ok: false,\n message: error?.message ?? String(error),\n diagnostics: error?.diagnostics ?? [],\n });\n }\n});\n\nself.postMessage({ ready: true });\n"))
|
package/browser/worker.mjs
CHANGED
|
@@ -14,9 +14,12 @@ import { compileProject, compileSource, outputPathFor } from "./host.mjs";
|
|
|
14
14
|
function externalResolver(runtimeBase) {
|
|
15
15
|
if (typeof runtimeBase !== "string" || runtimeBase.length === 0) return undefined;
|
|
16
16
|
const base = new URL(runtimeBase);
|
|
17
|
-
return (specifier) =>
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
return (specifier) => {
|
|
18
|
+
if (!specifier.startsWith("eliscript/")) return undefined;
|
|
19
|
+
const subpath = specifier.slice("eliscript/".length);
|
|
20
|
+
const normalized = /\.[a-z0-9]+$/iu.test(subpath) ? subpath : `${subpath}.mjs`;
|
|
21
|
+
return new URL(normalized, base).href;
|
|
22
|
+
};
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
function compile(request) {
|