eliscript 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. package/README.md +61 -0
  2. package/bootstrap/README.md +26 -0
  3. package/bootstrap/backends/README.md +515 -0
  4. package/bootstrap/backends/async.eli +230 -0
  5. package/bootstrap/backends/binary.eli +173 -0
  6. package/bootstrap/backends/capabilities.eli +74 -0
  7. package/bootstrap/backends/elf.eli +246 -0
  8. package/bootstrap/backends/managed.eli +5976 -0
  9. package/bootstrap/backends/memory.eli +100 -0
  10. package/bootstrap/backends/native.eli +2000 -0
  11. package/bootstrap/backends/numeric.eli +1362 -0
  12. package/bootstrap/backends/optimize.eli +79 -0
  13. package/bootstrap/backends/regexp.eli +2263 -0
  14. package/bootstrap/backends/sha256.eli +138 -0
  15. package/bootstrap/backends/wasm.eli +1161 -0
  16. package/bootstrap/compiler/analyzer.eli +165 -77
  17. package/bootstrap/compiler/compiler.eli +43 -19
  18. package/bootstrap/compiler/emitter.eli +780 -170
  19. package/bootstrap/compiler/expander.eli +136 -45
  20. package/bootstrap/compiler/formatter.eli +8 -1
  21. package/bootstrap/compiler/ir.eli +148 -45
  22. package/bootstrap/compiler/lower.eli +29 -2
  23. package/bootstrap/compiler/project.eli +51 -21
  24. package/bootstrap/compiler/reader.eli +128 -36
  25. package/bootstrap/compiler/source-map.eli +46 -4
  26. package/bootstrap/compiler/symbol.eli +2 -1
  27. package/bootstrap/compiler/syntax.eli +47 -12
  28. package/bootstrap/compiler/transient-analysis.eli +40 -4
  29. package/bootstrap/host/check-cli-legacy.mjs +163 -0
  30. package/bootstrap/host/check-cli.mjs +59 -158
  31. package/bootstrap/host/check-cli.mjs.map +1 -0
  32. package/bootstrap/host/compiler-session.eli +1579 -0
  33. package/bootstrap/host/compiler-tools.eli +513 -0
  34. package/bootstrap/host/eliscript-cli.mjs +53 -33
  35. package/bootstrap/host/eliscript-cli.mjs.map +1 -0
  36. package/bootstrap/host/project-cli-legacy.mjs +295 -0
  37. package/bootstrap/host/project-cli.mjs +74 -289
  38. package/bootstrap/host/project-cli.mjs.map +1 -0
  39. package/bootstrap/host/project-legacy.mjs +1080 -0
  40. package/bootstrap/host/project.mjs +210 -1060
  41. package/bootstrap/host/project.mjs.map +1 -0
  42. package/bootstrap/runtime/UNICODE-LICENSE.txt +39 -0
  43. package/bootstrap/runtime/memory.eli +30379 -0
  44. package/browser/host.mjs +732 -11
  45. package/browser/worker.mjs +6 -3
  46. package/compiler/eliscript-analyzer.el +371 -4
  47. package/compiler/eliscript-cli.el +84 -1
  48. package/compiler/eliscript-emitter.el +1189 -256
  49. package/compiler/eliscript-expander.el +147 -10
  50. package/compiler/eliscript-ir-emitter.el +725 -208
  51. package/compiler/eliscript-lower.el +127 -1
  52. package/compiler/eliscript-portable.el +177 -51
  53. package/compiler/eliscript-project.el +20 -2
  54. package/compiler/eliscript-reader.el +141 -57
  55. package/compiler/eliscript-source-map.el +26 -12
  56. package/compiler/eliscript-transient-analysis.el +382 -19
  57. package/dist/backends/async.mjs +561 -0
  58. package/dist/backends/async.mjs.macro-origins.json +1 -0
  59. package/dist/backends/async.mjs.map +1 -0
  60. package/dist/backends/binary.mjs +381 -0
  61. package/dist/backends/binary.mjs.macro-origins.json +1 -0
  62. package/dist/backends/binary.mjs.map +1 -0
  63. package/dist/backends/capabilities.mjs +237 -0
  64. package/dist/backends/capabilities.mjs.macro-origins.json +1 -0
  65. package/dist/backends/capabilities.mjs.map +1 -0
  66. package/dist/backends/elf.mjs +540 -0
  67. package/dist/backends/elf.mjs.macro-origins.json +1 -0
  68. package/dist/backends/elf.mjs.map +1 -0
  69. package/dist/backends/managed.mjs +10616 -0
  70. package/dist/backends/managed.mjs.macro-origins.json +1 -0
  71. package/dist/backends/managed.mjs.map +1 -0
  72. package/dist/backends/memory.mjs +278 -0
  73. package/dist/backends/memory.mjs.macro-origins.json +1 -0
  74. package/dist/backends/memory.mjs.map +1 -0
  75. package/dist/backends/native.mjs +4099 -0
  76. package/dist/backends/native.mjs.macro-origins.json +1 -0
  77. package/dist/backends/native.mjs.map +1 -0
  78. package/dist/backends/numeric.mjs +2458 -0
  79. package/dist/backends/numeric.mjs.macro-origins.json +1 -0
  80. package/dist/backends/numeric.mjs.map +1 -0
  81. package/dist/backends/optimize.mjs +204 -0
  82. package/dist/backends/optimize.mjs.macro-origins.json +1 -0
  83. package/dist/backends/optimize.mjs.map +1 -0
  84. package/dist/backends/regexp.mjs +2033 -0
  85. package/dist/backends/regexp.mjs.macro-origins.json +1 -0
  86. package/dist/backends/regexp.mjs.map +1 -0
  87. package/dist/backends/sha256.mjs +310 -0
  88. package/dist/backends/sha256.mjs.macro-origins.json +1 -0
  89. package/dist/backends/sha256.mjs.map +1 -0
  90. package/dist/backends/wasm.mjs +2258 -0
  91. package/dist/backends/wasm.mjs.macro-origins.json +1 -0
  92. package/dist/backends/wasm.mjs.map +1 -0
  93. package/dist/bootstrap/analyzer.mjs +1908 -776
  94. package/dist/bootstrap/analyzer.mjs.macro-origins.json +1 -0
  95. package/dist/bootstrap/analyzer.mjs.map +1 -1
  96. package/dist/bootstrap/compiler.mjs +450 -142
  97. package/dist/bootstrap/compiler.mjs.macro-origins.json +1 -0
  98. package/dist/bootstrap/compiler.mjs.map +1 -1
  99. package/dist/bootstrap/emitter.mjs +3083 -909
  100. package/dist/bootstrap/emitter.mjs.macro-origins.json +1 -0
  101. package/dist/bootstrap/emitter.mjs.map +1 -1
  102. package/dist/bootstrap/expander.mjs +2887 -1233
  103. package/dist/bootstrap/expander.mjs.macro-origins.json +1 -0
  104. package/dist/bootstrap/expander.mjs.map +1 -1
  105. package/dist/bootstrap/formatter.mjs +582 -218
  106. package/dist/bootstrap/formatter.mjs.macro-origins.json +1 -0
  107. package/dist/bootstrap/formatter.mjs.map +1 -1
  108. package/dist/bootstrap/ir.mjs +670 -116
  109. package/dist/bootstrap/ir.mjs.macro-origins.json +1 -0
  110. package/dist/bootstrap/ir.mjs.map +1 -1
  111. package/dist/bootstrap/lower.mjs +866 -257
  112. package/dist/bootstrap/lower.mjs.macro-origins.json +1 -0
  113. package/dist/bootstrap/lower.mjs.map +1 -1
  114. package/dist/bootstrap/package.json +1 -0
  115. package/dist/bootstrap/project.mjs +1168 -498
  116. package/dist/bootstrap/project.mjs.macro-origins.json +1 -0
  117. package/dist/bootstrap/project.mjs.map +1 -1
  118. package/dist/bootstrap/reader.mjs +674 -175
  119. package/dist/bootstrap/reader.mjs.macro-origins.json +1 -0
  120. package/dist/bootstrap/reader.mjs.map +1 -1
  121. package/dist/bootstrap/runtime/math.mjs +1117 -0
  122. package/dist/bootstrap/runtime/math.mjs.map +1 -0
  123. package/dist/bootstrap/runtime/unicode-case-data.mjs +10125 -0
  124. package/dist/bootstrap/runtime/unicode-case-data.mjs.map +1 -0
  125. package/dist/bootstrap/runtime/unicode-case.mjs +281 -0
  126. package/dist/bootstrap/runtime/unicode-case.mjs.map +1 -0
  127. package/dist/bootstrap/source-map.mjs +430 -119
  128. package/dist/bootstrap/source-map.mjs.macro-origins.json +1 -0
  129. package/dist/bootstrap/source-map.mjs.map +1 -1
  130. package/dist/bootstrap/symbol.mjs +229 -53
  131. package/dist/bootstrap/symbol.mjs.macro-origins.json +1 -0
  132. package/dist/bootstrap/symbol.mjs.map +1 -1
  133. package/dist/bootstrap/syntax.mjs +205 -7
  134. package/dist/bootstrap/syntax.mjs.macro-origins.json +1 -0
  135. package/dist/bootstrap/syntax.mjs.map +1 -1
  136. package/dist/bootstrap/transient-analysis.mjs +1185 -489
  137. package/dist/bootstrap/transient-analysis.mjs.macro-origins.json +1 -0
  138. package/dist/bootstrap/transient-analysis.mjs.map +1 -1
  139. package/dist/browser/compiler.js +199 -6478
  140. package/dist/browser/host.mjs +1078 -0
  141. package/dist/browser/loader.js +1 -0
  142. package/dist/browser/loader.mjs +231 -0
  143. package/dist/browser/worker.mjs +63 -0
  144. package/dist/compiler-artifact.json +1 -0
  145. package/dist/host/compiler-session.mjs +2980 -0
  146. package/dist/host/compiler-session.mjs.macro-origins.json +1 -0
  147. package/dist/host/compiler-session.mjs.map +1 -0
  148. package/dist/host/compiler-tools.mjs +1084 -0
  149. package/dist/host/compiler-tools.mjs.macro-origins.json +1 -0
  150. package/dist/host/compiler-tools.mjs.map +1 -0
  151. package/dist/literal-sources/runtime/core/collection-internals.eli +60 -0
  152. package/dist/literal-sources/runtime/core/collection.eli +639 -0
  153. package/dist/literal-sources/runtime/core/data-text.eli +290 -0
  154. package/dist/literal-sources/runtime/core/data.eli +22 -0
  155. package/dist/literal-sources/runtime/core/identifier.eli +44 -0
  156. package/dist/literal-sources/runtime/core/lazy-sequence.eli +131 -0
  157. package/dist/literal-sources/runtime/core/list.eli +19 -0
  158. package/dist/literal-sources/runtime/core/map.eli +9 -0
  159. package/dist/literal-sources/runtime/core/metadata-internals.eli +6 -0
  160. package/dist/literal-sources/runtime/core/metadata.eli +40 -0
  161. package/dist/literal-sources/runtime/core/object.eli +8 -0
  162. package/dist/literal-sources/runtime/core/order.eli +123 -0
  163. package/dist/literal-sources/runtime/core/persistent-kind.eli +28 -0
  164. package/dist/literal-sources/runtime/core/protocol-error.eli +32 -0
  165. package/dist/literal-sources/runtime/core/protocol.eli +28 -0
  166. package/dist/literal-sources/runtime/core/queue.eli +9 -0
  167. package/dist/literal-sources/runtime/core/record.eli +191 -0
  168. package/dist/literal-sources/runtime/core/regex.eli +158 -0
  169. package/dist/literal-sources/runtime/core/sequence.eli +305 -0
  170. package/dist/literal-sources/runtime/core/set-algebra.eli +28 -0
  171. package/dist/literal-sources/runtime/core/set.eli +9 -0
  172. package/dist/literal-sources/runtime/core/sorted.eli +408 -0
  173. package/dist/literal-sources/runtime/core/text.eli +14 -0
  174. package/dist/literal-sources/runtime/core/transducer.eli +268 -0
  175. package/dist/literal-sources/runtime/core/transient.eli +17 -0
  176. package/dist/literal-sources/runtime/core/truth.eli +4 -0
  177. package/dist/literal-sources/runtime/core/type.eli +232 -0
  178. package/dist/literal-sources/runtime/core/value-internals.eli +13 -0
  179. package/dist/literal-sources/runtime/core/value.eli +19 -0
  180. package/dist/literal-sources/runtime/core/vector.eli +25 -0
  181. package/dist/literal-sources/runtime/literals.eli +23 -0
  182. package/dist/literal-sources/runtime/testing/value.eli +6 -0
  183. package/dist/literal-sources/runtime/wire/http-rpc.eli +362 -0
  184. package/dist/literal-sources/runtime/wire/markdown.eli +275 -0
  185. package/dist/literal-sources/runtime/wire/schema.eli +193 -0
  186. package/dist/literal-sources/stdlib/bit.eli +36 -0
  187. package/dist/literal-sources/stdlib/core/data.eli +306 -0
  188. package/dist/literal-sources/stdlib/core/object.eli +89 -0
  189. package/dist/literal-sources/stdlib/core/protocol.eli +451 -0
  190. package/dist/literal-sources/stdlib/core/set.eli +312 -0
  191. package/dist/literal-sources/stdlib/core/text.eli +103 -0
  192. package/dist/literal-sources/stdlib/managed-literal-protocols.eli +494 -0
  193. package/dist/literal-sources/stdlib/managed-literals.eli +1469 -0
  194. package/dist/literal-sources/stdlib/managed-queue-state.eli +65 -0
  195. package/dist/literal-sources/stdlib/managed-sorted-state.eli +233 -0
  196. package/dist/literal-sources/stdlib/managed-transient-state.eli +348 -0
  197. package/dist/literal-sources/stdlib/managed-value-state.eli +153 -0
  198. package/dist/literal-sources/stdlib/managed-vector-view-state.eli +102 -0
  199. package/dist/literal-sources/stdlib/persistent-list.eli +145 -0
  200. package/dist/literal-sources/stdlib/persistent-map.eli +724 -0
  201. package/dist/literal-sources/stdlib/persistent-set.eli +236 -0
  202. package/dist/literal-sources/stdlib/persistent-vector.eli +359 -0
  203. package/dist/literal-sources/stdlib/value.eli +325 -0
  204. package/dist/package.json +10 -0
  205. package/dist/runtime/math.mjs +1116 -0
  206. package/dist/runtime/math.mjs.macro-origins.json +1 -0
  207. package/dist/runtime/math.mjs.map +1 -0
  208. package/dist/runtime/unicode-case-data.mjs +10124 -0
  209. package/dist/runtime/unicode-case-data.mjs.macro-origins.json +1 -0
  210. package/dist/runtime/unicode-case-data.mjs.map +1 -0
  211. package/dist/runtime/unicode-case.mjs +280 -0
  212. package/dist/runtime/unicode-case.mjs.macro-origins.json +1 -0
  213. package/dist/runtime/unicode-case.mjs.map +1 -0
  214. package/dist/runtime.eli +30379 -0
  215. package/dist/stage3-release.json +1 -0
  216. package/editor/README.md +1 -1
  217. package/editor/eliscript-mode.el +1 -1
  218. package/editor/eliscript-repl.el +1 -1
  219. package/package.json +106 -11
  220. package/platform/http.mjs +20 -0
  221. package/runtime/array-text.mjs +159 -0
  222. package/runtime/core/map-internals.mjs +27 -9
  223. package/runtime/core/object-impl.mjs +26 -17
  224. package/runtime/core/object-impl.mjs.map +1 -1
  225. package/runtime/core/protocol-impl.mjs +682 -255
  226. package/runtime/core/protocol-impl.mjs.map +1 -1
  227. package/runtime/core/protocol.mjs +4 -0
  228. package/runtime/core/record.mjs +23 -2
  229. package/runtime/core/regex.mjs +4 -0
  230. package/runtime/core/sorted.mjs +53 -0
  231. package/runtime/core/text-impl.mjs +167 -48
  232. package/runtime/core/text-impl.mjs.map +1 -1
  233. package/runtime/core/type.mjs +75 -3
  234. package/runtime/core/vector.mjs +6 -0
  235. package/runtime/math.eli +429 -0
  236. package/runtime/math.mjs +1116 -0
  237. package/runtime/math.mjs.map +1 -0
  238. package/runtime/number-radix.mjs +105 -0
  239. package/runtime/unicode-case-data.eli +29 -0
  240. package/runtime/unicode-case-data.mjs +10124 -0
  241. package/runtime/unicode-case-data.mjs.map +1 -0
  242. package/runtime/unicode-case.eli +100 -0
  243. package/runtime/unicode-case.mjs +280 -0
  244. package/runtime/unicode-case.mjs.map +1 -0
  245. package/runtime/wire/http-rpc.mjs +168 -0
  246. package/runtime/wire/markdown.mjs +196 -0
  247. package/runtime/wire/schema.mjs +109 -0
  248. package/stdlib/README.md +54 -0
  249. package/stdlib/core/protocol.eli +81 -17
  250. package/stdlib/core/seq.eli +1 -1
  251. package/stdlib/core/zipper.eli +172 -72
  252. package/stdlib/gepo.eli +12 -0
  253. package/stdlib/interop/js.eli +56 -15
  254. package/stdlib/managed-literal-protocols.eli +494 -0
  255. package/stdlib/managed-literals.eli +1469 -0
  256. package/stdlib/managed-protocol-error.eli +32 -0
  257. package/stdlib/managed-queue-state.eli +65 -0
  258. package/stdlib/managed-runtime-collection-internals.eli +60 -0
  259. package/stdlib/managed-runtime-collection.eli +639 -0
  260. package/stdlib/managed-runtime-data-text.eli +290 -0
  261. package/stdlib/managed-runtime-data.eli +22 -0
  262. package/stdlib/managed-runtime-identifier.eli +44 -0
  263. package/stdlib/managed-runtime-lazy-sequence.eli +131 -0
  264. package/stdlib/managed-runtime-list.eli +19 -0
  265. package/stdlib/managed-runtime-literals.eli +23 -0
  266. package/stdlib/managed-runtime-map.eli +9 -0
  267. package/stdlib/managed-runtime-metadata-internals.eli +6 -0
  268. package/stdlib/managed-runtime-metadata.eli +40 -0
  269. package/stdlib/managed-runtime-object.eli +8 -0
  270. package/stdlib/managed-runtime-order.eli +123 -0
  271. package/stdlib/managed-runtime-persistent-kind.eli +28 -0
  272. package/stdlib/managed-runtime-protocol.eli +28 -0
  273. package/stdlib/managed-runtime-queue.eli +9 -0
  274. package/stdlib/managed-runtime-record.eli +191 -0
  275. package/stdlib/managed-runtime-regex.eli +158 -0
  276. package/stdlib/managed-runtime-sequence.eli +305 -0
  277. package/stdlib/managed-runtime-set-algebra.eli +28 -0
  278. package/stdlib/managed-runtime-set.eli +9 -0
  279. package/stdlib/managed-runtime-sorted.eli +408 -0
  280. package/stdlib/managed-runtime-text.eli +14 -0
  281. package/stdlib/managed-runtime-transducer.eli +268 -0
  282. package/stdlib/managed-runtime-transient.eli +17 -0
  283. package/stdlib/managed-runtime-truth.eli +4 -0
  284. package/stdlib/managed-runtime-type.eli +232 -0
  285. package/stdlib/managed-runtime-value-internals.eli +13 -0
  286. package/stdlib/managed-runtime-value.eli +19 -0
  287. package/stdlib/managed-runtime-vector.eli +25 -0
  288. package/stdlib/managed-sorted-state.eli +233 -0
  289. package/stdlib/managed-testing-value.eli +6 -0
  290. package/stdlib/managed-transient-state.eli +348 -0
  291. package/stdlib/managed-value-state.eli +153 -0
  292. package/stdlib/managed-vector-view-state.eli +102 -0
  293. package/stdlib/managed-wire-http-rpc.eli +362 -0
  294. package/stdlib/managed-wire-markdown.eli +275 -0
  295. package/stdlib/managed-wire-schema.eli +193 -0
  296. package/stdlib/mdp.eli +7 -0
  297. package/stdlib/mds.eli +4 -0
  298. package/stdlib/persistent-vector.eli +23 -6
  299. package/tools/acceptance/check-legacy.mjs +687 -0
  300. package/tools/acceptance/check.eli +431 -0
  301. package/tools/acceptance/compile-evidence.el +49 -0
  302. package/tools/acceptance/finalize-legacy.mjs +498 -0
  303. package/tools/acceptance/finalize.eli +270 -0
  304. package/tools/backends/benchmark.mjs +175 -0
  305. package/tools/backends/build.mjs +135 -0
  306. package/tools/backends/compile.mjs +94 -0
  307. package/tools/backends/compiler-bootstrap.mjs +1001 -0
  308. package/tools/backends/compiler-browser.mjs +361 -0
  309. package/tools/backends/compiler-build.mjs +1628 -0
  310. package/tools/backends/compiler-cli-legacy.mjs +334 -0
  311. package/tools/backends/compiler-cli.mjs +29 -0
  312. package/tools/backends/compiler-corpus-bit.mjs +234 -0
  313. package/tools/backends/compiler-corpus-cli-adapters-legacy.mjs +362 -0
  314. package/tools/backends/compiler-corpus-cli-adapters.mjs +247 -0
  315. package/tools/backends/compiler-corpus-debugging.mjs +221 -0
  316. package/tools/backends/compiler-corpus-emitter.mjs +324 -0
  317. package/tools/backends/compiler-corpus-evaluation-adapters.mjs +65 -0
  318. package/tools/backends/compiler-corpus-execution-legacy.mjs +769 -0
  319. package/tools/backends/compiler-corpus-execution.mjs +3324 -0
  320. package/tools/backends/compiler-corpus-fuzz.mjs +229 -0
  321. package/tools/backends/compiler-corpus-generations.mjs +208 -0
  322. package/tools/backends/compiler-corpus-host-context-legacy.mjs +114 -0
  323. package/tools/backends/compiler-corpus-host-context.mjs +550 -0
  324. package/tools/backends/compiler-corpus-identity-host.mjs +553 -0
  325. package/tools/backends/compiler-corpus-identity-value-adapters-legacy.mjs +298 -0
  326. package/tools/backends/compiler-corpus-identity-value-adapters.mjs +69 -0
  327. package/tools/backends/compiler-corpus-isolated-exports.mjs +21 -0
  328. package/tools/backends/compiler-corpus-legacy.mjs +1155 -0
  329. package/tools/backends/compiler-corpus-literal-provider.mjs +282 -0
  330. package/tools/backends/compiler-corpus-managed-adapters-legacy.mjs +334 -0
  331. package/tools/backends/compiler-corpus-managed-adapters.mjs +937 -0
  332. package/tools/backends/compiler-corpus-managed-cases.mjs +179 -0
  333. package/tools/backends/compiler-corpus-managed-fixtures-legacy.mjs +879 -0
  334. package/tools/backends/compiler-corpus-managed-fixtures.mjs +1287 -0
  335. package/tools/backends/compiler-corpus-matchers.mjs +173 -0
  336. package/tools/backends/compiler-corpus-original-program.mjs +612 -0
  337. package/tools/backends/compiler-corpus-process.mjs +765 -0
  338. package/tools/backends/compiler-corpus-program-driver.mjs +306 -0
  339. package/tools/backends/compiler-corpus-project-adapters-legacy.mjs +497 -0
  340. package/tools/backends/compiler-corpus-project-adapters.mjs +340 -0
  341. package/tools/backends/compiler-corpus-project-entry-host.mjs +511 -0
  342. package/tools/backends/compiler-corpus-project-transport.mjs +151 -0
  343. package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1438 -0
  344. package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1456 -0
  345. package/tools/backends/compiler-corpus-raw-math-fixture.mjs +346 -0
  346. package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +523 -0
  347. package/tools/backends/compiler-corpus-reference-legacy.mjs +263 -0
  348. package/tools/backends/compiler-corpus-reference.mjs +241 -0
  349. package/tools/backends/compiler-corpus-runtime-adapters-legacy.mjs +843 -0
  350. package/tools/backends/compiler-corpus-runtime-adapters.mjs +663 -0
  351. package/tools/backends/compiler-corpus-source-archive.mjs +206 -0
  352. package/tools/backends/compiler-corpus-tools-artifact-adapters.mjs +410 -0
  353. package/tools/backends/compiler-corpus-tools-cli.mjs +363 -0
  354. package/tools/backends/compiler-corpus-tools-reference.mjs +264 -0
  355. package/tools/backends/compiler-corpus.mjs +2054 -0
  356. package/tools/backends/compiler-debug.mjs +142 -0
  357. package/tools/backends/compiler-matrix.mjs +1955 -0
  358. package/tools/backends/compiler-metadata.mjs +203 -0
  359. package/tools/backends/compiler-package-browser.mjs +120 -0
  360. package/tools/backends/compiler-package-legacy.mjs +654 -0
  361. package/tools/backends/compiler-package.mjs +464 -0
  362. package/tools/backends/compiler-project.mjs +126 -0
  363. package/tools/backends/compiler-session.mjs +843 -0
  364. package/tools/backends/compiler-sha256.mjs +152 -0
  365. package/tools/backends/compiler-unicode-profile-host.mjs +196 -0
  366. package/tools/backends/compiler-worker.mjs +573 -0
  367. package/tools/backends/dist/bootstrap-js-stages.mjs +919 -0
  368. package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -0
  369. package/tools/backends/dist/managed-ir-inventory.mjs +488 -0
  370. package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -0
  371. package/tools/backends/dist/record-grid.mjs +1256 -0
  372. package/tools/backends/dist/record-grid.mjs.map +1 -0
  373. package/tools/backends/dist/release-cli.mjs +462 -0
  374. package/tools/backends/dist/release-cli.mjs.map +1 -0
  375. package/tools/backends/dist/run-artifact.mjs +517 -0
  376. package/tools/backends/dist/run-artifact.mjs.map +1 -0
  377. package/tools/backends/eliscript/compiler-corpus-bit.eli +77 -0
  378. package/tools/backends/eliscript/compiler-corpus-debugging.eli +70 -0
  379. package/tools/backends/eliscript/compiler-corpus-project-entry-host.eli +256 -0
  380. package/tools/backends/managed-foreign-binding.mjs +497 -0
  381. package/tools/backends/managed-host-legacy.mjs +1181 -0
  382. package/tools/backends/managed-host-lifecycle.mjs +310 -0
  383. package/tools/backends/managed-host-object-provider.mjs +155 -0
  384. package/tools/backends/managed-host-object-realm.mjs +797 -0
  385. package/tools/backends/managed-host-proxy.mjs +71 -0
  386. package/tools/backends/managed-host-runtime.mjs +5868 -0
  387. package/tools/backends/managed-host.mjs +716 -0
  388. package/tools/backends/managed-module-graph-legacy.mjs +308 -0
  389. package/tools/backends/managed-module-graph.mjs +694 -0
  390. package/tools/backends/managed-runtime-host-legacy.mjs +195 -0
  391. package/tools/backends/managed-runtime.mjs +939 -0
  392. package/tools/backends/managed-source-view-legacy.mjs +332 -0
  393. package/tools/backends/managed-source-view.mjs +959 -0
  394. package/tools/backends/memory-runtime.mjs +100 -0
  395. package/tools/backends/native-benchmark.mjs +88 -0
  396. package/tools/backends/native-managed-runtime.mjs +677 -0
  397. package/tools/backends/native-memory.mjs +768 -0
  398. package/tools/backends/native-node-memory.mjs +142 -0
  399. package/tools/backends/native-node-runner.mjs +99 -0
  400. package/tools/backends/native-node-watchdog.mjs +19 -0
  401. package/tools/backends/native-node-worker.mjs +75 -0
  402. package/tools/backends/stage3-targets.mjs +493 -0
  403. package/tools/bootstrap-command.el +13 -0
  404. package/tools/bootstrap-runtime.el +101 -0
  405. package/tools/bootstrap-seed.el +55 -0
  406. package/tools/project/check-cli.eli +31 -0
  407. package/tools/project/project-cli.eli +42 -0
  408. package/tools/project/project.eli +122 -0
  409. package/tools/runtime/unicode-case-profiles.mjs +13 -0
  410. package/tools/runtime/unicode-case-runtime.el +57 -0
  411. package/tools/testing/source-debugging-corpus-host.eli +16 -0
  412. package/tools/testing/source-debugging.eli +139 -0
  413. package/tools/testing/stdlib-bit-corpus-host.eli +21 -0
  414. package/tools/testing/stdlib-bit-corpus-host.mjs +118 -0
  415. package/tools/testing/stdlib-bit.eli +104 -0
  416. package/tools/testing/stdlib-bit.mjs +255 -0
  417. package/bin/eliscript-bootstrap +0 -15
