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.
Files changed (115) hide show
  1. package/README.md +13 -11
  2. package/bootstrap/README.md +13 -8
  3. package/bootstrap/host/build.eli +2 -0
  4. package/bootstrap/host/bun.eli +2 -0
  5. package/bootstrap/host/check-cli-legacy.eli +2 -0
  6. package/bootstrap/host/evaluation-cli.eli +2 -0
  7. package/bootstrap/host/evaluation.eli +2 -0
  8. package/bootstrap/host/format-cli.eli +2 -0
  9. package/bootstrap/host/project-cli-legacy.eli +2 -0
  10. package/bootstrap/host/project-legacy.eli +2 -0
  11. package/bootstrap/host/watch-cli.eli +2 -0
  12. package/bootstrap/host/watch.eli +2 -0
  13. package/browser/README.md +33 -0
  14. package/browser/host.eli +2 -0
  15. package/browser/host.mjs +643 -11
  16. package/browser/worker.eli +2 -0
  17. package/browser/worker.mjs +6 -3
  18. package/dist/browser/host.mjs +643 -11
  19. package/dist/browser/worker.mjs +6 -3
  20. package/dist/compiler-artifact.json +1 -1
  21. package/dist/literal-sources/runtime/core/collection.eli +76 -16
  22. package/dist/literal-sources/runtime/core/metadata.eli +25 -8
  23. package/dist/literal-sources/runtime/core/vector.eli +7 -2
  24. package/dist/literal-sources/stdlib/managed-literal-protocols.eli +18 -7
  25. package/dist/literal-sources/stdlib/managed-literals.eli +121 -66
  26. package/dist/stage3-release.json +1 -1
  27. package/package.json +11 -2
  28. package/platform/README.md +33 -12
  29. package/platform/browser.eli +2 -0
  30. package/platform/http.eli +2 -0
  31. package/platform/worker.eli +2 -0
  32. package/runtime/README.md +34 -14
  33. package/runtime/array-text.eli +2 -0
  34. package/runtime/core/collection-internals.eli +2 -0
  35. package/runtime/core/collection.eli +2 -0
  36. package/runtime/core/collection.mjs +99 -17
  37. package/runtime/core/data-text.eli +2 -0
  38. package/runtime/core/data.eli +2 -0
  39. package/runtime/core/data.mjs +7 -5
  40. package/runtime/core/identifier.eli +2 -0
  41. package/runtime/core/lazy-sequence.eli +2 -0
  42. package/runtime/core/list-internals.eli +2 -0
  43. package/runtime/core/list.eli +2 -0
  44. package/runtime/core/list.mjs +3 -0
  45. package/runtime/core/map-internals.eli +2 -0
  46. package/runtime/core/map.eli +2 -0
  47. package/runtime/core/map.mjs +5 -0
  48. package/runtime/core/metadata-internals.eli +2 -0
  49. package/runtime/core/metadata.eli +2 -0
  50. package/runtime/core/metadata.mjs +14 -0
  51. package/runtime/core/object.eli +2 -0
  52. package/runtime/core/order.eli +2 -0
  53. package/runtime/core/order.mjs +35 -6
  54. package/runtime/core/persistent-kind.eli +2 -0
  55. package/runtime/core/persistent-kind.mjs +6 -0
  56. package/runtime/core/protocol-error.eli +2 -0
  57. package/runtime/core/protocol.eli +2 -0
  58. package/runtime/core/queue-internals.eli +2 -0
  59. package/runtime/core/queue.eli +2 -0
  60. package/runtime/core/queue.mjs +3 -0
  61. package/runtime/core/record.eli +2 -0
  62. package/runtime/core/regex.eli +2 -0
  63. package/runtime/core/sequence.eli +2 -0
  64. package/runtime/core/sequence.mjs +75 -13
  65. package/runtime/core/set-algebra.eli +2 -0
  66. package/runtime/core/set-internals.eli +2 -0
  67. package/runtime/core/set.eli +2 -0
  68. package/runtime/core/sorted-internals.eli +2 -0
  69. package/runtime/core/sorted.eli +2 -0
  70. package/runtime/core/text.eli +2 -0
  71. package/runtime/core/transducer.eli +2 -0
  72. package/runtime/core/transient-internals.eli +2 -0
  73. package/runtime/core/transient.eli +2 -0
  74. package/runtime/core/transient.mjs +59 -10
  75. package/runtime/core/truth.eli +2 -0
  76. package/runtime/core/type.eli +2 -0
  77. package/runtime/core/value-internals.eli +2 -0
  78. package/runtime/core/value.eli +2 -0
  79. package/runtime/core/vector-internals.eli +2 -0
  80. package/runtime/core/vector-internals.mjs +3 -6
  81. package/runtime/core/vector.eli +2 -0
  82. package/runtime/core/vector.mjs +125 -7
  83. package/runtime/literals.eli +2 -0
  84. package/runtime/number-radix.eli +2 -0
  85. package/runtime/source-mapping.eli +2 -0
  86. package/runtime/testing/list.eli +2 -0
  87. package/runtime/testing/map.eli +2 -0
  88. package/runtime/testing/queue.eli +2 -0
  89. package/runtime/testing/set.eli +2 -0
  90. package/runtime/testing/sorted.eli +2 -0
  91. package/runtime/testing/value.eli +2 -0
  92. package/runtime/testing/vector.eli +2 -0
  93. package/runtime/wire/http-rpc.eli +2 -0
  94. package/runtime/wire/markdown.eli +2 -0
  95. package/runtime/wire/schema.eli +2 -0
  96. package/runtime/worker-value-codec.eli +2 -0
  97. package/runtime/worker-value-stream.eli +2 -0
  98. package/runtime/worker.eli +2 -0
  99. package/stdlib/README.md +2 -2
  100. package/stdlib/core/order.eli +36 -10
  101. package/stdlib/core/seq.eli +104 -75
  102. package/stdlib/core/zipper.eli +274 -101
  103. package/stdlib/managed-literal-protocols.eli +18 -7
  104. package/stdlib/managed-literals.eli +121 -66
  105. package/stdlib/managed-runtime-collection.eli +76 -16
  106. package/stdlib/managed-runtime-metadata.eli +25 -8
  107. package/stdlib/managed-runtime-order.eli +32 -10
  108. package/stdlib/managed-runtime-sequence.eli +69 -28
  109. package/stdlib/managed-runtime-vector.eli +7 -2
  110. package/tools/acceptance/check.eli +13 -3
  111. package/tools/backends/compiler-build.mjs +140 -140
  112. package/tools/backends/dist/release-cli.mjs +2 -0
  113. package/tools/backends/dist/release-cli.mjs.map +1 -1
  114. package/tools/backends/stage3-targets.mjs +121 -114
  115. 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"))
@@ -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) => specifier.startsWith("eliscript/")
18
- ? new URL(specifier.slice("eliscript/".length), base).href
19
- : undefined;
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) {