eliscript 0.0.4 → 0.1.1

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 (192) hide show
  1. package/README.md +9 -8
  2. package/bootstrap/compiler/emitter.eli +161 -63
  3. package/bootstrap/host/check-cli.mjs +0 -1
  4. package/bootstrap/host/check-cli.mjs.map +1 -1
  5. package/bootstrap/host/compiler-session.eli +2 -1
  6. package/bootstrap/host/eliscript-cli.mjs +2 -9
  7. package/bootstrap/host/eliscript-cli.mjs.map +1 -1
  8. package/bootstrap/host/project-cli.mjs +1 -11
  9. package/bootstrap/host/project-cli.mjs.map +1 -1
  10. package/bootstrap/host/project.mjs +2 -8
  11. package/bootstrap/host/project.mjs.map +1 -1
  12. package/browser/README.md +1 -1
  13. package/compiler/README.md +2 -2
  14. package/compiler/eliscript-emitter.el +229 -85
  15. package/compiler/eliscript-ir-emitter.el +64 -34
  16. package/compiler/eliscript-project.el +20 -5
  17. package/dist/backends/async.mjs +1 -90
  18. package/dist/backends/async.mjs.map +1 -1
  19. package/dist/backends/binary.mjs +1 -91
  20. package/dist/backends/binary.mjs.map +1 -1
  21. package/dist/backends/capabilities.mjs +1 -90
  22. package/dist/backends/capabilities.mjs.map +1 -1
  23. package/dist/backends/elf.mjs +1 -90
  24. package/dist/backends/elf.mjs.map +1 -1
  25. package/dist/backends/managed.mjs +1 -94
  26. package/dist/backends/managed.mjs.map +1 -1
  27. package/dist/backends/memory.mjs +1 -90
  28. package/dist/backends/memory.mjs.map +1 -1
  29. package/dist/backends/native.mjs +1 -91
  30. package/dist/backends/native.mjs.map +1 -1
  31. package/dist/backends/numeric.mjs +1 -90
  32. package/dist/backends/numeric.mjs.map +1 -1
  33. package/dist/backends/optimize.mjs +1 -90
  34. package/dist/backends/optimize.mjs.map +1 -1
  35. package/dist/backends/regexp.mjs +1 -91
  36. package/dist/backends/regexp.mjs.map +1 -1
  37. package/dist/backends/sha256.mjs +2 -96
  38. package/dist/backends/sha256.mjs.map +1 -1
  39. package/dist/backends/wasm.mjs +1 -90
  40. package/dist/backends/wasm.mjs.map +1 -1
  41. package/dist/bootstrap/analyzer.mjs +1 -95
  42. package/dist/bootstrap/analyzer.mjs.map +1 -1
  43. package/dist/bootstrap/compiler.mjs +1 -105
  44. package/dist/bootstrap/compiler.mjs.map +1 -1
  45. package/dist/bootstrap/emitter.mjs +848 -807
  46. package/dist/bootstrap/emitter.mjs.map +1 -1
  47. package/dist/bootstrap/expander.mjs +1 -96
  48. package/dist/bootstrap/expander.mjs.map +1 -1
  49. package/dist/bootstrap/formatter.mjs +1 -104
  50. package/dist/bootstrap/formatter.mjs.map +1 -1
  51. package/dist/bootstrap/ir.mjs +18 -172
  52. package/dist/bootstrap/ir.mjs.map +1 -1
  53. package/dist/bootstrap/lower.mjs +1 -92
  54. package/dist/bootstrap/lower.mjs.map +1 -1
  55. package/dist/bootstrap/project.mjs +23 -209
  56. package/dist/bootstrap/project.mjs.map +1 -1
  57. package/dist/bootstrap/reader.mjs +1 -96
  58. package/dist/bootstrap/reader.mjs.map +1 -1
  59. package/dist/bootstrap/source-map.mjs +7 -112
  60. package/dist/bootstrap/source-map.mjs.map +1 -1
  61. package/dist/bootstrap/symbol.mjs +7 -114
  62. package/dist/bootstrap/symbol.mjs.map +1 -1
  63. package/dist/bootstrap/syntax.mjs +10 -176
  64. package/dist/bootstrap/syntax.mjs.map +1 -1
  65. package/dist/bootstrap/transient-analysis.mjs +1 -93
  66. package/dist/bootstrap/transient-analysis.mjs.map +1 -1
  67. package/dist/browser/compiler.js +105 -104
  68. package/dist/browser/loader.js +1 -1
  69. package/dist/browser/loader.mjs +5 -124
  70. package/dist/compiler-artifact.json +1 -1
  71. package/dist/host/compiler-session.mjs +205 -297
  72. package/dist/host/compiler-session.mjs.map +1 -1
  73. package/dist/host/compiler-tools.mjs +1 -91
  74. package/dist/host/compiler-tools.mjs.map +1 -1
  75. package/dist/literal-sources/runtime/core/order.eli +32 -10
  76. package/dist/literal-sources/runtime/core/sequence.eli +69 -28
  77. package/dist/literal-sources/runtime/core/vector.eli +2 -4
  78. package/dist/literal-sources/stdlib/managed-literal-protocols.eli +5 -5
  79. package/dist/literal-sources/stdlib/managed-literals.eli +1 -1
  80. package/dist/package.json +1 -0
  81. package/dist/runtime/math.mjs +62 -252
  82. package/dist/runtime/math.mjs.map +1 -1
  83. package/dist/runtime/prelude.mjs +95 -0
  84. package/dist/runtime/prelude.mjs.macro-origins.json +1 -0
  85. package/dist/runtime/prelude.mjs.map +1 -0
  86. package/dist/runtime/unicode-case-data.mjs +1 -95
  87. package/dist/runtime/unicode-case-data.mjs.map +1 -1
  88. package/dist/runtime/unicode-case.mjs +3 -97
  89. package/dist/runtime/unicode-case.mjs.map +1 -1
  90. package/dist/stage3-release.json +1 -1
  91. package/editor/README.md +9 -4
  92. package/editor/eliscript-abi.el +170 -0
  93. package/editor/eliscript-async.el +375 -0
  94. package/editor/eliscript-bind.el +822 -0
  95. package/editor/eliscript-compat.el +346 -0
  96. package/editor/eliscript-contract.el +334 -0
  97. package/editor/eliscript-data.el +1544 -0
  98. package/editor/eliscript-js.el +318 -0
  99. package/editor/eliscript-mode.el +1 -1
  100. package/editor/eliscript-module.el +340 -0
  101. package/editor/eliscript-repl.el +1 -1
  102. package/package.json +4 -1
  103. package/runtime/README.md +21 -1
  104. package/runtime/core/protocol-impl.mjs +1 -115
  105. package/runtime/core/protocol-impl.mjs.map +1 -1
  106. package/runtime/core/text-impl.mjs +1 -90
  107. package/runtime/core/text-impl.mjs.map +1 -1
  108. package/runtime/core/vector.eli +1 -1
  109. package/runtime/core/vector.mjs +0 -9
  110. package/runtime/emacs-compat.eli +5957 -0
  111. package/runtime/emacs-compat.mjs +13734 -0
  112. package/runtime/emacs-compat.mjs.map +1 -0
  113. package/runtime/math.mjs +62 -252
  114. package/runtime/math.mjs.map +1 -1
  115. package/runtime/prelude.eli +4 -0
  116. package/runtime/prelude.mjs +95 -0
  117. package/runtime/prelude.mjs.map +1 -0
  118. package/runtime/unicode-case-data.mjs +1 -95
  119. package/runtime/unicode-case-data.mjs.map +1 -1
  120. package/runtime/unicode-case.mjs +3 -97
  121. package/runtime/unicode-case.mjs.map +1 -1
  122. package/stdlib/managed-literals.eli +1 -1
  123. package/stdlib/managed-runtime-vector.eli +2 -4
  124. package/tools/backends/compiler-build.mjs +3 -93
  125. package/tools/backends/compiler-cli.mjs +2 -15
  126. package/tools/backends/compiler-corpus-bit.mjs +2 -95
  127. package/tools/backends/compiler-corpus-cli-adapters.mjs +1 -97
  128. package/tools/backends/compiler-corpus-debugging.mjs +2 -95
  129. package/tools/backends/compiler-corpus-emitter.mjs +1 -97
  130. package/tools/backends/compiler-corpus-execution.mjs +2 -108
  131. package/tools/backends/compiler-corpus-fuzz.mjs +2 -95
  132. package/tools/backends/compiler-corpus-host-context.mjs +2 -99
  133. package/tools/backends/compiler-corpus-identity-host.mjs +18 -123
  134. package/tools/backends/compiler-corpus-identity-value-adapters.mjs +0 -9
  135. package/tools/backends/compiler-corpus-literal-provider.mjs +1 -91
  136. package/tools/backends/compiler-corpus-managed-adapters.mjs +1 -99
  137. package/tools/backends/compiler-corpus-managed-fixtures.mjs +2 -113
  138. package/tools/backends/compiler-corpus-matchers.mjs +3 -106
  139. package/tools/backends/compiler-corpus-original-program.mjs +1 -91
  140. package/tools/backends/compiler-corpus-process.mjs +1 -92
  141. package/tools/backends/compiler-corpus-program-driver.mjs +1 -3
  142. package/tools/backends/compiler-corpus-project-adapters.mjs +1 -95
  143. package/tools/backends/compiler-corpus-project-entry-host.mjs +2 -92
  144. package/tools/backends/compiler-corpus-project-transport.mjs +1 -90
  145. package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1 -91
  146. package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1 -92
  147. package/tools/backends/compiler-corpus-raw-math-fixture.mjs +1 -91
  148. package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +1 -91
  149. package/tools/backends/compiler-corpus-reference.mjs +1 -90
  150. package/tools/backends/compiler-corpus-runtime-adapters.mjs +2 -110
  151. package/tools/backends/compiler-corpus-tools-cli.mjs +1 -95
  152. package/tools/backends/compiler-corpus-tools-reference.mjs +22 -163
  153. package/tools/backends/compiler-corpus.mjs +3 -125
  154. package/tools/backends/compiler-matrix.mjs +1 -92
  155. package/tools/backends/compiler-package-browser.mjs +1 -90
  156. package/tools/backends/compiler-package.mjs +3 -95
  157. package/tools/backends/compiler-unicode-profile-host.mjs +1 -91
  158. package/tools/backends/dist/bootstrap-js-stages.mjs +1 -91
  159. package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -1
  160. package/tools/backends/dist/managed-ir-inventory.mjs +1 -91
  161. package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -1
  162. package/tools/backends/dist/record-grid.mjs +1 -91
  163. package/tools/backends/dist/record-grid.mjs.map +1 -1
  164. package/tools/backends/dist/release-cli.mjs +4 -94
  165. package/tools/backends/dist/release-cli.mjs.map +1 -1
  166. package/tools/backends/dist/run-artifact.mjs +1 -91
  167. package/tools/backends/dist/run-artifact.mjs.map +1 -1
  168. package/tools/backends/eliscript/compiler-corpus-bit.eli +1 -0
  169. package/tools/backends/managed-foreign-binding.mjs +1 -95
  170. package/tools/backends/managed-host-lifecycle.mjs +1 -91
  171. package/tools/backends/managed-host-object-provider.mjs +18 -59
  172. package/tools/backends/managed-host-object-realm.mjs +1 -91
  173. package/tools/backends/managed-host-proxy.mjs +9 -18
  174. package/tools/backends/managed-host-runtime.mjs +3 -105
  175. package/tools/backends/managed-host.mjs +1 -104
  176. package/tools/backends/managed-module-graph.mjs +1 -97
  177. package/tools/backends/managed-runtime.mjs +1 -96
  178. package/tools/backends/managed-source-view.mjs +13 -108
  179. package/tools/backends/native-managed-runtime.mjs +1 -91
  180. package/tools/backends/native-memory.mjs +1 -91
  181. package/tools/backends/stage3-targets.mjs +1 -91
  182. package/tools/bootstrap-runtime.el +3 -2
  183. package/tools/project/project.eli +1 -1
  184. package/tools/testing/stdlib-bit-corpus-host.mjs +1 -90
  185. package/tools/testing/stdlib-bit.mjs +1 -90
  186. package/dist/bootstrap/package.json +0 -1
  187. package/dist/bootstrap/runtime/math.mjs +0 -1117
  188. package/dist/bootstrap/runtime/math.mjs.map +0 -1
  189. package/dist/bootstrap/runtime/unicode-case-data.mjs +0 -10125
  190. package/dist/bootstrap/runtime/unicode-case-data.mjs.map +0 -1
  191. package/dist/bootstrap/runtime/unicode-case.mjs +0 -281
  192. package/dist/bootstrap/runtime/unicode-case.mjs.map +0 -1