@@ -0,0 +1,919 @@
1
+ // Generated by Eliscript. Do not edit.
2
+ import "eliscript/runtime/unicode-case.mjs";
3
+ import { c as __eliscript_at, d as __eliscript_at_direct } from "data:text/javascript;base64,dmFyIG09UmVmbGVjdC5hcHBseSx0dD1OdW1iZXIucHJvdG90eXBlLnZhbHVlT2Ysaj1OdW1iZXIucHJvdG90eXBlL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LG4sZSk7aWYobiE9PWomJm4hPT1LJiZuIT09eiYmbiE9PU0mJm4hPT1OJiZuIT09cyYmbiE9PUUpcmV0dXJuIG87bGV0IGk9bixmPXkoZSwwKSxiPVgoZSwxKSxwPSguLi51KT0+TChpLGYsU3QoYix1KSk7VChwLHB0LHt2YWx1ZToodSk9PnUgaW5zdGFuY2VvZiBpLGNvbmZpZ3VyYWJsZTohMH0pO2xldCByPXMoRSxwLFt2b2lkIDBdKTt1dChyLGZ0KG8pKTtsZXQgbD1hdChvKTtmb3IobGV0IHU9MDt1PGwubGVuZ3RoO3UrKylUKHIsbFt1XSxsdChvLGxbdV0pKTtyZXR1cm4gcn1yZXR1cm4gcyh0LG4sZSl9fWZ1bmN0aW9uIFJ0KHQsbil7bGV0IGU9dFtuXTtyZXR1cm4oLi4ubyk9PkwoZSx0LG8pfWZ1bmN0aW9uIEF0KHQsbiwuLi5lKXtsZXQgbz10W25dO3JldHVybiBMKG8sdCxlKX1leHBvcnR7UnQgYXMgYyxBdCBhcyBkfTs=";
4
+ const __eliscript_truthy = (value) => value !== false && value != null;
5
+ const __eliscript_number_intrinsic = globalThis.Number;
6
+ const __eliscript_bigint_intrinsic = globalThis.BigInt;
7
+ const __eliscript_numeric_apply = globalThis.Reflect.apply;
8
+ const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
9
+ const __eliscript_numeric_error = globalThis.TypeError;
10
+ const __eliscript_numeric_trim = globalThis.String.prototype.trim;
11
+ const __eliscript_numeric_slice = globalThis.String.prototype.slice;
12
+ const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
13
+ const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
14
+ const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
15
+ const __eliscript_numeric_primitive = (value) => {
16
+ if (!__eliscript_numeric_object(value)) return value;
17
+ const exotic = value[__eliscript_numeric_symbol];
18
+ if (exotic !== void 0 && exotic !== null) {
19
+ const result = __eliscript_numeric_apply(exotic, value, ["number"]);
20
+ if (!__eliscript_numeric_object(result)) return result;
21
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
22
+ }
23
+ for (let index = 0; index < 2; index++) {
24
+ const method = value[index === 0 ? "valueOf" : "toString"];
25
+ if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
26
+ const result = __eliscript_numeric_apply(method, value, []);
27
+ if (!__eliscript_numeric_object(result)) return result;
28
+ }
29
+ }
30
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
31
+ };
32
+ const __eliscript_to_number = (value) => {
33
+ const primitive = __eliscript_numeric_primitive(value);
34
+ if (typeof primitive === "string") {
35
+ const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
36
+ if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
37
+ let first = 2;
38
+ while (first < text.length && text[first] === "0") first++;
39
+ if (first === text.length) return 0;
40
+ const prefix = text[1];
41
+ const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
42
+ if (text.length - first > limit) return 1 / 0;
43
+ const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
44
+ return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
45
+ }
46
+ }
47
+ return __eliscript_number_intrinsic(primitive);
48
+ };
49
+ const __eliscript_numeric = (value) => {
50
+ if (typeof value === "number" || typeof value === "bigint") return value;
51
+ const primitive = __eliscript_numeric_primitive(value);
52
+ if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
53
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
54
+ };
55
+ const __eliscript_implicit_number = (value) => {
56
+ if (typeof value === "number") return value;
57
+ const primitive = __eliscript_numeric_primitive(value);
58
+ if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
59
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
60
+ };
61
+ const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
62
+ const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
63
+ const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
64
+ const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
65
+ const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
66
+ const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
67
+ const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
68
+ const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
69
+ const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
70
+ const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
71
+ const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
72
+ const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
73
+ const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
74
+ const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
75
+ const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
76
+ const __eliscript_numeric_relation = (operator, left, right) => {
77
+ if (typeof left === "number" && typeof right === "number") {
78
+ if (operator === "<") return left < right;
79
+ if (operator === "<=") return left <= right;
80
+ if (operator === ">") return left > right;
81
+ return left >= right;
82
+ }
83
+ let a = __eliscript_numeric_primitive(left);
84
+ let b = __eliscript_numeric_primitive(right);
85
+ const x = typeof a, y = typeof b;
86
+ if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
87
+ a = __eliscript_numeric(a);
88
+ b = __eliscript_numeric(b);
89
+ }
90
+ if (operator === "<") return a < b;
91
+ if (operator === "<=") return a <= b;
92
+ if (operator === ">") return a > b;
93
+ return a >= b;
94
+ };
95
+
96
+ import {mkdir, readFile, readdir, lstat, open, symlink, realpath} from "node:fs/promises";
97
+ import {resolve, dirname, relative, isAbsolute, sep} from "node:path";
98
+ import {createHash} from "node:crypto";
99
+ import {isDeepStrictEqual} from "node:util";
100
+ import {root} from "../build.mjs";
101
+ import {loadCompilerSources, buildIndependentCompiler, independentCompilerProductIdentity, writeCompilerMetadata} from "../compiler-build.mjs";
102
+ import {readCompilerMetadata} from "../compiler-metadata.mjs";
103
+ import {compilerSourceIdentity, assertCompilerArtifactSources, archiveCompilerSources, openCompilerArtifact, compilerFailure} from "../compiler-bootstrap.mjs";
104
+ function fail(message) {
105
+ return ((__eliscript_value_1) => { throw __eliscript_value_1; })(new (globalThis.Error)(message));
106
+ }
107
+ function plain(value) {
108
+ return ((!(value == null)) && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "object") && (!__eliscript_truthy(Array.isArray(value))));
109
+ }
110
+ function same(left, right, message) {
111
+ if ((!__eliscript_truthy(isDeepStrictEqual(left, right)))) {
112
+ return fail(message);
113
+ } else {
114
+ return null;
115
+ }
116
+ }
117
+ function ordered(records) {
118
+ return (Array.from(records))["sort"](((left, right) => {
119
+ if (__eliscript_numeric_relation("<", (left)["path"], (right)["path"])) {
120
+ return -1;
121
+ } else {
122
+ if (__eliscript_numeric_relation(">", (left)["path"], (right)["path"])) {
123
+ return 1;
124
+ } else {
125
+ return 0;
126
+ }
127
+ }
128
+ }));
129
+ }
130
+ function portable(base, path) {
131
+ return __eliscript_at_direct((relative(base, path))["split"](sep), "join", "/");
132
+ }
133
+ function safe_path(path) {
134
+ if ((!((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(path) === "string") && __eliscript_numeric_relation(">", ((path) ?? []).length, 0) && (!__eliscript_truthy(isAbsolute(path))) && (!__eliscript_truthy((path)["includes"]("\\"))) && (!__eliscript_truthy(((path)["split"]("/"))["some"](((part) => {
135
+ return ((part === "") || (part === ".") || (part === ".."));
136
+ }))))))) {
137
+ fail("bootstrap product contains an invalid relative path");
138
+ }
139
+ return path;
140
+ }
141
+ function stopped(signal) {
142
+ if (__eliscript_truthy(((__eliscript_value_2) => (__eliscript_truthy(__eliscript_value_2) ? (signal)["aborted"] : __eliscript_value_2))((!(signal == null))))) {
143
+ return ((__eliscript_value_3) => { throw __eliscript_value_3; })((signal)["reason"]);
144
+ } else {
145
+ return null;
146
+ }
147
+ }
148
+ function observe(observer, stage, phase, detail = null) {
149
+ if ((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(observer) === "function")) {
150
+ return (() => {
151
+ try {
152
+ {
153
+ const __eliscript_value_4 = ({"stage": stage, "host": "javascript", "target": "javascript", "phase": phase});
154
+ {
155
+ let event = __eliscript_value_4;
156
+ if ((!(detail == null))) {
157
+ (["count", "moduleCount", "fileCount", "byteLength", "id"])["forEach"](((key) => {
158
+ {
159
+ const __eliscript_value_5 = (detail)[key];
160
+ {
161
+ let value = __eliscript_value_5;
162
+ if (((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "string") || (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "number"))) {
163
+ return ((event)[key] = value);
164
+ } else {
165
+ return null;
166
+ }
167
+ }
168
+ }
169
+ }));
170
+ }
171
+ return observer(Object.freeze(event));
172
+ }
173
+ }
174
+ } catch (ignored) {
175
+ return null;
176
+ }
177
+ })();
178
+ } else {
179
+ return null;
180
+ }
181
+ }
182
+ async function artifact(metadata_path) {
183
+ if ((!(((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(metadata_path) === "string"))) {
184
+ ((__eliscript_value_6) => { throw __eliscript_value_6; })(new (globalThis.TypeError)("compiler metadata path is required"));
185
+ }
186
+ return (await (async (path) => {
187
+ return ((record) => {
188
+ return (() => {
189
+ if ((!__eliscript_truthy(plain(record)))) {
190
+ fail("compiler artifact metadata must be an object");
191
+ }
192
+ ((record)["directory"] = dirname(path));
193
+ ((record)["metadataPath"] = path);
194
+ if ((!(((record)["host"] === "javascript") && ((record)["target"] === "javascript")))) {
195
+ fail("JavaScript bootstrap requires a JavaScript compiler artifact");
196
+ }
197
+ return record;
198
+ })();
199
+ })(await (readCompilerMetadata(path)));
200
+ })(resolve(metadata_path)));
201
+ }
202
+ async function regular_file(base, path) {
203
+ safe_path(path);
204
+ (await (async (parts, current, index) => {
205
+ return (await (async () => {
206
+ while (__eliscript_numeric_relation("<", index, ((parts) ?? []).length)) {
207
+ ((current = resolve(current, (parts)[index])));
208
+ ((stat) => {
209
+ if ((!__eliscript_truthy(((index === __eliscript_numeric_decrement(((parts) ?? []).length)) ? (stat)["isFile"]() : (stat)["isDirectory"]())))) {
210
+ return fail(("bootstrap product contains a nonregular entry: " + path));
211
+ } else {
212
+ return null;
213
+ }
214
+ })(await (lstat(current)));
215
+ ((index = (index + 1)));
216
+ }
217
+ return null;
218
+ })());
219
+ })((path)["split"]("/"), base, 0));
220
+ return resolve(base, path);
221
+ }
222
+ async function file_digest(path) {
223
+ return (await (async (file, hash, buffer, bytes, failed, done) => {
224
+ return (await (async () => {
225
+ try {
226
+ (await (async () => {
227
+ while ((!__eliscript_truthy(done))) {
228
+ ((count) => {
229
+ if ((count === 0)) {
230
+ return ((done = true));
231
+ } else {
232
+ (hash)["update"]((buffer)["subarray"](0, count));
233
+ return ((bytes = (bytes + count)));
234
+ }
235
+ })((await ((file)["read"](buffer, 0, ((buffer) ?? []).length, null)))["bytesRead"]);
236
+ }
237
+ return null;
238
+ })());
239
+ return ({"bytes": bytes, "sha256": (hash)["digest"]("hex")});
240
+ } catch (error) {
241
+ ((failed = true));
242
+ return ((__eliscript_value_7) => { throw __eliscript_value_7; })(error);
243
+ } finally {
244
+ (await (async () => {
245
+ try {
246
+ return await ((file)["close"]());
247
+ } catch (error) {
248
+ if ((!__eliscript_truthy(failed))) {
249
+ return ((__eliscript_value_8) => { throw __eliscript_value_8; })(error);
250
+ } else {
251
+ return null;
252
+ }
253
+ }
254
+ })());
255
+ }
256
+ })());
257
+ })(await (open(path, "r")), createHash("sha256"), new (globalThis.Uint8Array)(65536), 0, false, false));
258
+ }
259
+ async function product_paths(directory, prefix) {
260
+ return (await (async (entries, paths, index) => {
261
+ (await (async () => {
262
+ while (__eliscript_numeric_relation("<", index, ((entries) ?? []).length)) {
263
+ (await (async (entry) => {
264
+ return (await (async (name) => {
265
+ return (await (async (path) => {
266
+ return ((!((path === "compiler-artifact.json") || (path === "ir/runtime-checkpoint.json"))) ? (__eliscript_truthy((entry)["isDirectory"]()) ? ((paths = (paths)["concat"](await (product_paths(directory, path))))) : (__eliscript_truthy((entry)["isFile"]()) ? (paths)["push"](path) : fail(("bootstrap product contains a nonregular entry: " + path)))) : null);
267
+ })(((prefix === "") ? name : (prefix + "/" + name))));
268
+ })((entry)["name"]));
269
+ })((entries)[index]));
270
+ ((index = (index + 1)));
271
+ }
272
+ return null;
273
+ })());
274
+ return (paths)["sort"]();
275
+ })(await (readdir(resolve(directory, prefix), ({"withFileTypes": true}))), [], 0));
276
+ }
277
+ async function verify_product(value, strict_inventory) {
278
+ return (await (async (identity) => {
279
+ return (await (async (records) => {
280
+ return (await (async (seen) => {
281
+ return (await (async (files) => {
282
+ return (await (async (index) => {
283
+ return (await (async () => {
284
+ if ((!__eliscript_truthy(((__eliscript_value_9) => (__eliscript_truthy(__eliscript_value_9) ? ((__eliscript_value_10) => (__eliscript_truthy(__eliscript_value_10) ? __eliscript_numeric_relation(">", ((records) ?? []).length, 0) : __eliscript_value_10))(Array.isArray(records)) : __eliscript_value_9))(((identity)["algorithm"] === "sha256"))))) {
285
+ fail("compiler artifact has no complete emitted file identity");
286
+ }
287
+ (await (async () => {
288
+ while (__eliscript_numeric_relation("<", index, ((records) ?? []).length)) {
289
+ (await (async (record) => {
290
+ return (await (async (path) => {
291
+ return (await (async () => {
292
+ if (__eliscript_truthy((seen)["has"](path))) {
293
+ fail("compiler artifact repeats an emitted file");
294
+ }
295
+ (seen)["add"](path);
296
+ return ((actual) => {
297
+ return ((expected) => {
298
+ return (() => {
299
+ same(actual, expected, ("compiler artifact changed after emission: " + path));
300
+ return (files)["push"](({"path": path, "bytes": (actual)["bytes"], "sha256": (actual)["sha256"]}));
301
+ })();
302
+ })(({"bytes": (record)["bytes"], "sha256": (record)["sha256"]}));
303
+ })(await (file_digest(await (regular_file((value)["directory"], path)))));
304
+ })());
305
+ })(safe_path((record)["path"])));
306
+ })((records)[index]));
307
+ ((index = (index + 1)));
308
+ }
309
+ return null;
310
+ })());
311
+ if ((!__eliscript_truthy((seen)["has"](safe_path((value)["path"]))))) {
312
+ fail("compiler entry is absent from product files");
313
+ }
314
+ if ((!__eliscript_truthy(((__eliscript_value_11) => (__eliscript_truthy(__eliscript_value_11) ? __eliscript_numeric_relation(">", (((value)["modules"]) ?? []).length, 0) : __eliscript_value_11))(Array.isArray((value)["modules"]))))) {
315
+ fail("compiler artifact has no JavaScript module graph");
316
+ }
317
+ {
318
+ const __eliscript_value_12 = new (globalThis.Set)();
319
+ {
320
+ let ids = __eliscript_value_12;
321
+ ((value)["modules"])["forEach"](((record) => {
322
+ if (__eliscript_truthy(((__eliscript_value_13) => (__eliscript_truthy(__eliscript_value_13) ? __eliscript_value_13 : (!__eliscript_truthy((seen)["has"]((record)["path"])))))((ids)["has"]((record)["id"])))) {
323
+ fail("compiler JavaScript module graph is incomplete or repeated");
324
+ }
325
+ (ids)["add"]((record)["id"]);
326
+ return (["sourceMapPath", "macroOriginsPath"])["forEach"](((key) => {
327
+ if (__eliscript_truthy(Object.hasOwn(record, key))) {
328
+ if ((!__eliscript_truthy((seen)["has"]((record)[key])))) {
329
+ return fail("compiler map or macro origins are undeclared");
330
+ } else {
331
+ return null;
332
+ }
333
+ } else {
334
+ return null;
335
+ }
336
+ }));
337
+ }));
338
+ }
339
+ }
340
+ (__eliscript_truthy(strict_inventory) ? same(await (product_paths((value)["directory"], "")), (Array.from(seen))["sort"](), "compiler artifact contains extra or missing product files") : null);
341
+ same(independentCompilerProductIdentity(({"host": "javascript", "files": files})), (value)["productIdentity"], "compiler product identity differs from its actual files");
342
+ return ordered(files);
343
+ })());
344
+ })(0));
345
+ })([]));
346
+ })(new (globalThis.Set)()));
347
+ })((identity)["files"]));
348
+ })((value)["artifactIdentity"]));
349
+ }
350
+ function source_record(item) {
351
+ return ({"id": (item)["id"], "filename": (item)["filename"], "sha256": (item)["sha256"]});
352
+ }
353
+ function source_order(items) {
354
+ return (Array.from(items))["sort"](((left, right) => {
355
+ if (__eliscript_numeric_relation("<", (left)["id"], (right)["id"])) {
356
+ return -1;
357
+ } else {
358
+ if (__eliscript_numeric_relation(">", (left)["id"], (right)["id"])) {
359
+ return 1;
360
+ } else {
361
+ return 0;
362
+ }
363
+ }
364
+ }));
365
+ }
366
+ function bind_sources(value, identity) {
367
+ if ((!__eliscript_truthy(((__eliscript_value_14) => (__eliscript_truthy(__eliscript_value_14) ? ((__eliscript_value_15) => (__eliscript_truthy(__eliscript_value_15) ? ((__eliscript_value_16) => (__eliscript_truthy(__eliscript_value_16) ? ((__eliscript_value_17) => (__eliscript_truthy(__eliscript_value_17) ? plain((identity)["runtime"]) : __eliscript_value_17))(Array.isArray((identity)["modules"])) : __eliscript_value_16))((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })((identity)["sha256"]) === "string")) : __eliscript_value_15))(((identity)["encoding"] === "utf16le")) : __eliscript_value_14))(plain(identity))))) {
368
+ fail("complete bootstrap source identity is required");
369
+ }
370
+ {
371
+ const __eliscript_value_18 = ({});
372
+ {
373
+ let body = __eliscript_value_18;
374
+ (Object.keys(identity))["forEach"](((key) => {
375
+ if ((!(key === "sha256"))) {
376
+ return ((body)[key] = (identity)[key]);
377
+ } else {
378
+ return null;
379
+ }
380
+ }));
381
+ same((identity)["sha256"], ((createHash("sha256"))["update"](JSON.stringify(body), "utf16le"))["digest"]("hex"), "bootstrap source identity has an invalid digest");
382
+ }
383
+ }
384
+ {
385
+ const __eliscript_value_19 = (value)["sourceIdentity"];
386
+ {
387
+ let actual = __eliscript_value_19;
388
+ if ((!(((actual)["algorithm"] === "sha256") && ((actual)["encoding"] === "utf16le") && ((value)["entry"] === (identity)["entry"])))) {
389
+ fail("compiler artifact has no complete UTF-16 source identity");
390
+ }
391
+ same(source_order((actual)["modules"]), source_order(((identity)["modules"])["map"](source_record)), "compiler source modules differ");
392
+ same((actual)["runtime"], ({"filename": ((identity)["runtime"])["filename"], "sha256": ((identity)["runtime"])["sha256"]}), "compiler runtime source differs");
393
+ (["literalSources", "hostSources"])["forEach"](((key) => {
394
+ if (__eliscript_truthy(Object.hasOwn(identity, key))) {
395
+ return same(source_order((actual)[key]), source_order(((identity)[key])["map"](source_record)), ("compiler " + key + " source inventory differs"));
396
+ } else {
397
+ if (__eliscript_truthy(Object.hasOwn(actual, key))) {
398
+ return fail("compiler artifact contains undeclared source assets");
399
+ } else {
400
+ return null;
401
+ }
402
+ }
403
+ }));
404
+ }
405
+ }
406
+ return value;
407
+ }
408
+ async function exact_bytes(left_path, right_path) {
409
+ return (await (async (left, right, failed, a, b, position, done) => {
410
+ return (await (async () => {
411
+ try {
412
+ ((right = await (open(right_path, "r"))));
413
+ return (await (async () => {
414
+ while ((!__eliscript_truthy(done))) {
415
+ (await (async (counts, which) => {
416
+ (await (async () => {
417
+ while (__eliscript_numeric_relation("<", which, 2)) {
418
+ (await (async (file, buffer, count, eof) => {
419
+ (await (async () => {
420
+ while ((__eliscript_numeric_relation("<", count, ((buffer) ?? []).length) && (!__eliscript_truthy(eof)))) {
421
+ ((read) => {
422
+ if ((read === 0)) {
423
+ return ((eof = true));
424
+ } else {
425
+ return ((count = (count + read)));
426
+ }
427
+ })((await ((file)["read"](buffer, count, __eliscript_numeric_sub(((buffer) ?? []).length, count), (position + count))))["bytesRead"]);
428
+ }
429
+ return null;
430
+ })());
431
+ return ((counts)[which] = count);
432
+ })(((which === 0) ? left : right), ((which === 0) ? a : b), 0, false));
433
+ ((which = (which + 1)));
434
+ }
435
+ return null;
436
+ })());
437
+ if ((!((counts)[0] === (counts)[1]))) {
438
+ fail("JavaScript fixed point has different file lengths");
439
+ }
440
+ {
441
+ const __eliscript_value_20 = 0;
442
+ const __eliscript_value_21 = (counts)[0];
443
+ {
444
+ let index = __eliscript_value_20;
445
+ let count = __eliscript_value_21;
446
+ while (__eliscript_numeric_relation("<", index, count)) {
447
+ if ((!((a)[index] === (b)[index]))) {
448
+ fail("JavaScript fixed point has different original bytes");
449
+ }
450
+ ((index = (index + 1)));
451
+ }
452
+ ((position = (position + count)));
453
+ if ((count === 0)) {
454
+ return ((done = true));
455
+ } else {
456
+ return null;
457
+ }
458
+ }
459
+ }
460
+ })([0, 0], 0));
461
+ }
462
+ return null;
463
+ })());
464
+ } catch (error) {
465
+ ((failed = true));
466
+ return ((__eliscript_value_22) => { throw __eliscript_value_22; })(error);
467
+ } finally {
468
+ (await (async (close_failed, close_error) => {
469
+ (await (async () => {
470
+ try {
471
+ return await ((left)["close"]());
472
+ } catch (error) {
473
+ return ((close_failed = true), (close_error = error));
474
+ }
475
+ })());
476
+ (__eliscript_truthy(right) ? (await (async () => {
477
+ try {
478
+ return await ((right)["close"]());
479
+ } catch (error) {
480
+ if ((!__eliscript_truthy(close_failed))) {
481
+ return ((close_failed = true), (close_error = error));
482
+ } else {
483
+ return null;
484
+ }
485
+ }
486
+ })()) : null);
487
+ if (__eliscript_truthy(((__eliscript_value_23) => (__eliscript_truthy(__eliscript_value_23) ? (!__eliscript_truthy(failed)) : __eliscript_value_23))(close_failed))) {
488
+ return ((__eliscript_value_24) => { throw __eliscript_value_24; })(close_error);
489
+ } else {
490
+ return null;
491
+ }
492
+ })(false, undefined));
493
+ }
494
+ })());
495
+ })(await (open(left_path, "r")), null, false, new (globalThis.Uint8Array)(65536), new (globalThis.Uint8Array)(65536), 0, false));
496
+ }
497
+ async function compareJsFixedPoint(input) {
498
+ if ((!__eliscript_truthy(plain(input)))) {
499
+ ((__eliscript_value_25) => { throw __eliscript_value_25; })(new (globalThis.TypeError)("fixed point options are required"));
500
+ }
501
+ return (await (async (identity) => {
502
+ return (await (async (second) => {
503
+ return (await (async (third) => {
504
+ return (await (async (files) => {
505
+ return (await (async (other) => {
506
+ return (await (async (index) => {
507
+ return (await (async () => {
508
+ bind_sources(second, identity);
509
+ bind_sources(third, identity);
510
+ (["profile", "budget", "memory", "auto", "debugEnabled", "capabilities"])["forEach"](((key) => {
511
+ return same((second)[key], (third)[key], ("JavaScript fixed point configuration differs: " + key));
512
+ }));
513
+ ((files = await (verify_product(second, true))), (other = await (verify_product(third, true))));
514
+ same(files, other, "JavaScript fixed point has a different complete file inventory");
515
+ same((second)["productIdentity"], (third)["productIdentity"], "JavaScript fixed point product identities differ");
516
+ (await (async () => {
517
+ while (__eliscript_numeric_relation("<", index, ((files) ?? []).length)) {
518
+ (await (async (path) => {
519
+ return await (exact_bytes(resolve((second)["directory"], path), resolve((third)["directory"], path)));
520
+ })(((files)[index])["path"]));
521
+ ((index = (index + 1)));
522
+ }
523
+ return null;
524
+ })());
525
+ return ({"format": "eliscript-js-fixed-point", "version": 1, "status": "identical", "from": 2, "to": 3, "sourceIdentity": identity, "stage2ProductIdentity": (second)["productIdentity"], "stage3ProductIdentity": (third)["productIdentity"], "files": files});
526
+ })());
527
+ })(0));
528
+ })(null));
529
+ })(null));
530
+ })(await (artifact((input)["stage3"]))));
531
+ })(await (artifact((input)["stage2"]))));
532
+ })((input)["sourceIdentity"]));
533
+ }
534
+ async function verify_seed(receipt, source_root, sources) {
535
+ if ((!(((receipt)["format"] === "eliscript-js-stage0") && ((receipt)["version"] === 1) && ((receipt)["status"] === "built") && ((receipt)["host"] === "javascript") && ((receipt)["target"] === "javascript") && ((receipt)["producer"] === "emacs-lisp")))) {
536
+ fail("stage0 must be an authentic completed Emacs Lisp bootstrap");
537
+ }
538
+ same((receipt)["formalSourceIdentity"], compilerSourceIdentity(sources), "stage0 formal source identity differs");
539
+ return (await (async (records) => {
540
+ return (await (async (names) => {
541
+ return (await (async (expected) => {
542
+ return (await (async (index) => {
543
+ return (await (async () => {
544
+ if ((!__eliscript_truthy(Array.isArray(records)))) {
545
+ fail("stage0 has no maintained Emacs source identity");
546
+ }
547
+ same((records)["map"](((record) => {
548
+ return (record)["path"];
549
+ })), expected, "stage0 seed source inventory differs");
550
+ return (await (async () => {
551
+ while (__eliscript_numeric_relation("<", index, ((records) ?? []).length)) {
552
+ (await (async (record) => {
553
+ return ((actual) => {
554
+ return same(actual, ({"bytes": (record)["bytes"], "sha256": (record)["sha256"]}), ("stage0 seed source changed: " + (record)["path"]));
555
+ })(await (file_digest(await (regular_file(source_root, (record)["path"])))));
556
+ })((records)[index]));
557
+ ((index = (index + 1)));
558
+ }
559
+ return null;
560
+ })());
561
+ })());
562
+ })(0));
563
+ })((["tools/backends/bootstrap.el", "tools/runtime/unicode-case-runtime.el"])["concat"](((names)["sort"]())["map"](((name) => {
564
+ return ("compiler/" + name);
565
+ })))));
566
+ })((await (readdir(resolve(source_root, "compiler"))))["filter"](((name) => {
567
+ return (name)["endsWith"](".el");
568
+ }))));
569
+ })((receipt)["seedSourceIdentity"]));
570
+ }
571
+ async function install_runtime_package(source_root, directory) {
572
+ return (await (async (candidate, package$) => {
573
+ (await (async () => {
574
+ try {
575
+ return await (lstat(resolve(source_root, "package.json")));
576
+ } catch (error) {
577
+ return (((error)["code"] === "ENOENT") ? ((package$ = await (realpath(candidate)))) : ((__eliscript_value_26) => { throw __eliscript_value_26; })(error));
578
+ }
579
+ })());
580
+ await (mkdir(resolve(directory, "node_modules"), ({"recursive": true})));
581
+ return (await (async (link) => {
582
+ return (await (async () => {
583
+ try {
584
+ return await (symlink(package$, link, "dir"));
585
+ } catch (error) {
586
+ if ((!((error)["code"] === "EEXIST"))) {
587
+ ((__eliscript_value_27) => { throw __eliscript_value_27; })(error);
588
+ }
589
+ return same(await (realpath(link)), await (realpath(package$)), "bootstrap runtime package resolves to a different source");
590
+ }
591
+ })());
592
+ })(resolve(directory, "node_modules/eliscript")));
593
+ })(resolve(source_root, "node_modules/eliscript"), source_root));
594
+ }
595
+ async function reuse_completed(path, identity, seed, initial_path, sources, signal, observer) {
596
+ return (await (async (record) => {
597
+ (await (async () => {
598
+ try {
599
+ return ((record = await (readCompilerMetadata(path))));
600
+ } catch (error) {
601
+ if ((!((error)["code"] === "ENOENT"))) {
602
+ return ((__eliscript_value_28) => { throw __eliscript_value_28; })(error);
603
+ } else {
604
+ return null;
605
+ }
606
+ }
607
+ })());
608
+ return ((record === undefined) ? null : (await (async (base, stages, index, last) => {
609
+ if ((!__eliscript_truthy(((__eliscript_value_29) => (__eliscript_truthy(__eliscript_value_29) ? ((__eliscript_value_30) => (__eliscript_truthy(__eliscript_value_30) ? ((__eliscript_value_31) => (__eliscript_truthy(__eliscript_value_31) ? ((__eliscript_value_32) => (__eliscript_truthy(__eliscript_value_32) ? (((stages) ?? []).length === 4) : __eliscript_value_32))(Array.isArray(stages)) : __eliscript_value_31))(((record)["status"] === "accepted")) : __eliscript_value_30))(((record)["version"] === 1)) : __eliscript_value_29))(((record)["format"] === "eliscript-js-bootstrap"))))) {
610
+ fail("bootstrap output already contains an incomplete or failed invocation; preserve it and use a new outputRoot");
611
+ }
612
+ same((record)["formalSourceIdentity"], identity, "completed bootstrap source identity changed");
613
+ same((record)["seedSourceIdentity"], seed, "completed bootstrap seed identity changed");
614
+ same((record)["configuration"], ({"host": "javascript", "target": "javascript", "profile": "full-compiler", "retainIR": true, "debug": true}), "completed bootstrap configuration changed");
615
+ same(await (realpath(resolve(base, ((stages)[0])["metadataPath"]))), await (realpath(initial_path)), "completed bootstrap uses a different stage0");
616
+ (await (async () => {
617
+ while (__eliscript_numeric_relation("<", index, 4)) {
618
+ stopped(signal);
619
+ (await (async (stage) => {
620
+ return (await (async (value) => {
621
+ return (await (async () => {
622
+ if ((!(((stage)["stage"] === index) && ((stage)["host"] === "javascript") && ((stage)["target"] === "javascript") && ((stage)["status"] === "built") && ((stage)["producer"] === ((index === 0) ? "emacs-lisp" : ("stage" + __eliscript_numeric_decrement(index))))))) {
623
+ fail("completed bootstrap stage provenance changed");
624
+ }
625
+ same((stage)["inputIdentity"], identity, "completed bootstrap stage input changed");
626
+ assertCompilerArtifactSources(value, sources);
627
+ await (verify_product(value, __eliscript_numeric_relation(">", index, 0)));
628
+ same((stage)["productIdentity"], (value)["productIdentity"], "completed bootstrap stage product changed");
629
+ if (__eliscript_numeric_relation(">", index, 0)) {
630
+ if ((!((((value)["provenance"])["mode"] === "session") && (((value)["provenance"])["producerHost"] === "javascript")))) {
631
+ fail("completed bootstrap stage has an invalid producer");
632
+ }
633
+ }
634
+ return ((last = value));
635
+ })());
636
+ })(await (artifact(resolve(base, (stage)["metadataPath"])))));
637
+ })((stages)[index]));
638
+ ((index = (index + 1)));
639
+ }
640
+ return null;
641
+ })());
642
+ if ((!((((record)["fixedPoint"])["from"] === 2) && (((record)["fixedPoint"])["to"] === 3) && (((record)["fixedPoint"])["status"] === "identical")))) {
643
+ fail("completed bootstrap has no stage2-stage3 fixed point");
644
+ }
645
+ (await (async (actual) => {
646
+ return ((saved) => {
647
+ return same(actual, saved, "completed bootstrap fixed-point receipt changed");
648
+ })(await (readCompilerMetadata(resolve(base, ((record)["fixedPoint"])["comparisonPath"]))));
649
+ })(await (compareJsFixedPoint(({"stage2": resolve(base, ((stages)[2])["metadataPath"]), "stage3": (last)["metadataPath"], "sourceIdentity": identity})))));
650
+ observe(observer, 3, "candidate-reuse-initialize");
651
+ (await (async (session, failed) => {
652
+ return (await (async () => {
653
+ try {
654
+ return ((!((await ((session)["request"](({"operation": "capabilities"}), ({"signal": signal}))))["format"] === "eliscript-compiler-capabilities")) ? fail("completed stage3 returned invalid capabilities") : null);
655
+ } catch (error) {
656
+ ((failed = true));
657
+ return ((__eliscript_value_33) => { throw __eliscript_value_33; })(error);
658
+ } finally {
659
+ (await (async () => {
660
+ try {
661
+ return await ((session)["close"]());
662
+ } catch (error) {
663
+ if ((!__eliscript_truthy(failed))) {
664
+ return ((__eliscript_value_34) => { throw __eliscript_value_34; })(error);
665
+ } else {
666
+ return null;
667
+ }
668
+ }
669
+ })());
670
+ }
671
+ })());
672
+ })(await (openCompilerArtifact(last)), false));
673
+ return ({"manifestPath": path, "stage3MetadataPath": (last)["metadataPath"]});
674
+ })(dirname(path), (record)["stages"], 0, null)));
675
+ })(undefined));
676
+ }
677
+ async function bootstrapJsStages(input) {
678
+ if ((!__eliscript_truthy(plain(input)))) {
679
+ ((__eliscript_value_35) => { throw __eliscript_value_35; })(new (globalThis.TypeError)("JavaScript bootstrap options are required"));
680
+ }
681
+ return (await (async (stage0_path) => {
682
+ return (await (async (source_root) => {
683
+ return (await (async (output_root) => {
684
+ return (await (async (signal) => {
685
+ return (await (async (observer) => {
686
+ return (await (async () => {
687
+ if ((!((((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(stage0_path) === "string") && (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(output_root) === "string")))) {
688
+ ((__eliscript_value_36) => { throw __eliscript_value_36; })(new (globalThis.TypeError)("stage0ManifestPath and outputRoot are required"));
689
+ }
690
+ if ((!((observer === undefined) || (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(observer) === "function")))) {
691
+ ((__eliscript_value_37) => { throw __eliscript_value_37; })(new (globalThis.TypeError)("bootstrap stage observer must be a function"));
692
+ }
693
+ if ((source_root == null)) {
694
+ ((source_root = root));
695
+ }
696
+ ((source_root = resolve(source_root)), (stage0_path = resolve(stage0_path)), (output_root = resolve(output_root)));
697
+ stopped(signal);
698
+ observe(observer, 0, "sources-start");
699
+ return (await (async (sources) => {
700
+ return (await (async (identity) => {
701
+ return (await (async (receipt) => {
702
+ return (await (async (initial_path) => {
703
+ return (await (async (initial) => {
704
+ return (await (async (manifest_path) => {
705
+ return (await (async (record) => {
706
+ return (await (async (previous) => {
707
+ return (await (async (previous_path) => {
708
+ return (await (async (index) => {
709
+ return (await (async (active) => {
710
+ return (await (async (current) => {
711
+ return (await (async (failed) => {
712
+ return (await (async (primary) => {
713
+ return (await (async (reused) => {
714
+ return (await (async () => {
715
+ await (verify_seed(receipt, source_root, sources));
716
+ assertCompilerArtifactSources(initial, sources);
717
+ if ((!(((initial)["provenance"])["mode"] === "emacs-lisp"))) {
718
+ fail("stage0 compiler provenance differs");
719
+ }
720
+ await (verify_product(initial, false));
721
+ same((receipt)["productIdentity"], (initial)["productIdentity"], "stage0 product identity differs");
722
+ ((reused = await (reuse_completed(manifest_path, identity, (receipt)["seedSourceIdentity"], initial_path, sources, signal, observer))));
723
+ return (__eliscript_truthy(reused) ? reused : (await (async () => {
724
+ ((sources)["modules"])["forEach"](Object.freeze);
725
+ ((sources)["literalSources"])["forEach"](Object.freeze);
726
+ Object.freeze((sources)["modules"]);
727
+ Object.freeze((sources)["literalSources"]);
728
+ Object.freeze((sources)["runtime"]);
729
+ Object.freeze(sources);
730
+ await (mkdir(output_root, ({"recursive": true})));
731
+ await (install_runtime_package(source_root, output_root));
732
+ await (archiveCompilerSources(sources, resolve(output_root, "sources")));
733
+ ((record)["stages"])["push"](({"stage": 0, "host": "javascript", "target": "javascript", "producer": "emacs-lisp", "status": "built", "metadataPath": portable(output_root, initial_path), "inputIdentity": identity, "productIdentity": (initial)["productIdentity"]}));
734
+ while (__eliscript_numeric_relation("<=", index, 3)) {
735
+ ((record)["stages"])["push"](({"stage": index, "host": "javascript", "target": "javascript", "producer": ("stage" + __eliscript_numeric_decrement(index)), "status": "pending", "metadataPath": null, "inputIdentity": identity, "productIdentity": null}));
736
+ ((index = (index + 1)));
737
+ }
738
+ ((index = 1));
739
+ await (writeCompilerMetadata(manifest_path, record));
740
+ return (await (async () => {
741
+ try {
742
+ ((record)["status"] = "building");
743
+ (await (async () => {
744
+ while (__eliscript_numeric_relation("<=", index, 3)) {
745
+ stopped(signal);
746
+ ((current = ((record)["stages"])[index]));
747
+ ((current)["status"] = "building");
748
+ await (writeCompilerMetadata(manifest_path, record));
749
+ observe(observer, index, "producer-open");
750
+ ((active = await (openCompilerArtifact(previous))));
751
+ (await (async (stage_failed, stage_error, next) => {
752
+ (await (async () => {
753
+ try {
754
+ same((active)["host"], "javascript", "bootstrap producer changed its host");
755
+ stopped(signal);
756
+ observe(observer, index, "capabilities-start");
757
+ ((!((await ((active)["request"](({"operation": "capabilities"}), ({"signal": signal}))))["format"] === "eliscript-compiler-capabilities")) ? fail("bootstrap producer returned invalid capabilities") : null);
758
+ observe(observer, index, "capabilities-complete");
759
+ ((next = await (buildIndependentCompiler(({"host": "javascript", "session": active, "sourceRoot": source_root, "sources": sources, "outputRoot": resolve(output_root, ("stage" + index)), "profile": "full-compiler", "retainIR": true, "debug": true, "signal": signal, "onPhase": ((phase, detail) => {
760
+ return observe(observer, index, phase, detail);
761
+ })})))));
762
+ assertCompilerArtifactSources(next, sources);
763
+ if ((!((((next)["provenance"])["mode"] === "session") && (((next)["provenance"])["producerHost"] === "javascript")))) {
764
+ fail("bootstrap successor was not compiled by the active JavaScript producer");
765
+ }
766
+ same(((next)["provenance"])["compiledModuleIds"], ((sources)["modules"])["map"](((item) => {
767
+ return (item)["id"];
768
+ })), "bootstrap omitted formal source modules");
769
+ ((next = await (artifact((next)["metadataPath"]))));
770
+ await (verify_product(next, true));
771
+ ((current)["metadataPath"] = portable(output_root, (next)["metadataPath"]));
772
+ return ((current)["productIdentity"] = (next)["productIdentity"]);
773
+ } catch (error) {
774
+ return ((stage_failed = true), (stage_error = error));
775
+ } finally {
776
+ observe(observer, index, "producer-close-start");
777
+ (await (async () => {
778
+ try {
779
+ return await ((active)["close"]());
780
+ } catch (error) {
781
+ ((current)["closeError"] = compilerFailure(error));
782
+ if ((!__eliscript_truthy(stage_failed))) {
783
+ return ((stage_failed = true), (stage_error = error));
784
+ } else {
785
+ return null;
786
+ }
787
+ }
788
+ })());
789
+ ((active = null));
790
+ observe(observer, index, "producer-close-complete");
791
+ }
792
+ })());
793
+ if (__eliscript_truthy(stage_failed)) {
794
+ ((__eliscript_value_38) => { throw __eliscript_value_38; })(stage_error);
795
+ }
796
+ ((current)["status"] = "built");
797
+ ((previous = next), (previous_path = (next)["metadataPath"]));
798
+ await (writeCompilerMetadata(manifest_path, record));
799
+ observe(observer, index, "stage-complete");
800
+ return ((index = (index + 1)));
801
+ })(false, undefined, null));
802
+ }
803
+ return null;
804
+ })());
805
+ stopped(signal);
806
+ observe(observer, 3, "candidate-initialize");
807
+ ((active = await (openCompilerArtifact(previous))));
808
+ (await (async (initialization_failed, initialization_error) => {
809
+ (await (async () => {
810
+ try {
811
+ return ((!((await ((active)["request"](({"operation": "capabilities"}), ({"signal": signal}))))["format"] === "eliscript-compiler-capabilities")) ? fail("stage3 returned invalid capabilities") : null);
812
+ } catch (error) {
813
+ return ((initialization_failed = true), (initialization_error = error));
814
+ } finally {
815
+ (await (async () => {
816
+ try {
817
+ return await ((active)["close"]());
818
+ } catch (error) {
819
+ ((current)["closeError"] = compilerFailure(error));
820
+ if ((!__eliscript_truthy(initialization_failed))) {
821
+ return ((initialization_failed = true), (initialization_error = error));
822
+ } else {
823
+ return null;
824
+ }
825
+ }
826
+ })());
827
+ ((active = null));
828
+ }
829
+ })());
830
+ if (__eliscript_truthy(initialization_failed)) {
831
+ return ((__eliscript_value_39) => { throw __eliscript_value_39; })(initialization_error);
832
+ } else {
833
+ return null;
834
+ }
835
+ })(false, undefined));
836
+ observe(observer, 3, "fixed-point-start");
837
+ (await (async (second) => {
838
+ return (await (async (comparison) => {
839
+ return (await (async (path) => {
840
+ return (await (async () => {
841
+ await (writeCompilerMetadata(path, comparison));
842
+ return ((record)["fixedPoint"] = ({"from": 2, "to": 3, "status": "identical", "comparisonPath": portable(output_root, path)}));
843
+ })());
844
+ })(resolve(output_root, "fixed-point.json")));
845
+ })(await (compareJsFixedPoint(({"stage2": resolve(output_root, (second)["metadataPath"]), "stage3": previous_path, "sourceIdentity": identity})))));
846
+ })(((record)["stages"])[2]));
847
+ ((record)["status"] = "accepted");
848
+ await (writeCompilerMetadata(manifest_path, record));
849
+ observe(observer, 3, "fixed-point-complete");
850
+ return ({"manifestPath": manifest_path, "stage3MetadataPath": previous_path});
851
+ } catch (error) {
852
+ ((failed = true), (primary = error));
853
+ {
854
+ const __eliscript_value_40 = ((__eliscript_value_41) => (__eliscript_truthy(__eliscript_value_41) ? (signal)["aborted"] : __eliscript_value_41))((!(signal == null)));
855
+ {
856
+ let cancelled = __eliscript_value_40;
857
+ ((record)["status"] = (__eliscript_truthy(cancelled) ? "cancelled" : "failed"));
858
+ if (__eliscript_truthy(current)) {
859
+ ((current)["status"] = (__eliscript_truthy(cancelled) ? "cancelled" : "failed"));
860
+ ((current)["error"] = compilerFailure(error));
861
+ }
862
+ ((record)["error"] = compilerFailure(error));
863
+ if (__eliscript_numeric_relation(">", index, 3)) {
864
+ (((record)["fixedPoint"])["status"] = "failed");
865
+ }
866
+ }
867
+ }
868
+ (await (async () => {
869
+ try {
870
+ return await (writeCompilerMetadata(manifest_path, record));
871
+ } catch (ignored) {
872
+ return null;
873
+ }
874
+ })());
875
+ return ((__eliscript_value_42) => { throw __eliscript_value_42; })(error);
876
+ } finally {
877
+ (__eliscript_truthy(active) ? (await (async () => {
878
+ (await (async () => {
879
+ try {
880
+ return await ((active)["close"]());
881
+ } catch (error) {
882
+ if ((!__eliscript_truthy(failed))) {
883
+ return ((__eliscript_value_43) => { throw __eliscript_value_43; })(error);
884
+ } else {
885
+ return null;
886
+ }
887
+ }
888
+ })());
889
+ return ((active = null));
890
+ })()) : null);
891
+ ((previous = null), (sources = null));
892
+ }
893
+ })());
894
+ })()));
895
+ })());
896
+ })(null));
897
+ })(undefined));
898
+ })(false));
899
+ })(null));
900
+ })(null));
901
+ })(1));
902
+ })(initial_path));
903
+ })(initial));
904
+ })(({"format": "eliscript-js-bootstrap", "version": 1, "status": "created", "seedSourceIdentity": (receipt)["seedSourceIdentity"], "formalSourceIdentity": identity, "configuration": ({"host": "javascript", "target": "javascript", "profile": "full-compiler", "retainIR": true, "debug": true}), "stages": [], "fixedPoint": ({"from": 2, "to": 3, "status": "pending", "comparisonPath": null}), "finalAcceptance": ({"status": "pending", "targets": ["javascript", "wasm", "native"], "reportPath": null})})));
905
+ })(resolve(output_root, "bootstrap.json")));
906
+ })(await (artifact(initial_path))));
907
+ })(resolve(dirname(stage0_path), safe_path((receipt)["metadataPath"]))));
908
+ })(await (readCompilerMetadata(stage0_path))));
909
+ })(compilerSourceIdentity(sources)));
910
+ })(await (loadCompilerSources(({"sourceRoot": source_root})))));
911
+ })());
912
+ })((input)["onStage"]));
913
+ })((input)["signal"]));
914
+ })((input)["outputRoot"]));
915
+ })((input)["sourceRoot"]));
916
+ })((input)["stage0ManifestPath"]));
917
+ }
918
+ export {bootstrapJsStages, compareJsFixedPoint};
919
+ //# sourceMappingURL=bootstrap-js-stages.mjs.map