package/README.md CHANGED
@@ -15,6 +15,7 @@ modules, and bootstraps a compiler written in Eliscript itself.
15
15
  [Core documentation](docs/README.md) ·
16
16
  [Getting started](docs/getting-started.md) ·
17
17
  [Language reference](docs/language-reference.md) ·
18
+ [Emacs-compatible syntax (0.1.0)](docs/emacs-compatible-syntax.md) ·
18
19
  [Library API](https://liuchong.org/eliscript/pages/api.html) ·
19
20
  [Playground](https://liuchong.org/eliscript/pages/playground.html) ·
20
21
  [Roadmap](specs/0040-maturity-roadmap.md) ·
@@ -56,7 +57,7 @@ without a build server or repository files. Include `dist/browser/loader.js`
56
57
  and use either `data-eliscript` or `<script type="text/eliscript">` tags:
57
58
 
58
59
  ```html
59
- <script defer src="https://unpkg.com/eliscript@0.0.3/dist/browser/loader.js"></script>
60
+ <script defer src="https://unpkg.com/eliscript@0.1.0/dist/browser/loader.js"></script>
60
61
  <script type="text/eliscript">
61
62
  (module app.live
62
63
  (print "Hello from in-browser Eliscript!"))
@@ -75,12 +76,12 @@ alongside explicit `.mjs`).
75
76
 
76
77
  | Area | State |
77
78
  | --- | --- |
78
- | Compiler | Emacs Lisp seed, reproducible self-hosted compiler, deterministic formatter, versioned canonical IR, Source Maps that name `.eli` files |
79
- | Language | Tail calls, macros, modules, protocols, records, `deftype`/`reify`, `case`/`condp`, multi-arity named, anonymous, async, and portable functions |
80
- | Data | Persistent List, Vector, Map, Set, and Queue with value equality; transients; lazy sequences; transducers |
81
- | Runtime | Host-free runtime semantics, frozen regular expressions, a long-lived Emacs-to-JavaScript worker |
82
- | Browser | An in-memory multi-file compile host, a module worker, and a compiler bundled for the browser — the [playground](https://liuchong.org/eliscript/pages/playground.html) compiles and runs Eliscript in the page |
83
- | Editor | [`eliscript-mode`](editor/README.md) and an evaluation REPL |
79
+ | Compiler | Emacs Lisp seed, reproducible stage0–stage3 self-hosted compiler, deterministic formatter, versioned canonical IR, Source Maps that name `.eli` files, plus zero-glue WASM and ARM64 Native `:abi` backends |
80
+ | Language | 100% Emacs Lisp-compatible core (`eliscript-compat`) + `1+5+2` extension packs (`defun-case`, `let-bind`/`defun-bind`/`pcase-value`, `let-const`, `defmodule`, `defmacro-checked`, `with-async-scope`, `async-channel`), tail-safe `loop`/`recur` (50,000+ depth), protocols, records, `deftype`/`reify`, `case`/`condp`, and portable functions |
81
+ | Data | 7 persistent collection types (List, Vector, HAMT Map/Set, Queue, AVL Sorted Map/Set), `cl-defstruct-persistent` with Schema validation and JSON Schema round-trip, `state-cell`, transients, lazy sequences, and transducers |
82
+ | Runtime | Host-free runtime semantics, `eliscript/runtime/emacs-compat` dual-host compatibility runtime, lossless JS sentinels (`js-false`/`js-null`/`js-undefined`), cross-engine handle revocation, and a long-lived Emacs-to-JavaScript worker |
83
+ | Browser | An in-memory multi-file compile host, a module worker, standalone `dist/browser/loader.js`, and a compiler bundled for the browser — the [playground](https://liuchong.org/eliscript/pages/playground.html) compiles and runs Eliscript in the page |
84
+ | Editor | [`eliscript-mode`](editor/README.md), an evaluation REPL, and the `editor/eliscript-{compat,contract,data,bind,module,async,js,abi}.el` Emacs Lisp libraries |
84
85
  | Applications | The [proving-ground site](https://liuchong.org/eliscript/examples/dogfood/_site/) and the packaged Action built from it, plus React, Org, and Vite probes as replaceable application evidence |
85
86
 
86
87
  Experimental direct backends and the zero-import managed WASM heap are described
@@ -88,7 +89,7 @@ in the [backend runtime reference](tools/backends/README.md). The current delive
88
89
  uses a JavaScript-hosted stage0–stage3 compiler chain that emits JavaScript,
89
90
  WASM and native programs, with 12,000-depth persistent zipper traversal and
90
91
  edited ascent verified across all three output targets:
91
- [active plan](docs/bootstrap-0.0.4-plan.md).
92
+ [active plan](docs/bootstrap-0.1.0-plan.md).
92
93
 
93
94
  ## Project Status
94
95
 
@@ -28,8 +28,6 @@
28
28
  "import { get as __eliscript_get } from \"eliscript/runtime/core/collection.mjs\";\nconst __eliscript_binding_missing = Symbol(\"eliscript.binding.missing\");\nconst __eliscript_binding_get = (value, key, notFound) => { if (value == null) return notFound; const prototype = typeof value === \"object\" ? Object.getPrototypeOf(value) : undefined; if (prototype === Object.prototype || prototype === null) { const type = key && Object.getOwnPropertyDescriptor(key, Symbol.for(\"eliscript.value.type\")); if (type?.value === \"keyword\" || type?.value === \"symbol\") key = key.qualifiedName; } return __eliscript_get(value, key, notFound); };\n")
29
29
  (defconst number-conversion-intrinsics
30
30
  "const __eliscript_number_intrinsic = globalThis.Number;\nconst __eliscript_bigint_intrinsic = globalThis.BigInt;\nconst __eliscript_numeric_apply = globalThis.Reflect.apply;\nconst __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;\nconst __eliscript_numeric_error = globalThis.TypeError;\nconst __eliscript_numeric_trim = globalThis.String.prototype.trim;\nconst __eliscript_numeric_slice = globalThis.String.prototype.slice;\nconst __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;\n")
31
- (defconst number-conversion-capsule
32
- "import { __eliscript_number_intrinsic, __eliscript_bigint_intrinsic, __eliscript_numeric_apply, __eliscript_numeric_symbol, __eliscript_numeric_error, __eliscript_numeric_trim, __eliscript_numeric_slice, __eliscript_numeric_exec } from \"data:text/javascript;base64,ZXhwb3J0IGNvbnN0IF9fZWxpc2NyaXB0X251bWJlcl9pbnRyaW5zaWMgPSBnbG9iYWxUaGlzLk51bWJlcjsKZXhwb3J0IGNvbnN0IF9fZWxpc2NyaXB0X2JpZ2ludF9pbnRyaW5zaWMgPSBnbG9iYWxUaGlzLkJpZ0ludDsKZXhwb3J0IGNvbnN0IF9fZWxpc2NyaXB0X251bWVyaWNfYXBwbHkgPSBnbG9iYWxUaGlzLlJlZmxlY3QuYXBwbHk7CmV4cG9ydCBjb25zdCBfX2VsaXNjcmlwdF9udW1lcmljX3N5bWJvbCA9IGdsb2JhbFRoaXMuU3ltYm9sLnRvUHJpbWl0aXZlOwpleHBvcnQgY29uc3QgX19lbGlzY3JpcHRfbnVtZXJpY19lcnJvciA9IGdsb2JhbFRoaXMuVHlwZUVycm9yOwpleHBvcnQgY29uc3QgX19lbGlzY3JpcHRfbnVtZXJpY190cmltID0gZ2xvYmFsVGhpcy5TdHJpbmcucHJvdG90eXBlLnRyaW07CmV4cG9ydCBjb25zdCBfX2VsaXNjcmlwdF9udW1lcmljX3NsaWNlID0gZ2xvYmFsVGhpcy5TdHJpbmcucHJvdG90eXBlLnNsaWNlOwpleHBvcnQgY29uc3QgX19lbGlzY3JpcHRfbnVtZXJpY19leGVjID0gZ2xvYmFsVGhpcy5SZWdFeHAucHJvdG90eXBlLmV4ZWM7Cg==\";\n")
33
31
  (defconst number-conversion-body
34
32
  "const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;\nconst __eliscript_numeric_object = (value) => value !== null && (typeof value === \"object\" || typeof value === \"function\" || (typeof value === \"undefined\" && value !== void 0));\nconst __eliscript_numeric_primitive = (value) => {\n if (!__eliscript_numeric_object(value)) return value;\n const exotic = value[__eliscript_numeric_symbol];\n if (exotic !== void 0 && exotic !== null) {\n const result = __eliscript_numeric_apply(exotic, value, [\"number\"]);\n if (!__eliscript_numeric_object(result)) return result;\n throw new __eliscript_numeric_error(\"Cannot convert object to primitive value\");\n }\n for (let index = 0; index < 2; index++) {\n const method = value[index === 0 ? \"valueOf\" : \"toString\"];\n if (typeof method === \"function\" || (typeof method === \"undefined\" && method !== void 0)) {\n const result = __eliscript_numeric_apply(method, value, []);\n if (!__eliscript_numeric_object(result)) return result;\n }\n }\n throw new __eliscript_numeric_error(\"Cannot convert object to primitive value\");\n};\nconst __eliscript_to_number = (value) => {\n const primitive = __eliscript_numeric_primitive(value);\n if (typeof primitive === \"string\") {\n const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);\n if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {\n let first = 2;\n while (first < text.length && text[first] === \"0\") first++;\n if (first === text.length) return 0;\n const prefix = text[1];\n const limit = prefix === \"x\" || prefix === \"X\" ? 256 : prefix === \"b\" || prefix === \"B\" ? 1024 : 342;\n if (text.length - first > limit) return 1 / 0;\n const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);\n return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));\n }\n }\n return __eliscript_number_intrinsic(primitive);\n};\n")
35
33
  (defconst number-conversion-helper
@@ -38,10 +36,36 @@
38
36
  "const __eliscript_numeric = (value) => {\n if (typeof value === \"number\" || typeof value === \"bigint\") return value;\n const primitive = __eliscript_numeric_primitive(value);\n if (typeof primitive === \"number\" || typeof primitive === \"bigint\") return primitive;\n return typeof primitive === \"string\" ? __eliscript_to_number(primitive) : +primitive;\n};\nconst __eliscript_implicit_number = (value) => {\n if (typeof value === \"number\") return value;\n const primitive = __eliscript_numeric_primitive(value);\n if (typeof primitive === \"bigint\") throw new __eliscript_numeric_error(\"Cannot convert a BigInt value to a number\");\n return typeof primitive === \"string\" ? __eliscript_to_number(primitive) : +primitive;\n};\nconst __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;\nconst __eliscript_numeric_sub = (a, b) => { if (typeof a === \"number\" && typeof b === \"number\") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };\nconst __eliscript_numeric_mul = (a, b) => { if (typeof a === \"number\" && typeof b === \"number\") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };\nconst __eliscript_numeric_div = (a, b) => { if (typeof a === \"number\" && typeof b === \"number\") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };\nconst __eliscript_numeric_rem = (a, b) => { if (typeof a === \"number\" && typeof b === \"number\") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };\nconst __eliscript_numeric_and = (a, b) => { if (typeof a === \"number\" && typeof b === \"number\") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };\nconst __eliscript_numeric_or = (a, b) => { if (typeof a === \"number\" && typeof b === \"number\") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };\nconst __eliscript_numeric_xor = (a, b) => { if (typeof a === \"number\" && typeof b === \"number\") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };\nconst __eliscript_numeric_shl = (a, b) => { if (typeof a === \"number\" && typeof b === \"number\") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };\nconst __eliscript_numeric_shr = (a, b) => { if (typeof a === \"number\" && typeof b === \"number\") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };\nconst __eliscript_numeric_ushr = (a, b) => { if (typeof a === \"number\" && typeof b === \"number\") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };\nconst __eliscript_numeric_neg = (a) => typeof a === \"number\" ? -a : -__eliscript_numeric(a);\nconst __eliscript_numeric_int32 = (a) => typeof a === \"number\" ? a | 0 : __eliscript_numeric(a) | 0;\nconst __eliscript_numeric_uint32 = (a) => typeof a === \"number\" ? a >>> 0 : __eliscript_numeric(a) >>> 0;\nconst __eliscript_numeric_not = (a) => typeof a === \"number\" ? ~a : ~__eliscript_numeric(a);\nconst __eliscript_numeric_relation = (operator, left, right) => {\n if (typeof left === \"number\" && typeof right === \"number\") {\n if (operator === \"<\") return left < right;\n if (operator === \"<=\") return left <= right;\n if (operator === \">\") return left > right;\n return left >= right;\n }\n let a = __eliscript_numeric_primitive(left);\n let b = __eliscript_numeric_primitive(right);\n const x = typeof a, y = typeof b;\n if (!((x === \"string\" && y === \"string\") || (x === \"bigint\" && y === \"string\") || (x === \"string\" && y === \"bigint\"))) {\n a = __eliscript_numeric(a);\n b = __eliscript_numeric(b);\n }\n if (operator === \"<\") return a < b;\n if (operator === \"<=\") return a <= b;\n if (operator === \">\") return a > b;\n return a >= b;\n};\n")
39
37
  (defconst imul-intrinsic
40
38
  "const __eliscript_numeric_imul_intrinsic = globalThis.Math.imul;\n")
41
- (defconst imul-capsule
42
- "import { __eliscript_numeric_imul_intrinsic } from \"data:text/javascript;base64,ZXhwb3J0IGNvbnN0IF9fZWxpc2NyaXB0X251bWVyaWNfaW11bF9pbnRyaW5zaWMgPSBnbG9iYWxUaGlzLk1hdGguaW11bDsK\";\n")
43
39
  (defconst imul-operator-helper
44
40
  "const __eliscript_numeric_imul = (a, b) => __eliscript_numeric_imul_intrinsic(__eliscript_implicit_number(a), __eliscript_implicit_number(b));\n")
41
+ ;; One compiled runtime module owns every shared helper. Its own module scope
42
+ ;; never binds globalThis, so captured intrinsics need no separate capsule.
43
+ (defconst prelude-array-text-names (js-array "__eliscript_at" "__eliscript_at_direct"))
44
+ (defconst prelude-number-conversion-names (js-array "__eliscript_to_number"))
45
+ (defconst prelude-numeric-coercion-names
46
+ (js-array "__eliscript_numeric_decrement" "__eliscript_numeric_relation"
47
+ "__eliscript_numeric_sub" "__eliscript_numeric_mul" "__eliscript_numeric_div"
48
+ "__eliscript_numeric_rem" "__eliscript_numeric_and" "__eliscript_numeric_or"
49
+ "__eliscript_numeric_xor" "__eliscript_numeric_shl" "__eliscript_numeric_shr"
50
+ "__eliscript_numeric_ushr" "__eliscript_numeric_neg" "__eliscript_numeric_int32"
51
+ "__eliscript_numeric_uint32" "__eliscript_numeric_not"))
52
+ (defconst prelude-imul-names (js-array "__eliscript_numeric_imul"))
53
+ (defconst prelude-module
54
+ (str "// Generated by Eliscript. Do not edit.\n"
55
+ "export" (js-call array-text-import :slice 6)
56
+ number-conversion-helper numeric-operator-helper imul-intrinsic imul-operator-helper
57
+ "export { "
58
+ (js-call (js-call prelude-number-conversion-names :concat
59
+ prelude-numeric-coercion-names prelude-imul-names) :join ", ")
60
+ " };\n"))
61
+ (defun prelude-import (array-text number-conversion numeric-coercion imul)
62
+ (let ((names (js-call (js-array) :concat
63
+ (if array-text prelude-array-text-names (js-array))
64
+ (if number-conversion prelude-number-conversion-names (js-array))
65
+ (if numeric-coercion prelude-numeric-coercion-names (js-array))
66
+ (if imul prelude-imul-names (js-array)))))
67
+ (if (= (js-length names) 0) ""
68
+ (str "import { " (js-call names :join ", ") " } from \"eliscript/runtime/prelude.mjs\";\n"))))
45
69
  (defvar numeric-emission-profile false)
46
70
  (defconst host-identity-token-helper
47
71
  "const __eliscript_host_identity_token = (() => { const objects = new WeakMap(); const symbols = new Map(); let next = 1; return (value) => { const type = typeof value; if ((type !== \"object\" || value === null) && type !== \"function\" && type !== \"symbol\") throw new TypeError(\"host-identity-token expects an object, function, or symbol\"); const identities = type === \"symbol\" ? symbols : objects; const cached = identities.get(value); if (cached !== undefined) return cached; if (next > Number.MAX_SAFE_INTEGER) throw new RangeError(\"host identity token space exhausted\"); const token = next; next += 1; identities.set(value, token); return token; }; })();\n")
@@ -107,29 +131,96 @@
107
131
  (defun tdz-defaults (node scope state)
108
132
  (when (ir-property node "pattern")
109
133
  (tdz-pattern-defaults (js-nth 0 (children node)) scope state)))
110
- (defun tdz-predeclare (nodes scope state)
134
+ (defun tdz-statements (nodes statements)
111
135
  (js-call nodes :forEach
112
136
  (lambda (node)
113
- (let ((kind (ir-kind node)))
137
+ (if (= (ir-kind node) "module-declaration")
138
+ (tdz-statements (children node) statements)
139
+ (js-call statements :push node))))
140
+ statements)
141
+ (defun tdz-predeclare (statements scope state)
142
+ (js-call statements :forEach
143
+ (lambda (node)
144
+ (let ((kind (ir-kind node)) (name (ir-value node)))
114
145
  (cond
115
- ((= kind "module-declaration") (tdz-predeclare (children node) scope state))
116
146
  ((= kind "variable-declaration")
117
- (let ((record (js-object :name (ir-value node) :index (js-length (get state :variables)) :mutable (ir-property node "mutable"))))
147
+ (let ((record (js-object :name name :index (js-length (get state :variables))
148
+ :mutable (ir-property node "mutable") :statement (get state :position)
149
+ :read false :write false)))
118
150
  (js-call (get state :variables) :push record)
119
151
  (js-call (get state :declarations) :set node record)
120
- (js-call (get scope :names) :set (binding-name (ir-value node)) record)))
121
- ((= kind "function-declaration") (js-call (get scope :names) :set (binding-name (ir-value node)) nil))
152
+ (js-call (get scope :names) :set (binding-name name) record)))
153
+ ((= kind "function-declaration")
154
+ (let ((key (binding-name name)))
155
+ (js-call (get state :functions) :add key)
156
+ (js-call (get scope :names) :set key (js-object :function key))
157
+ (when (ir-property node "portable") (js-call (get state :exported) :push key))))
158
+ ((= kind "export-declaration")
159
+ (js-call (children node) :forEach
160
+ (lambda (reference) (js-call (get state :exported) :push (binding-name (ir-value reference))))))
122
161
  ((= kind "import-declaration")
162
+ (put state :imports t)
123
163
  (js-call (children node) :forEach
124
- (lambda (child) (js-call (get scope :names) :set (binding-name (ir-value child)) nil)))))))))
164
+ (lambda (child) (js-call (get scope :names) :set (binding-name (ir-value child)) nil))))))
165
+ (put state :position (1+ (get state :position))))))
166
+ (defun tdz-variable-p (record)
167
+ (and record (= (value-type (get record :index)) "number")))
168
+ (defun tdz-guarded-p (record)
169
+ (and record (or (get record :read) (get record :write))))
170
+ (defun tdz-reference (state record)
171
+ (let ((owner (get state :owner)) (references (get state :references)))
172
+ (unless (js-call references :has owner) (js-call references :set owner (js-array)))
173
+ (js-call (js-call references :get owner) :push (get record :function))))
174
+ (defun tdz-site (state kind record node)
175
+ (js-call (get state :sites) :push
176
+ (js-object :kind kind :record record :owner (get state :owner) :node node)))
177
+ ;; A top-level statement runs at its own position. A function can first run
178
+ ;; when a statement or earlier function references it; with imports an
179
+ ;; exported function can run through a cycle before this module, and raw
180
+ ;; JavaScript can call any function. Only accesses that can run before their
181
+ ;; declaration completes are guarded.
182
+ (defun tdz-finalize (state)
183
+ (let ((functions (get state :functions)) (references (get state :references))
184
+ (raw (get state :raw)) (early (new globalThis.Map)) (pending (js-array))
185
+ (never (get state :position)) (all (get state :position)))
186
+ (let ((lower
187
+ (lambda (key index)
188
+ (when (and (js-call functions :has key)
189
+ (< index (if (js-call early :has key) (js-call early :get key) never)))
190
+ (js-call early :set key index)
191
+ (js-call pending :push key)))))
192
+ (when (get state :imports)
193
+ (js-call (get state :exported) :forEach (lambda (key) (funcall lower key -1))))
194
+ (js-call references :forEach
195
+ (lambda (keys owner)
196
+ (when (= (value-type owner) "number")
197
+ (js-call keys :forEach (lambda (key) (funcall lower key owner))))))
198
+ (js-call raw :forEach
199
+ (lambda (owner) (when (and (= (value-type owner) "number") (< owner all)) (setq all owner))))
200
+ (while (> (js-length pending) 0)
201
+ (let* ((key (js-call pending :pop)) (index (js-call early :get key)))
202
+ (when (and (js-call raw :has key) (< index all)) (setq all index))
203
+ (when (js-call references :has key)
204
+ (js-call (js-call references :get key) :forEach (lambda (callee) (funcall lower callee index)))))))
205
+ (js-call (get state :sites) :forEach
206
+ (lambda (site)
207
+ (let* ((record (get site :record)) (owner (get site :owner)) (read (= (get site :kind) "read"))
208
+ (start (if (js-call early :has owner) (js-call early :get owner) never))
209
+ (time (if (= (value-type owner) "number") owner (if (< all start) all start))))
210
+ (when (or (and (not read) (not (get record :mutable))) (<= time (get record :statement)))
211
+ (if read
212
+ (progn (put record :read t) (js-call (get state :reads) :set (get site :node) record))
213
+ (progn (put record :write t) (js-call (get state :writes) :set (get site :node) record)))))))))
125
214
  (defun tdz-walk (node scope state)
126
215
  (let ((kind (ir-kind node)) (nodes (children node)))
127
216
  (cond
128
217
  ((or (= kind "reference") (= kind "assignment-pair"))
129
218
  (let ((record (tdz-find scope (tdz-root-name (ir-value node)))))
130
- (when record
131
- (js-call (get state (if (= kind "reference") "reads" "writes")) :set node record)))
219
+ (cond ((tdz-variable-p record)
220
+ (tdz-site state (if (= kind "reference") "read" "write") record node))
221
+ ((and record (= kind "reference")) (tdz-reference state record))))
132
222
  (js-call nodes :forEach (lambda (child) (tdz-walk child scope state))))
223
+ ((= kind "raw-javascript") (js-call (get state :raw) :add (get state :owner)))
133
224
  ((or (= kind "function-declaration") (= kind "function-expression"))
134
225
  (let ((child (tdz-scope scope)) (count (ir-property node "parameterCount")) (index 0))
135
226
  (while (< index count) (tdz-defaults (js-nth index nodes) scope state) (setq index (1+ index)))
@@ -154,32 +245,46 @@
154
245
  (let ((child (tdz-scope scope)) (binding (js-nth 0 nodes)) (index 1))
155
246
  (tdz-defaults binding scope state) (tdz-bind binding child)
156
247
  (while (< index (js-length nodes)) (tdz-walk (js-nth index nodes) child state) (setq index (1+ index)))))
157
- ((or (= kind "quoted-literal") (= kind "raw-javascript") (= kind "import-declaration")) nil)
248
+ ((or (= kind "quoted-literal") (= kind "import-declaration") (= kind "export-declaration")) nil)
158
249
  (t (js-call nodes :forEach (lambda (child) (tdz-walk child scope state)))))))
159
250
  (defun tdz-prepare (program)
160
- (let ((state (js-object :variables (js-array) :declarations (new globalThis.Map)
161
- :reads (new globalThis.Map) :writes (new globalThis.Map)))
162
- (scope (tdz-scope nil)))
163
- (tdz-predeclare (program-body program) scope state)
251
+ (let* ((state (js-object :variables (js-array) :declarations (new globalThis.Map)
252
+ :reads (new globalThis.Map) :writes (new globalThis.Map)
253
+ :functions (new globalThis.Set) :references (new globalThis.Map) :raw (new globalThis.Set)
254
+ :exported (js-array) :imports false :sites (js-array) :position 0 :owner nil))
255
+ (scope (tdz-scope nil))
256
+ (statements (tdz-statements (program-body program) (js-array))))
257
+ (tdz-predeclare statements scope state)
164
258
  ;; With no tracked module variable, every possible lookup is absent.
165
259
  ;; Function-only modules therefore need no TDZ traversal of their bodies.
166
260
  (when (> (js-length (get state :variables)) 0)
167
- (js-call (program-body program) :forEach (lambda (node) (tdz-walk node scope state)))) state))
261
+ (js-call statements :forEach
262
+ (lambda (node position)
263
+ (put state :owner
264
+ (if (= (ir-kind node) "function-declaration") (binding-name (ir-value node)) position))
265
+ (tdz-walk node scope state)))
266
+ (tdz-finalize state))
267
+ state))
168
268
  (defun tdz-reader-name (record) (str "__eliscript_tdz_read_" (get record :index)))
169
269
  (defun tdz-writer-name (record) (str "__eliscript_tdz_write_" (get record :index)))
170
270
  (defun tdz-prologue ()
171
- (if (or (nil? tdz-state) (= (js-length (get tdz-state :variables)) 0)) ""
172
- (str tdz-import
173
- (js-call (js-call (get tdz-state :variables) :map
174
- (lambda (record)
175
- (let ((ready (tdz-ready-name record)) (name (binding-name (get record :name)))
176
- (argument (str "__eliscript_tdz_value_" (get record :index))))
177
- (str "var " ready ";\n"
178
- "function " (tdz-reader-name record) "() { if (" ready
179
- " !== true) __eliscript_tdz_error(" (json-string name) "); return " name "; }\n"
180
- "function " (tdz-writer-name record) "(" argument ") { if (" ready
181
- " !== true) __eliscript_tdz_error(" (json-string name) "); "
182
- (if (get record :mutable) (str "return (" name " = " argument ");") "return __eliscript_const_error();") " }\n")))) :join ""))))
271
+ (let ((records (if (nil? tdz-state) (js-array) (js-call (get tdz-state :variables) :filter tdz-guarded-p))))
272
+ (if (= (js-length records) 0) ""
273
+ (str tdz-import
274
+ (js-call (js-call records :map
275
+ (lambda (record)
276
+ (let ((ready (tdz-ready-name record)) (name (binding-name (get record :name)))
277
+ (argument (str "__eliscript_tdz_value_" (get record :index))))
278
+ (str "var " ready ";\n"
279
+ (if (get record :read)
280
+ (str "function " (tdz-reader-name record) "() { if (" ready
281
+ " !== true) __eliscript_tdz_error(" (json-string name) "); return " name "; }\n")
282
+ "")
283
+ (if (get record :write)
284
+ (str "function " (tdz-writer-name record) "(" argument ") { if (" ready
285
+ " !== true) __eliscript_tdz_error(" (json-string name) "); "
286
+ (if (get record :mutable) (str "return (" name " = " argument ");") "return __eliscript_const_error();") " }\n")
287
+ ""))))) :join "")))))
183
288
  (defun tdz-read (node)
184
289
  (let ((record (and tdz-state (js-call (get tdz-state :reads) :get node))))
185
290
  (if (not record) (text-fragment (reference-name (ir-value node)))
@@ -1844,7 +1949,7 @@
1844
1949
  "null")
1845
1950
  ";"
1846
1951
  (let ((record (and tdz-state (js-call (get tdz-state :declarations) :get node))))
1847
- (if record (str "\n" (tdz-ready-name record) " = true;") "")))))
1952
+ (if (tdz-guarded-p record) (str "\n" (tdz-ready-name record) " = true;") "")))))
1848
1953
  ((= kind "function-declaration")
1849
1954
  (let* ((parts (split-counted-children node "parameterCount"))
1850
1955
  (parameters (js-nth 0 parts))
@@ -2216,43 +2321,36 @@
2216
2321
  ", ")
2217
2322
  "]));"))))))
2218
2323
 
2219
- ;; An embedded module gives captured intrinsics their own lexical scope when
2220
- ;; user source binds globalThis. It requires no host package or dynamic eval.
2221
- (defun node-names-global-root-p (node)
2222
- (or (and (= (ir-value node) "globalThis")
2223
- (not (= (ir-kind node) "literal"))
2224
- (not (= (ir-kind node) "raw-javascript")))
2225
- (js-call (children node) :some node-names-global-root-p)))
2226
-
2227
- (defun number-conversion-prologue (program)
2228
- (if (js-call (program-body program) :some node-names-global-root-p)
2229
- (str number-conversion-capsule number-conversion-body)
2230
- number-conversion-helper))
2231
-
2232
- (defun imul-prologue (program)
2233
- (str (if (js-call (program-body program) :some node-names-global-root-p)
2234
- imul-capsule imul-intrinsic) imul-operator-helper))
2235
-
2236
2324
  (defun emit-module-artifact-in-profile (program)
2237
- (let ((previous tdz-state))
2238
- (setq tdz-state (tdz-prepare program))
2239
- (try (emit-module-artifact-in-profile-ready program)
2240
- (finally (setq tdz-state previous)))))
2241
-
2242
- (defun unicode-bootstrap-capsule-p (program)
2325
+ (if (prelude-capsule-p program)
2326
+ (text-fragment prelude-module)
2327
+ (let ((previous tdz-state))
2328
+ (setq tdz-state (tdz-prepare program))
2329
+ (try (emit-module-artifact-in-profile-ready program)
2330
+ (finally (setq tdz-state previous))))))
2331
+
2332
+ (defun runtime-capsule-p (program entries)
2243
2333
  (let* ((filename (program-filename program)) (body (program-body program))
2244
2334
  (module (if (= (js-length body) 1) (aref body 0) nil)))
2245
2335
  (and module (= (ir-kind module) "module-declaration")
2246
2336
  (= (value-type filename) "string")
2247
- (js-call (js-array
2248
- (js-array "runtime/unicode-case.eli" "eliscript.runtime.unicode-case")
2249
- (js-array "runtime/unicode-case-data.eli" "eliscript.runtime.unicode-case-data"))
2337
+ (js-call entries
2250
2338
  :some (lambda (entry)
2251
2339
  (and (= (ir-value module) (aref entry 1))
2252
2340
  (or (= filename (aref entry 0))
2253
2341
  (and (js-call filename :startsWith "/")
2254
2342
  (js-call filename :endsWith (+ "/" (aref entry 0)))))))))))
2255
2343
 
2344
+ (defun unicode-bootstrap-capsule-p (program)
2345
+ (runtime-capsule-p program
2346
+ (js-array
2347
+ (js-array "runtime/unicode-case.eli" "eliscript.runtime.unicode-case")
2348
+ (js-array "runtime/unicode-case-data.eli" "eliscript.runtime.unicode-case-data"))))
2349
+
2350
+ (defun prelude-capsule-p (program)
2351
+ (and (runtime-capsule-p program (js-array (js-array "runtime/prelude.eli" "eliscript.runtime.prelude")))
2352
+ (= (js-length (children (aref (program-body program) 0))) 0)))
2353
+
2256
2354
  (defun emit-module-artifact-in-profile-ready (program)
2257
2355
  (setq temporary-counter 0)
2258
2356
  (setq binding-temporaries (new globalThis.Map))
@@ -2267,7 +2365,11 @@
2267
2365
  (tdz-prologue)
2268
2366
  (if (unicode-bootstrap-capsule-p program) "" "import \"eliscript/runtime/unicode-case.mjs\";\n")
2269
2367
  (if (get requirements :math) "import \"eliscript/runtime/math.mjs\";\n" "")
2270
- (if (get requirements :arrayText) array-text-import "")
2368
+ (let ((numeric-coercion (and (not numeric-emission-profile) (get requirements :numericCoercion))))
2369
+ (prelude-import (get requirements :arrayText)
2370
+ (or (get requirements :numberConversion) numeric-coercion)
2371
+ numeric-coercion
2372
+ (and (not numeric-emission-profile) (get requirements :imul))))
2271
2373
  (if (get requirements :literal)
2272
2374
  literal-runtime-import
2273
2375
  "")
@@ -2284,10 +2386,6 @@
2284
2386
  value-runtime-import
2285
2387
  "")
2286
2388
  "const __eliscript_truthy = (value) => value !== false && value != null;\n"
2287
- (if (or (get requirements :numberConversion)
2288
- (and (not numeric-emission-profile) (get requirements :numericCoercion))) (number-conversion-prologue program) "")
2289
- (if (and (not numeric-emission-profile) (get requirements :numericCoercion)) numeric-operator-helper "")
2290
- (if (and (not numeric-emission-profile) (get requirements :imul)) (imul-prologue program) "")
2291
2389
  (if (get requirements :hostIdentityToken)
2292
2390
  host-identity-token-helper
2293
2391
  "")
@@ -2,7 +2,6 @@
2
2
  import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
3
3
  var __eliscript_tdz_ready_0;
4
4
  function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("parseArguments"); return parseArguments; }
5
- function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("parseArguments"); return __eliscript_const_error(); }
6
5
  import "eliscript/runtime/unicode-case.mjs";
7
6
  const __eliscript_truthy = (value) => value !== false && value != null;
8
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"check-cli.mjs","sources":["../../tools/project/check-cli.eli"],"sourcesContent":["(module tools.project.check-cli\n (import \"node:fs\" readFileSync)\n (import \"node:path\" resolve)\n (import \"node:url\" fileURLToPath)\n (import \"./check-cli-legacy.mjs\" :as legacy)\n (import \"./bun.mjs\" diagnosticFromError renderDiagnostic requestedDiagnosticFormat)\n (defconst parseArguments (get legacy :parseArguments))\n (defasync execute (arguments &rest supplied)\n (let* ((arguments (Array/from arguments))\n (options (if (or (= (js-length supplied) 0) (undefined? (aref supplied 0))) (js-object) (aref supplied 0)))\n (parsed (parseArguments arguments)))\n (when (and (not (undefined? (get parsed :stdinFile))) (nullish? (get options :stdinSource)))\n (setq options (Object/assign (js-object) options (js-object :stdinSource (readFileSync 0 \"utf8\")))))\n (await (js-call legacy :execute arguments options))))\n (defasync main (&rest supplied)\n (let* ((arguments (if (or (= (js-length supplied) 0) (undefined? (aref supplied 0)))\n (js-call (get globalThis.process :argv) :slice 2) (aref supplied 0)))\n (execution (await (execute arguments))))\n (if (get execution :help) (await (js-call legacy :main arguments))\n (js-call (get globalThis.process :stdout) :write\n (str (if (get execution :jsonReport) (JSON/stringify (get (get execution :result) :report))\n (str \"Checked \" (get (get (get (get execution :result) :report) :counts) :modules) \" modules.\")) \"\\n\")))))\n (let ((entry (aref (get globalThis.process :argv) 1)))\n (when (and (not (undefined? entry)) (= (resolve entry) (fileURLToPath (js* \"import.meta.url\"))))\n (let ((format (requestedDiagnosticFormat (js-call (get globalThis.process :argv) :slice 2))))\n (js-call (main) :catch (lambda (error)\n (let ((diagnostic (diagnosticFromError error)))\n (if (= format \"json\") (console/error (JSON/stringify diagnostic))\n (console/error (str \"eliscript-check: \" (renderDiagnostic diagnostic))))\n (put globalThis.process :exitCode 1)))))))\n (export parseArguments execute main))\n"],"names":[],"mappings":";;;;;;;;AACE,QAAkB;AAClB,QAAoB;AACpB,QAAmB;AACnB,YAAqC;AACrC,QAAoB,qBAAoB,kBAAiB;AACzD,uBAAyB,CAAK,QAAO;;AACrC,uBAAmB,eAAgB;EACjC,OAAA,eAAO;0BACA;4BACA;;UACL,IAAM,CAAK,EAAK,CAAY,CAAK,QAAO,gCAAc,CAAU,CAAK,SAAQ;YAC3E,CAAM,CAAA,UAAS,cAAc,MAAY,SAAQ,EAAW,eAAc,aAAa,GAAE;;UAC3F,OAAA,OAAO,CAAS,QAAO,WAAS,YAAU;;SAH5B,2BAAe;OADf,CAAI,CAAI,CAAG,EAAW,4BAAU,MAAG,CAAY,CAAM,UAAS,qBAAK,OAAY,CAAM,UAAS;KAD3F,WAAW;;AAMhC,uBAAsB;EACpB,OAAA,eAAO;0BAEA;aACL,oBAAI,CAAK,WAAU,WAAO,OAAO,CAAS,QAAO,QAAM,eACrD,CAAS,CAAK,oBAAmB,WAAS,SACxC,QAAK,oBAAI,CAAK,WAAU,iBAAc,eAAe,CAAK,CAAK,WAAU,WAAS,aAChF,QAAK,qBAAW,CAAK,CAAK,CAAK,CAAK,WAAU,WAAS,WAAS,WAAS,qBAAU,yBAAc;OAJvF,OAAQ,QAAQ;KAFhB,CAAI,CAAI,CAAG,EAAW,4BAAU,MAAG,CAAY,CAAM,UAAS,qBAC7D,CAAS,CAAK,oBAAmB,SAAO,SAAO,KAAG,CAAM,UAAS;;AAMtF,EAAM;EACJ,IAAM,CAAK,EAAK,CAAY,yBAAQ,CAAI,QAAQ,WAAQ,cAAc;IACpE;kCAAe,0BAA0B,CAAS,CAAK,oBAAmB,SAAO,SAAO;;YAAlF;QACJ,OAAA,CAAU,QAAM,SAAO,EAAS;UAC9B;wCAAmB,oBAAoB;;kBAAjC;cACJ,IAAI,CAAG,WAAO;gBAAS,cAAe,eAAe;;gBAClD,cAAc,QAAK,8BAAqB,iBAAiB;;cAC5D,OAAA,EAAK,oBAAmB,cAAU;;;;;;;;;GAP/B,CAAM,CAAK,oBAAmB,SAAO;AAQlD,QAAQ,gBAAe,SAAQ"}
1
+ {"version":3,"file":"check-cli.mjs","sources":["../../tools/project/check-cli.eli"],"sourcesContent":["(module tools.project.check-cli\n (import \"node:fs\" readFileSync)\n (import \"node:path\" resolve)\n (import \"node:url\" fileURLToPath)\n (import \"./check-cli-legacy.mjs\" :as legacy)\n (import \"./bun.mjs\" diagnosticFromError renderDiagnostic requestedDiagnosticFormat)\n (defconst parseArguments (get legacy :parseArguments))\n (defasync execute (arguments &rest supplied)\n (let* ((arguments (Array/from arguments))\n (options (if (or (= (js-length supplied) 0) (undefined? (aref supplied 0))) (js-object) (aref supplied 0)))\n (parsed (parseArguments arguments)))\n (when (and (not (undefined? (get parsed :stdinFile))) (nullish? (get options :stdinSource)))\n (setq options (Object/assign (js-object) options (js-object :stdinSource (readFileSync 0 \"utf8\")))))\n (await (js-call legacy :execute arguments options))))\n (defasync main (&rest supplied)\n (let* ((arguments (if (or (= (js-length supplied) 0) (undefined? (aref supplied 0)))\n (js-call (get globalThis.process :argv) :slice 2) (aref supplied 0)))\n (execution (await (execute arguments))))\n (if (get execution :help) (await (js-call legacy :main arguments))\n (js-call (get globalThis.process :stdout) :write\n (str (if (get execution :jsonReport) (JSON/stringify (get (get execution :result) :report))\n (str \"Checked \" (get (get (get (get execution :result) :report) :counts) :modules) \" modules.\")) \"\\n\")))))\n (let ((entry (aref (get globalThis.process :argv) 1)))\n (when (and (not (undefined? entry)) (= (resolve entry) (fileURLToPath (js* \"import.meta.url\"))))\n (let ((format (requestedDiagnosticFormat (js-call (get globalThis.process :argv) :slice 2))))\n (js-call (main) :catch (lambda (error)\n (let ((diagnostic (diagnosticFromError error)))\n (if (= format \"json\") (console/error (JSON/stringify diagnostic))\n (console/error (str \"eliscript-check: \" (renderDiagnostic diagnostic))))\n (put globalThis.process :exitCode 1)))))))\n (export parseArguments execute main))\n"],"names":[],"mappings":";;;;;;;AACE,QAAkB;AAClB,QAAoB;AACpB,QAAmB;AACnB,YAAqC;AACrC,QAAoB,qBAAoB,kBAAiB;AACzD,uBAAyB,CAAK,QAAO;;AACrC,uBAAmB,eAAgB;EACjC,OAAA,eAAO;0BACA;4BACA;;UACL,IAAM,CAAK,EAAK,CAAY,CAAK,QAAO,gCAAc,CAAU,CAAK,SAAQ;YAC3E,CAAM,CAAA,UAAS,cAAc,MAAY,SAAQ,EAAW,eAAc,aAAa,GAAE;;UAC3F,OAAA,OAAO,CAAS,QAAO,WAAS,YAAU;;SAH5B,2BAAe;OADf,CAAI,CAAI,CAAG,EAAW,4BAAU,MAAG,CAAY,CAAM,UAAS,qBAAK,OAAY,CAAM,UAAS;KAD3F,WAAW;;AAMhC,uBAAsB;EACpB,OAAA,eAAO;0BAEA;aACL,oBAAI,CAAK,WAAU,WAAO,OAAO,CAAS,QAAO,QAAM,eACrD,CAAS,CAAK,oBAAmB,WAAS,SACxC,QAAK,oBAAI,CAAK,WAAU,iBAAc,eAAe,CAAK,CAAK,WAAU,WAAS,aAChF,QAAK,qBAAW,CAAK,CAAK,CAAK,CAAK,WAAU,WAAS,WAAS,WAAS,qBAAU,yBAAc;OAJvF,OAAQ,QAAQ;KAFhB,CAAI,CAAI,CAAG,EAAW,4BAAU,MAAG,CAAY,CAAM,UAAS,qBAC7D,CAAS,CAAK,oBAAmB,SAAO,SAAO,KAAG,CAAM,UAAS;;AAMtF,EAAM;EACJ,IAAM,CAAK,EAAK,CAAY,yBAAQ,CAAI,QAAQ,WAAQ,cAAc;IACpE;kCAAe,0BAA0B,CAAS,CAAK,oBAAmB,SAAO,SAAO;;YAAlF;QACJ,OAAA,CAAU,QAAM,SAAO,EAAS;UAC9B;wCAAmB,oBAAoB;;kBAAjC;cACJ,IAAI,CAAG,WAAO;gBAAS,cAAe,eAAe;;gBAClD,cAAc,QAAK,8BAAqB,iBAAiB;;cAC5D,OAAA,EAAK,oBAAmB,cAAU;;;;;;;;;GAP/B,CAAM,CAAK,oBAAmB,SAAO;AAQlD,QAAQ,gBAAe,SAAQ"}
@@ -951,7 +951,8 @@
951
951
  (unless (= (get (get node :properties (js-object)) :portable false) t)
952
952
  (session-portable-import-fail "portable project contains a non-portable import" (get item :filename)))
953
953
  (let ((specifier (get node :value)))
954
- (unless (and (js-call specifier :startsWith ".") (js-call specifier :endsWith ".eli"))
954
+ (unless (and (js-call specifier :startsWith ".")
955
+ (or (js-call specifier :endsWith ".eli") (js-call specifier :endsWith ".el")))
955
956
  (session-portable-import-fail (+ "portable import must be a relative .eli module: " specifier)
956
957
  (get item :filename)))
957
958
  (let ((parts (js-call (get item :filename) :split "/")))
@@ -3,16 +3,10 @@
3
3
  import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
4
4
  var __eliscript_tdz_ready_0;
5
5
  function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("here"); return here; }
6
- function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("here"); return __eliscript_const_error(); }
7
- var __eliscript_tdz_ready_1;
8
- function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("root"); return root; }
9
- function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("root"); return __eliscript_const_error(); }
10
6
  var __eliscript_tdz_ready_2;
11
7
  function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("environment"); return environment; }
12
- function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("environment"); return __eliscript_const_error(); }
13
8
  var __eliscript_tdz_ready_3;
14
9
  function __eliscript_tdz_read_3() { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("commands"); return commands; }
15
- function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("commands"); return __eliscript_const_error(); }
16
10
  import "eliscript/runtime/unicode-case.mjs";
17
11
  const __eliscript_truthy = (value) => value !== false && value != null;
18
12
 
@@ -22,11 +16,10 @@ import {createRequire} from "node:module";
22
16
  import {runReleaseCLI} from "../../tools/backends/dist/release-cli.mjs";
23
17
  const here = dirname(fileURLToPath(import.meta.url));
24
18
  __eliscript_tdz_ready_0 = true;
25
- const root = resolve((__eliscript_tdz_read_0()), "../..");
26
- __eliscript_tdz_ready_1 = true;
19
+ const root = resolve(here, "../..");
27
20
  const environment = (globalThis.process)["env"];
28
21
  __eliscript_tdz_ready_2 = true;
29
- ((((__eliscript_tdz_read_2()))["ELISCRIPT_BOOTSTRAP_MODULE_DIR"] == null) ? (((__eliscript_tdz_read_2()))["ELISCRIPT_BOOTSTRAP_MODULE_DIR"] = resolve((__eliscript_tdz_read_1()), "dist/bootstrap")) : null);
22
+ (((environment)["ELISCRIPT_BOOTSTRAP_MODULE_DIR"] == null) ? ((environment)["ELISCRIPT_BOOTSTRAP_MODULE_DIR"] = resolve(root, "dist/bootstrap")) : null);
30
23
  const commands = ({"eliscript": ["bun.mjs", "eliscript"], "eliscript-build": ["project-cli.mjs", "eliscript-build"], "eliscript-check": ["check-cli.mjs", "eliscript-check"], "eliscript-format": ["format-cli.mjs", "eliscript-format"], "eliscript-eval": ["evaluation-cli.mjs", "eliscript-eval"], "eliscript-watch": ["watch-cli.mjs", "eliscript-watch"], "eliscript-compiler": ["../../tools/backends/compiler-cli.mjs", "eliscript-compiler"]});
31
24
  __eliscript_tdz_ready_3 = true;
32
25
  async function main() {
@@ -1 +1 @@
1
- {"version":3,"file":"eliscript-cli.mjs","sources":["../../tools/backends/eliscript/package-cli-entry.eli"],"sourcesContent":["(module tools.backends.package-cli-entry\n (import \"node:path\" basename dirname resolve)\n (import \"node:url\" fileURLToPath)\n (import \"node:module\" createRequire)\n (import \"../../tools/backends/dist/release-cli.mjs\" runReleaseCLI)\n\n ;; This file is emitted at bootstrap/host/eliscript-cli.mjs. Installed bin\n ;; symlinks may have another name; locate runtime assets beside this module.\n (defconst here (dirname (fileURLToPath (js* \"import.meta.url\"))))\n (defconst root (resolve here \"../..\"))\n (defconst environment (get globalThis.process :env))\n (when (nullish? (get environment :ELISCRIPT_BOOTSTRAP_MODULE_DIR))\n (put environment :ELISCRIPT_BOOTSTRAP_MODULE_DIR (resolve root \"dist/bootstrap\")))\n (defconst commands\n (js-object\n :eliscript (js-array \"bun.mjs\" \"eliscript\")\n :eliscript-build (js-array \"project-cli.mjs\" \"eliscript-build\")\n :eliscript-check (js-array \"check-cli.mjs\" \"eliscript-check\")\n :eliscript-format (js-array \"format-cli.mjs\" \"eliscript-format\")\n :eliscript-eval (js-array \"evaluation-cli.mjs\" \"eliscript-eval\")\n :eliscript-watch (js-array \"watch-cli.mjs\" \"eliscript-watch\")\n :eliscript-compiler (js-array \"../../tools/backends/compiler-cli.mjs\" \"eliscript-compiler\")))\n\n (defasync main ()\n (let* ((arguments (get globalThis.process :argv))\n (invoked (basename (if (nullish? (aref arguments 1)) \"\" (aref arguments 1))))\n (found (get commands invoked))\n (selected (if (nullish? found) (get commands :eliscript) found))\n (entry (resolve here (aref selected 0))))\n (when (nullish? (get environment :ELISCRIPT_COMMAND_NAME))\n (put environment :ELISCRIPT_COMMAND_NAME (aref selected 1)))\n ;; The compiler entry has asynchronous ESM dependencies. Its static\n ;; import completes before main; the six established handlers still\n ;; capture their command environment only when their namespace loads.\n (if (= invoked \"eliscript-compiler\")\n (await (runReleaseCLI (js-call arguments :slice 2)))\n (let ((namespace (funcall (createRequire (resolve here \"eliscript-cli.mjs\")) entry)))\n (await (js-call namespace :main (js-call arguments :slice 2)))))))\n\n (js-call (main) :catch (lambda (error)\n (js-call globalThis.console :error error)\n (put globalThis.process :exitCode 1))))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACE,QAAoB,UAAS,SAAQ;AACrC,QAAmB;AACnB,QAAsB;AACtB,QAAoD;AAIpD,aAAgB,QAAS,cAAc;;AACvC,aAAgB,QAAQ,4BAAK;;AAC7B,oBAAsB,CAAK,oBAAmB;;AAC9C,CAAM,CAAU,CAAK,4BAAY,6CAC/B,EAAK,4BAAY,oCAAiC,QAAQ,4BAAK;AACjE,iBACE,EACE,aAAW,CAAU,WAAU,cAC/B,mBAAiB,CAAU,mBAAkB,oBAC7C,mBAAiB,CAAU,iBAAgB,oBAC3C,oBAAkB,CAAU,kBAAiB,qBAC7C,kBAAgB,CAAU,sBAAqB,mBAC/C,mBAAiB,CAAU,iBAAgB,oBAC3C,sBAAoB,CAAU,yCAAwC;;AAE1E;EACE,OAAA,eAAO;0BACA;4BACA;8BACA;gCACA;;cACL,IAAM,CAAU,CAAK,4BAAY;gBAC/B,EAAK,4BAAY,4BAAwB,CAAM,UAAS;;cAI1D,OAAA,CAAI,CAAG,YAAQ,wBACb,OAAQ,cAAc,CAAS,YAAU,SAAO,OAChD,eAAM;gBACJ,OAAA,OAAO,CAAS,WAAU,QAAM,CAAS,YAAU,SAAO;iBAD3C,CAAU,cAAe,QAAQ,4BAAK,uBAAsB;;aARlE,QAAQ,4BAAK,CAAM,UAAS;WAD1B,CAAI,CAAU,iBAAO,CAAK,4BAAS,eAAY;SADlD,CAAK,4BAAS;OADX,SAAS,CAAI,CAAU,CAAM,YAAU,cAAI,KAAG,CAAM,YAAU;KAD7D,CAAK,oBAAmB;;AAe5C,CAAU,QAAM,SAAO,EAAS;EAC9B,CAAS,oBAAmB,SAAO;EACnC,OAAA,EAAK,oBAAmB,cAAU"}
1
+ {"version":3,"file":"eliscript-cli.mjs","sources":["../../tools/backends/eliscript/package-cli-entry.eli"],"sourcesContent":["(module tools.backends.package-cli-entry\n (import \"node:path\" basename dirname resolve)\n (import \"node:url\" fileURLToPath)\n (import \"node:module\" createRequire)\n (import \"../../tools/backends/dist/release-cli.mjs\" runReleaseCLI)\n\n ;; This file is emitted at bootstrap/host/eliscript-cli.mjs. Installed bin\n ;; symlinks may have another name; locate runtime assets beside this module.\n (defconst here (dirname (fileURLToPath (js* \"import.meta.url\"))))\n (defconst root (resolve here \"../..\"))\n (defconst environment (get globalThis.process :env))\n (when (nullish? (get environment :ELISCRIPT_BOOTSTRAP_MODULE_DIR))\n (put environment :ELISCRIPT_BOOTSTRAP_MODULE_DIR (resolve root \"dist/bootstrap\")))\n (defconst commands\n (js-object\n :eliscript (js-array \"bun.mjs\" \"eliscript\")\n :eliscript-build (js-array \"project-cli.mjs\" \"eliscript-build\")\n :eliscript-check (js-array \"check-cli.mjs\" \"eliscript-check\")\n :eliscript-format (js-array \"format-cli.mjs\" \"eliscript-format\")\n :eliscript-eval (js-array \"evaluation-cli.mjs\" \"eliscript-eval\")\n :eliscript-watch (js-array \"watch-cli.mjs\" \"eliscript-watch\")\n :eliscript-compiler (js-array \"../../tools/backends/compiler-cli.mjs\" \"eliscript-compiler\")))\n\n (defasync main ()\n (let* ((arguments (get globalThis.process :argv))\n (invoked (basename (if (nullish? (aref arguments 1)) \"\" (aref arguments 1))))\n (found (get commands invoked))\n (selected (if (nullish? found) (get commands :eliscript) found))\n (entry (resolve here (aref selected 0))))\n (when (nullish? (get environment :ELISCRIPT_COMMAND_NAME))\n (put environment :ELISCRIPT_COMMAND_NAME (aref selected 1)))\n ;; The compiler entry has asynchronous ESM dependencies. Its static\n ;; import completes before main; the six established handlers still\n ;; capture their command environment only when their namespace loads.\n (if (= invoked \"eliscript-compiler\")\n (await (runReleaseCLI (js-call arguments :slice 2)))\n (let ((namespace (funcall (createRequire (resolve here \"eliscript-cli.mjs\")) entry)))\n (await (js-call namespace :main (js-call arguments :slice 2)))))))\n\n (js-call (main) :catch (lambda (error)\n (js-call globalThis.console :error error)\n (put globalThis.process :exitCode 1))))\n"],"names":[],"mappings":";;;;;;;;;;;;AACE,QAAoB,UAAS,SAAQ;AACrC,QAAmB;AACnB,QAAsB;AACtB,QAAoD;AAIpD,aAAgB,QAAS,cAAc;;AACvC,aAAgB,QAAQ,MAAK;AAC7B,oBAAsB,CAAK,oBAAmB;;AAC9C,CAAM,CAAU,CAAK,aAAY,6CAC/B,EAAK,aAAY,oCAAiC,QAAQ,MAAK;AACjE,iBACE,EACE,aAAW,CAAU,WAAU,cAC/B,mBAAiB,CAAU,mBAAkB,oBAC7C,mBAAiB,CAAU,iBAAgB,oBAC3C,oBAAkB,CAAU,kBAAiB,qBAC7C,kBAAgB,CAAU,sBAAqB,mBAC/C,mBAAiB,CAAU,iBAAgB,oBAC3C,sBAAoB,CAAU,yCAAwC;;AAE1E;EACE,OAAA,eAAO;0BACA;4BACA;8BACA;gCACA;;cACL,IAAM,CAAU,CAAK,4BAAY;gBAC/B,EAAK,4BAAY,4BAAwB,CAAM,UAAS;;cAI1D,OAAA,CAAI,CAAG,YAAQ,wBACb,OAAQ,cAAc,CAAS,YAAU,SAAO,OAChD,eAAM;gBACJ,OAAA,OAAO,CAAS,WAAU,QAAM,CAAS,YAAU,SAAO;iBAD3C,CAAU,cAAe,QAAQ,4BAAK,uBAAsB;;aARlE,QAAQ,4BAAK,CAAM,UAAS;WAD1B,CAAI,CAAU,iBAAO,CAAK,4BAAS,eAAY;SADlD,CAAK,4BAAS;OADX,SAAS,CAAI,CAAU,CAAM,YAAU,cAAI,KAAG,CAAM,YAAU;KAD7D,CAAK,oBAAmB;;AAe5C,CAAU,QAAM,SAAO,EAAS;EAC9B,CAAS,oBAAmB,SAAO;EACnC,OAAA,EAAK,oBAAmB,cAAU"}
@@ -1,19 +1,11 @@
1
1
  // Generated by Eliscript. Do not edit.
2
2
  import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
3
- var __eliscript_tdz_ready_0;
4
- function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("parseConfigurationJson"); return parseConfigurationJson; }
5
- function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("parseConfigurationJson"); return __eliscript_const_error(); }
6
3
  var __eliscript_tdz_ready_1;
7
4
  function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("parseArguments"); return parseArguments; }
8
- function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("parseArguments"); return __eliscript_const_error(); }
9
- var __eliscript_tdz_ready_2;
10
- function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("readProjectConfiguration"); return readProjectConfiguration; }
11
- function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("readProjectConfiguration"); return __eliscript_const_error(); }
12
5
  var __eliscript_tdz_ready_3;
13
6
  function __eliscript_tdz_read_3() { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("usage"); return usage; }
14
- function __eliscript_tdz_write_3(__eliscript_tdz_value_3) { if (__eliscript_tdz_ready_3 !== true) __eliscript_tdz_error("usage"); return __eliscript_const_error(); }
15
7
  import "eliscript/runtime/unicode-case.mjs";
16
- import { c as __eliscript_at, d as __eliscript_at_direct } from "data:text/javascript;base64,dmFyIG09UmVmbGVjdC5hcHBseSx0dD1OdW1iZXIucHJvdG90eXBlLnZhbHVlT2Ysaj1OdW1iZXIucHJvdG90eXBlLnRvU3RyaW5nLFU9TnVtYmVyLG50PU9iamVjdC5jcmVhdGUsaD1CaWdJbnQsZXQ9RGF0YVZpZXcsb3Q9QXJyYXlCdWZmZXIsaXQ9RGF0YVZpZXcuc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wxKSxwPSguLi51KT0+TChpLGYsU3QoYix1KSk7VChwLHB0LHt2YWx1ZToodSk9PnUgaW5zdGFuY2VvZiBpLGNvbmZpZ3VyYWJsZTohMH0pO2xldCByPXMoRSxwLFt2b2lkIDBdKTt1dChyLGZ0KG8pKTtsZXQgbD1hdChvKTtmb3IobGV0IHU9MDt1PGwubGVuZ3RoO3UrKylUKHIsbFt1XSxsdChvLGxbdV0pKTtyZXR1cm4gcn1yZXR1cm4gcyh0LG4sZSl9fWZ1bmN0aW9uIFJ0KHQsbil7bGV0IGU9dFtuXTtyZXR1cm4oLi4ubyk9PkwoZSx0LG8pfWZ1bmN0aW9uIEF0KHQsbiwuLi5lKXtsZXQgbz10W25dO3JldHVybiBMKG8sdCxlKX1leHBvcnR7UnQgYXMgYyxBdCBhcyBkfTs=";
8
+ import { __eliscript_at, __eliscript_at_direct } from "eliscript/runtime/prelude.mjs";
17
9
  const __eliscript_truthy = (value) => value !== false && value != null;
18
10
 
19
11
  import {readFileSync} from "node:fs";
@@ -22,11 +14,9 @@ import {fileURLToPath} from "node:url";
22
14
  import * as legacy from "./project-cli-legacy.mjs";
23
15
  import {diagnosticFromError, renderDiagnostic, requestedDiagnosticFormat} from "./bun.mjs";
24
16
  const parseConfigurationJson = (legacy)["parseConfigurationJson"];
25
- __eliscript_tdz_ready_0 = true;
26
17
  const parseArguments = (legacy)["parseArguments"];
27
18
  __eliscript_tdz_ready_1 = true;
28
19
  const readProjectConfiguration = (legacy)["readProjectConfiguration"];
29
- __eliscript_tdz_ready_2 = true;
30
20
  const usage = "Usage: eliscript-build [OPTIONS] [ENTRY ...]\n\nOptions:\n --out-dir DIR Write the generated module tree to DIR\n --config FILE Read a versioned project request from FILE\n --root DIR Contain local source imports below DIR\n --portable NAME Emit NAME and its transitive portable closure\n --stdin-file FILE Use standard input as the current contents of FILE\n --no-cache Disable cache reads for this build\n --json Print the versioned build decision report\n --diagnostic-format human|json\n Select human-readable or JSON failures\n -h, --help Show this help\n";
31
21
  __eliscript_tdz_ready_3 = true;
32
22
  async function execute(arguments$, ...supplied) {
@@ -1 +1 @@
1
- {"version":3,"file":"project-cli.mjs","sources":["../../tools/project/project-cli.eli"],"sourcesContent":["(module tools.project.project-cli\n (import \"node:fs\" readFileSync)\n (import \"node:path\" resolve)\n (import \"node:url\" fileURLToPath)\n (import \"./project-cli-legacy.mjs\" :as legacy)\n (import \"./bun.mjs\" diagnosticFromError renderDiagnostic requestedDiagnosticFormat)\n (defconst parseConfigurationJson (get legacy :parseConfigurationJson))\n (defconst parseArguments (get legacy :parseArguments))\n (defconst readProjectConfiguration (get legacy :readProjectConfiguration))\n (defconst usage \"Usage: eliscript-build [OPTIONS] [ENTRY ...]\\n\\nOptions:\\n --out-dir DIR Write the generated module tree to DIR\\n --config FILE Read a versioned project request from FILE\\n --root DIR Contain local source imports below DIR\\n --portable NAME Emit NAME and its transitive portable closure\\n --stdin-file FILE Use standard input as the current contents of FILE\\n --no-cache Disable cache reads for this build\\n --json Print the versioned build decision report\\n --diagnostic-format human|json\\n Select human-readable or JSON failures\\n -h, --help Show this help\\n\")\n (defasync execute (arguments &rest supplied)\n (let* ((options (if (or (= (js-length supplied) 0) (undefined? (aref supplied 0)))\n (js-object) (aref supplied 0)))\n ;; Consume an arbitrary argument iterable once, just as the original\n ;; parser's spread did. Both parses then see the same plain snapshot.\n (arguments (Array/from arguments))\n (parsed (funcall parseArguments arguments)))\n (when (and (not (undefined? (get parsed :stdinFile)))\n (nullish? (get options :stdinSource)))\n ;; fs/promises.readFile accepts a path or FileHandle, not numeric fd 0.\n ;; The synchronous fs API preserves UTF8 decoding and real EOF, while\n ;; an explicitly supplied source (including \"\") must never consume fd0.\n (setq options (Object/assign (js-object) options\n (js-object :stdinSource (readFileSync 0 \"utf8\")))))\n (await (js-call legacy :execute arguments options))))\n (defasync main (&rest arguments)\n (let* ((arguments (if (or (= (js-length arguments) 0) (undefined? (aref arguments 0)))\n (js-call (get globalThis.process :argv) :slice 2) (aref arguments 0)))\n (execution (await (execute arguments))))\n (if (get execution :help) (js-call (get globalThis.process :stdout) :write usage)\n (js-call (get globalThis.process :stdout) :write\n (str (if (get execution :jsonReport) (JSON/stringify (get (get execution :result) :report))\n (js-call (get (get execution :result) :entryOutputs) :join \"\\n\")) \"\\n\")))))\n (let ((entry (aref (get globalThis.process :argv) 1)))\n (when (and (not (undefined? entry)) (= (resolve entry) (fileURLToPath (js* \"import.meta.url\"))))\n (let ((format (requestedDiagnosticFormat (js-call (get globalThis.process :argv) :slice 2))))\n (js-call (main) :catch (lambda (error)\n (let ((diagnostic (diagnosticFromError error)))\n (if (= format \"json\") (console/error (JSON/stringify diagnostic))\n (console/error (str \"eliscript-build: \" (renderDiagnostic diagnostic))))\n (put globalThis.process :exitCode 1)))))))\n (export parseConfigurationJson parseArguments readProjectConfiguration execute main))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACE,QAAkB;AAClB,QAAoB;AACpB,QAAmB;AACnB,YAAuC;AACvC,QAAoB,qBAAoB,kBAAiB;AACzD,+BAAiC,CAAK,QAAO;;AAC7C,uBAAyB,CAAK,QAAO;;AACrC,iCAAmC,CAAK,QAAO;;AAC/C,cAAgB;;AAChB,uBAAmB,eAAgB;EACjC,OAAA,eAAO;0BAIA;4BACA;;UACL,IAAM,CAAK,EAAK,CAAY,CAAK,QAAO,gCAC7B,CAAU,CAAK,SAAQ;YAIhC,CAAM,CAAA,UAAS,cAAc,MAAY,SACvC,EAAW,eAAc,aAAa,GAAE;;UAC5C,OAAA,OAAO,CAAS,QAAO,WAAS,YAAU;;SARpB,2BAAe;OADpB,WAAW;KAJd,CAAI,CAAI,CAAG,EAAW,4BAAU,MAAG,CAAY,CAAM,UAAS,qBAC1D,OAAY,CAAM,UAAS;;AAajD,uBAAsB;EACpB,OAAA,eAAO;aAEA;aACL,oBAAI,CAAK,WAAU,WAAO,CAAS,CAAK,oBAAmB,WAAS,SAAO,8BACzE,CAAS,CAAK,oBAAmB,WAAS,SACxC,QAAK,oBAAI,CAAK,WAAU,iBAAc,eAAe,CAAK,CAAK,WAAU,WAAS,aAC3E,sBAAS,CAAK,CAAK,WAAU,WAAS,iBAAe,QAAM,iBAAO;OAJ7D,OAAQ,QAAQ;KAFhB,CAAI,CAAI,CAAG,EAAW,8BAAW,MAAG,CAAY,CAAM,YAAU,qBAC7D,CAAS,CAAK,oBAAmB,SAAO,SAAO,KAAG,CAAM,YAAU;;AAMzF,EAAM;EACJ,IAAM,CAAK,EAAK,CAAY,yBAAQ,CAAI,QAAQ,WAAQ,cAAc;IACpE;kCAAe,0BAA0B,CAAS,CAAK,oBAAmB,SAAO,SAAO;;YAAlF;QACJ,OAAA,CAAU,QAAM,SAAO,EAAS;UAC9B;wCAAmB,oBAAoB;;kBAAjC;cACJ,IAAI,CAAG,WAAO;gBAAS,cAAe,eAAe;;gBAClD,cAAc,QAAK,8BAAqB,iBAAiB;;cAC5D,OAAA,EAAK,oBAAmB,cAAU;;;;;;;;;GAP/B,CAAM,CAAK,oBAAmB,SAAO;AAQlD,QAAQ,wBAAuB,gBAAe,0BAAyB,SAAQ"}
1
+ {"version":3,"file":"project-cli.mjs","sources":["../../tools/project/project-cli.eli"],"sourcesContent":["(module tools.project.project-cli\n (import \"node:fs\" readFileSync)\n (import \"node:path\" resolve)\n (import \"node:url\" fileURLToPath)\n (import \"./project-cli-legacy.mjs\" :as legacy)\n (import \"./bun.mjs\" diagnosticFromError renderDiagnostic requestedDiagnosticFormat)\n (defconst parseConfigurationJson (get legacy :parseConfigurationJson))\n (defconst parseArguments (get legacy :parseArguments))\n (defconst readProjectConfiguration (get legacy :readProjectConfiguration))\n (defconst usage \"Usage: eliscript-build [OPTIONS] [ENTRY ...]\\n\\nOptions:\\n --out-dir DIR Write the generated module tree to DIR\\n --config FILE Read a versioned project request from FILE\\n --root DIR Contain local source imports below DIR\\n --portable NAME Emit NAME and its transitive portable closure\\n --stdin-file FILE Use standard input as the current contents of FILE\\n --no-cache Disable cache reads for this build\\n --json Print the versioned build decision report\\n --diagnostic-format human|json\\n Select human-readable or JSON failures\\n -h, --help Show this help\\n\")\n (defasync execute (arguments &rest supplied)\n (let* ((options (if (or (= (js-length supplied) 0) (undefined? (aref supplied 0)))\n (js-object) (aref supplied 0)))\n ;; Consume an arbitrary argument iterable once, just as the original\n ;; parser's spread did. Both parses then see the same plain snapshot.\n (arguments (Array/from arguments))\n (parsed (funcall parseArguments arguments)))\n (when (and (not (undefined? (get parsed :stdinFile)))\n (nullish? (get options :stdinSource)))\n ;; fs/promises.readFile accepts a path or FileHandle, not numeric fd 0.\n ;; The synchronous fs API preserves UTF8 decoding and real EOF, while\n ;; an explicitly supplied source (including \"\") must never consume fd0.\n (setq options (Object/assign (js-object) options\n (js-object :stdinSource (readFileSync 0 \"utf8\")))))\n (await (js-call legacy :execute arguments options))))\n (defasync main (&rest arguments)\n (let* ((arguments (if (or (= (js-length arguments) 0) (undefined? (aref arguments 0)))\n (js-call (get globalThis.process :argv) :slice 2) (aref arguments 0)))\n (execution (await (execute arguments))))\n (if (get execution :help) (js-call (get globalThis.process :stdout) :write usage)\n (js-call (get globalThis.process :stdout) :write\n (str (if (get execution :jsonReport) (JSON/stringify (get (get execution :result) :report))\n (js-call (get (get execution :result) :entryOutputs) :join \"\\n\")) \"\\n\")))))\n (let ((entry (aref (get globalThis.process :argv) 1)))\n (when (and (not (undefined? entry)) (= (resolve entry) (fileURLToPath (js* \"import.meta.url\"))))\n (let ((format (requestedDiagnosticFormat (js-call (get globalThis.process :argv) :slice 2))))\n (js-call (main) :catch (lambda (error)\n (let ((diagnostic (diagnosticFromError error)))\n (if (= format \"json\") (console/error (JSON/stringify diagnostic))\n (console/error (str \"eliscript-build: \" (renderDiagnostic diagnostic))))\n (put globalThis.process :exitCode 1)))))))\n (export parseConfigurationJson parseArguments readProjectConfiguration execute main))\n"],"names":[],"mappings":";;;;;;;;;;AACE,QAAkB;AAClB,QAAoB;AACpB,QAAmB;AACnB,YAAuC;AACvC,QAAoB,qBAAoB,kBAAiB;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QAAQ,wBAAuB,gBAAe,0BAAyB,SAAQ"}
@@ -1,16 +1,11 @@
1
1
  // Generated by Eliscript. Do not edit.
2
2
  import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
3
- var __eliscript_tdz_ready_0;
4
- function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("checkProject"); return checkProject; }
5
- function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("checkProject"); return __eliscript_const_error(); }
6
3
  var __eliscript_tdz_ready_1;
7
4
  function __eliscript_tdz_read_1() { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("source_root"); return source_root; }
8
- function __eliscript_tdz_write_1(__eliscript_tdz_value_1) { if (__eliscript_tdz_ready_1 !== true) __eliscript_tdz_error("source_root"); return __eliscript_const_error(); }
9
5
  var __eliscript_tdz_ready_2;
10
6
  function __eliscript_tdz_read_2() { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("capsules"); return capsules; }
11
- function __eliscript_tdz_write_2(__eliscript_tdz_value_2) { if (__eliscript_tdz_ready_2 !== true) __eliscript_tdz_error("capsules"); return __eliscript_const_error(); }
12
7
  import "eliscript/runtime/unicode-case.mjs";
13
- import { c as __eliscript_at, d as __eliscript_at_direct } from "data:text/javascript;base64,dmFyIG09UmVmbGVjdC5hcHBseSx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1aKHkoZSwyKSwhMSksdD1vLG49aTtjb250aW51ZX1pZih0PT09RSl7bGV0IG89cyh0LG4sZSk7aWYobiE9PWomJm4hPT1LJiZuIT09eiYmbiE9PU0mJm4hPT1OJiZuIT09cyYmbiE9PUUpcmV0dXJuIG87bGV0IGk9bixmPXkoZSwwKSxiPVgoZSwxKSxwPSguLi51KT0+TChpLGYsU3QoYix1KSk7VChwLHB0LHt2YWx1ZToodSk9PnUgaW5zdGFuY2VvZiBpLGNvbmZpZ3VyYWJsZTohMH0pO2xldCByPXMoRSxwLFt2b2lkIDBdKTt1dChyLGZ0KG8pKTtsZXQgbD1hdChvKTtmb3IobGV0IHU9MDt1PGwubGVuZ3RoO3UrKylUKHIsbFt1XSxsdChvLGxbdV0pKTtyZXR1cm4gcn1yZXR1cm4gcyh0LG4sZSl9fWZ1bmN0aW9uIFJ0KHQsbil7bGV0IGU9dFtuXTtyZXR1cm4oLi4ubyk9PkwoZSx0LG8pfWZ1bmN0aW9uIEF0KHQsbiwuLi5lKXtsZXQgbz10W25dO3JldHVybiBMKG8sdCxlKX1leHBvcnR7UnQgYXMgYyxBdCBhcyBkfTs=";
8
+ import { __eliscript_at, __eliscript_at_direct } from "eliscript/runtime/prelude.mjs";
14
9
  const __eliscript_truthy = (value) => value !== false && value != null;
15
10
 
16
11
  import {createHash} from "node:crypto";
@@ -21,10 +16,9 @@ import {Buffer} from "node:buffer";
21
16
  import {createRequire} from "node:module";
22
17
  import * as legacy from "./project-legacy.mjs";
23
18
  const checkProject = (legacy)["checkProject"];
24
- __eliscript_tdz_ready_0 = true;
25
19
  const source_root = resolve(dirname(fileURLToPath(import.meta.url)), "../..");
26
20
  __eliscript_tdz_ready_1 = true;
27
- const capsules = ["math", "unicode-case", "unicode-case-data"];
21
+ const capsules = ["math", "prelude", "unicode-case", "unicode-case-data"];
28
22
  __eliscript_tdz_ready_2 = true;
29
23
  function digest(bytes) {
30
24
  return ((createHash("sha256"))["update"](bytes))["digest"]("hex");