eliscript 0.0.1 → 0.0.2

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 +59 -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-legacy.mjs +37 -0
  35. package/bootstrap/host/eliscript-cli.mjs +53 -33
  36. package/bootstrap/host/eliscript-cli.mjs.map +1 -0
  37. package/bootstrap/host/project-cli-legacy.mjs +295 -0
  38. package/bootstrap/host/project-cli.mjs +74 -289
  39. package/bootstrap/host/project-cli.mjs.map +1 -0
  40. package/bootstrap/host/project-legacy.mjs +1080 -0
  41. package/bootstrap/host/project.mjs +210 -1060
  42. package/bootstrap/host/project.mjs.map +1 -0
  43. package/bootstrap/runtime/UNICODE-LICENSE.txt +39 -0
  44. package/bootstrap/runtime/memory.eli +30379 -0
  45. package/browser/host.mjs +89 -0
  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 +446 -0
  141. package/dist/browser/loader.js +1 -0
  142. package/dist/browser/loader.mjs +231 -0
  143. package/dist/browser/worker.mjs +60 -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 +579 -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 +23 -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 +20 -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 +483 -0
  193. package/dist/literal-sources/stdlib/managed-literals.eli +1414 -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 +97 -10
  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 +114 -47
  252. package/stdlib/gepo.eli +12 -0
  253. package/stdlib/interop/js.eli +56 -15
  254. package/stdlib/managed-literal-protocols.eli +483 -0
  255. package/stdlib/managed-literals.eli +1414 -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 +579 -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 +23 -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 +20 -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 +460 -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 +486 -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,517 @@
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,dmFyIG09UmVmbGVjdC5hcHBseSx0dD1OdW1iZXIucHJvdG90eXBlLnZhbHVlT2Ysaj1OdW1iZX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l7bGV0IG89cyh0LG4sZSk7aWYobiE9PWomJm4hPT1LJiZuIT09eiYmbiE9PU0mJm4hPT1OJiZuIT09cyYmbiE9PUUpcmV0dXJuIG87bGV0IGk9bixmPXkoZSwwKSxiPVgoZSwxKSxwPSguLi51KT0+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 {readFile, writeFile, mkdir} from "node:fs/promises";
97
+ import {resolve, dirname, basename} from "node:path";
98
+ import {createRequire} from "node:module";
99
+ import {readCompilerMetadata} from "../compiler-metadata.mjs";
100
+ import {openCompilerArtifact, compilerFailure, assertCompilerArtifactSources} from "../compiler-bootstrap.mjs";
101
+ import {writeCompilerMetadata, buildIndependentCompiler, loadCompilerSources} from "../compiler-build.mjs";
102
+ import {createCompilerSession} from "../compiler-session.mjs";
103
+ import {instantiateManagedRuntime, readManagedAllocatorSnapshot} from "../managed-runtime.mjs";
104
+ import {failManagedRuntime} from "../managed-host.mjs";
105
+ function runtime_diagnostic_options(first_step) {
106
+ {
107
+ const __eliscript_value_1 = (first_step)["runtimeOptions"];
108
+ const __eliscript_value_2 = ({});
109
+ {
110
+ let options = __eliscript_value_1;
111
+ let configuration = __eliscript_value_2;
112
+ if ((!(options === undefined))) {
113
+ if ((!((!(options == 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; } })(options) === "object") && (!__eliscript_truthy(Array.isArray(options)))))) {
114
+ failManagedRuntime(3);
115
+ }
116
+ if (__eliscript_truthy(Object.hasOwn(options, "auto"))) {
117
+ {
118
+ const __eliscript_value_3 = (options)["auto"];
119
+ {
120
+ let auto = __eliscript_value_3;
121
+ if ((!__eliscript_truthy(((__eliscript_value_4) => (__eliscript_truthy(__eliscript_value_4) ? ((__eliscript_value_5) => (__eliscript_truthy(__eliscript_value_5) ? (__eliscript_numeric_relation(">=", auto, 0) && __eliscript_numeric_relation("<=", auto, 4294967295) && (!__eliscript_truthy(Object.is(auto, -0.0)))) : __eliscript_value_5))(Number.isInteger(auto)) : __eliscript_value_4))((((__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; } })(auto) === "number"))))) {
122
+ failManagedRuntime(3);
123
+ }
124
+ ((configuration)["auto"] = auto);
125
+ }
126
+ }
127
+ }
128
+ }
129
+ return Object.freeze(configuration);
130
+ }
131
+ }
132
+ }
133
+ function configure_runtime_diagnostic(runtime, metadata, configuration) {
134
+ return (runtime)["auto"]((__eliscript_truthy(Object.hasOwn(configuration, "auto")) ? (configuration)["auto"] : (metadata)["auto"]));
135
+ }
136
+ function runtime_session_options(first_step) {
137
+ {
138
+ const __eliscript_value_6 = (first_step)["runtimeOptions"];
139
+ const __eliscript_value_7 = ({"debug": false});
140
+ {
141
+ let options = __eliscript_value_6;
142
+ let configuration = __eliscript_value_7;
143
+ if ((!(options === undefined))) {
144
+ if ((!((!(options == 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; } })(options) === "object") && (!__eliscript_truthy(Array.isArray(options)))))) {
145
+ ((__eliscript_value_8) => { throw __eliscript_value_8; })(new (globalThis.TypeError)("runtimeOptions must be an object"));
146
+ }
147
+ {
148
+ const __eliscript_value_9 = Reflect.ownKeys(options);
149
+ const __eliscript_value_10 = 0;
150
+ {
151
+ let keys = __eliscript_value_9;
152
+ let index = __eliscript_value_10;
153
+ while (__eliscript_numeric_relation("<", index, ((keys) ?? []).length)) {
154
+ {
155
+ let key = (keys)[index];
156
+ let descriptor = Object.getOwnPropertyDescriptor(options, key);
157
+ if (__eliscript_truthy(((__eliscript_value_11) => (__eliscript_truthy(__eliscript_value_11) ? (descriptor)["enumerable"] : __eliscript_value_11))(descriptor))) {
158
+ Object.defineProperty(configuration, key, ({"value": (options)[key], "enumerable": true, "writable": true, "configurable": true}));
159
+ }
160
+ }
161
+ ((index = (index + 1)));
162
+ }
163
+ }
164
+ }
165
+ runtime_diagnostic_options(({"runtimeOptions": configuration}));
166
+ }
167
+ ((configuration)["debug"] = false);
168
+ return Object.freeze(configuration);
169
+ }
170
+ }
171
+ }
172
+ function capture_runtime_diagnostic(runtime, snapshot_reader, phase) {
173
+ {
174
+ const __eliscript_value_12 = ({"phase": phase});
175
+ {
176
+ let record = __eliscript_value_12;
177
+ (() => {
178
+ try {
179
+ return ((record)["allocator"] = snapshot_reader(runtime));
180
+ } catch (ignored) {
181
+ return ((record)["allocatorUnavailable"] = true);
182
+ }
183
+ })();
184
+ (() => {
185
+ try {
186
+ return ((record)["stats"] = (runtime)["stats"]());
187
+ } catch (ignored) {
188
+ return ((record)["statsUnavailable"] = true);
189
+ }
190
+ })();
191
+ return record;
192
+ }
193
+ }
194
+ }
195
+ function write_runtime_diagnostic(record) {
196
+ return (() => {
197
+ try {
198
+ return ((globalThis.process)["stderr"])["write"]((JSON.stringify(record) + "\n"));
199
+ } catch (ignored) {
200
+ return null;
201
+ }
202
+ })();
203
+ }
204
+ function finalize_runtime_diagnostic(runtime, state, phase_key, values, snapshot_reader) {
205
+ write_runtime_diagnostic(capture_runtime_diagnostic(runtime, snapshot_reader, "runtime-heap"));
206
+ (() => {
207
+ try {
208
+ return (runtime)["collect"]();
209
+ } catch (ignored) {
210
+ return null;
211
+ }
212
+ })();
213
+ {
214
+ const __eliscript_value_13 = capture_runtime_diagnostic(runtime, snapshot_reader, "runtime-checkpoint");
215
+ {
216
+ let record = __eliscript_value_13;
217
+ if (((!(state === undefined)) && (!(phase_key === undefined)))) {
218
+ (() => {
219
+ try {
220
+ {
221
+ const __eliscript_value_14 = (runtime)["objectGet"](state, phase_key);
222
+ {
223
+ let phase = __eliscript_value_14;
224
+ return (() => {
225
+ try {
226
+ return ((record)["checkpoint"] = (runtime)["toHostValue"](phase));
227
+ } finally {
228
+ (() => {
229
+ try {
230
+ return (runtime)["release"](phase);
231
+ } catch (ignored) {
232
+ return null;
233
+ }
234
+ })();
235
+ }
236
+ })();
237
+ }
238
+ }
239
+ } catch (ignored) {
240
+ return ((record)["checkpointUnavailable"] = true);
241
+ }
242
+ })();
243
+ } else {
244
+ ((record)["checkpointUnavailable"] = true);
245
+ }
246
+ write_runtime_diagnostic(record);
247
+ }
248
+ }
249
+ {
250
+ const __eliscript_value_15 = 0;
251
+ {
252
+ let index = __eliscript_value_15;
253
+ while (__eliscript_numeric_relation("<", index, ((values) ?? []).length)) {
254
+ if ((!((values)[index] === undefined))) {
255
+ (() => {
256
+ try {
257
+ return (runtime)["release"]((values)[index]);
258
+ } catch (ignored) {
259
+ return null;
260
+ }
261
+ })();
262
+ }
263
+ ((index = (index + 1)));
264
+ }
265
+ }
266
+ }
267
+ (() => {
268
+ try {
269
+ return (runtime)["closeModule"]();
270
+ } catch (ignored) {
271
+ return null;
272
+ }
273
+ })();
274
+ (() => {
275
+ try {
276
+ return (runtime)["collect"]();
277
+ } catch (ignored) {
278
+ return null;
279
+ }
280
+ })();
281
+ return (() => {
282
+ try {
283
+ return (runtime)["close"]();
284
+ } catch (ignored) {
285
+ return null;
286
+ }
287
+ })();
288
+ }
289
+ async function runtime_diagnostic(metadata, metadata_path, configuration) {
290
+ if ((!((metadata)["host"] === "wasm"))) {
291
+ ((__eliscript_value_16) => { throw __eliscript_value_16; })(new (globalThis.Error)("runtime diagnostic requires a WASM compiler"));
292
+ }
293
+ return (await (async (verified) => {
294
+ return (await (async (runtime) => {
295
+ return (await (async (state) => {
296
+ return (await (async (input) => {
297
+ return (await (async (output) => {
298
+ return (await (async (phase_key) => {
299
+ return (await (async () => {
300
+ await ((verified)["close"]());
301
+ return (await (async () => {
302
+ try {
303
+ ((runtime = instantiateManagedRuntime(await (readFile(resolve(dirname(metadata_path), (metadata)["path"]))), Object.assign(({}), (metadata)["budget"], ({"initializeModule": false})))));
304
+ configure_runtime_diagnostic(runtime, metadata, configuration);
305
+ (runtime)["initializeModule"]();
306
+ ((state = (runtime)["invoke"]("compiler_session_new")));
307
+ ((phase_key = (runtime)["string"]("lastPhase")));
308
+ return ((graph) => {
309
+ return ((request) => {
310
+ return (() => {
311
+ assertCompilerArtifactSources(metadata, graph);
312
+ ((input = (runtime)["string"](JSON.stringify(request))));
313
+ ((output = (runtime)["invoke"]("compiler_session_request", [state, input])));
314
+ return ((globalThis.process)["stdout"])["write"](((runtime)["readString"](output) + "\n"));
315
+ })();
316
+ })(({"operation": "runtime", "source": ((graph)["runtime"])["source"], "filename": ((graph)["runtime"])["filename"], "literalSources": (graph)["literalSources"]}));
317
+ })(await (loadCompilerSources()));
318
+ } catch (error) {
319
+ return ((__eliscript_value_17) => { throw __eliscript_value_17; })(error);
320
+ } finally {
321
+ if (__eliscript_truthy(runtime)) {
322
+ finalize_runtime_diagnostic(runtime, state, phase_key, [output, input, state, phase_key], readManagedAllocatorSnapshot);
323
+ }
324
+ }
325
+ })());
326
+ })());
327
+ })(undefined));
328
+ })(undefined));
329
+ })(undefined));
330
+ })(undefined));
331
+ })(undefined));
332
+ })(await (openCompilerArtifact(metadata, ({"debug": false})))));
333
+ }
334
+ function report(phase, index, request) {
335
+ return ((globalThis.process)["stdout"])["write"]((JSON.stringify(({"phase": phase, "index": index, "operation": (request)["operation"], "target": (request)["target"]})) + "\n"));
336
+ }
337
+ async function run_artifact_mode(first_step, diagnostic, sequence) {
338
+ return (__eliscript_truthy((first_step)["runtimeDiagnostic"]) ? (await (async (configuration) => {
339
+ return await (diagnostic(configuration));
340
+ })(runtime_diagnostic_options(first_step))) : await (sequence(runtime_session_options(first_step))));
341
+ }
342
+ async function run_artifact(arguments$) {
343
+ if ((!(((arguments$) ?? []).length === 2))) {
344
+ ((__eliscript_value_18) => { throw __eliscript_value_18; })(new (globalThis.Error)("Usage: run-artifact ARTIFACT_METADATA REQUEST_SEQUENCE_JSON"));
345
+ }
346
+ return (await (async (metadata_path) => {
347
+ return (await (async (sequence_path) => {
348
+ return (await (async (base) => {
349
+ return (await (async (metadata) => {
350
+ return (await (async (steps) => {
351
+ return (await (async (session) => {
352
+ return (await (async (failed) => {
353
+ return (await (async (index) => {
354
+ return (await (async () => {
355
+ if ((!__eliscript_truthy(((__eliscript_value_19) => (__eliscript_truthy(__eliscript_value_19) ? __eliscript_numeric_relation(">", ((steps) ?? []).length, 0) : __eliscript_value_19))(Array.isArray(steps))))) {
356
+ ((__eliscript_value_20) => { throw __eliscript_value_20; })(new (globalThis.Error)("request sequence must be a nonempty array"));
357
+ }
358
+ return await (run_artifact_mode((steps)[0], (async (configuration) => {
359
+ ((metadata = await (readCompilerMetadata(metadata_path))));
360
+ ((metadata)["metadataPath"] = metadata_path);
361
+ return await (runtime_diagnostic(metadata, metadata_path, configuration));
362
+ }), (async (configuration) => {
363
+ ((metadata = await (readCompilerMetadata(metadata_path))));
364
+ ((metadata)["metadataPath"] = metadata_path);
365
+ ((session = await (openCompilerArtifact(metadata, configuration))));
366
+ return (await (async () => {
367
+ try {
368
+ (__eliscript_truthy(((steps)[0])["wireTransport"]) ? (await (async () => {
369
+ if ((!((metadata)["host"] === "javascript"))) {
370
+ ((__eliscript_value_21) => { throw __eliscript_value_21; })(new (globalThis.Error)("wire transport requires a JavaScript compiler artifact"));
371
+ }
372
+ await ((session)["close"]());
373
+ return (await (async (require_module) => {
374
+ return (await (async (compiler) => {
375
+ return (await (async (descriptors) => {
376
+ return (await (async (create_descriptor) => {
377
+ return (await (async (create) => {
378
+ return (await (async (observed) => {
379
+ return (await (async () => {
380
+ ((create_descriptor)["value"] = ((...arguments$) => {
381
+ {
382
+ const __eliscript_value_22 = __eliscript_at(Reflect, "apply")(create, compiler, arguments$);
383
+ {
384
+ let state = __eliscript_value_22;
385
+ ((state)["phaseObserver"] = ((phase, counts) => {
386
+ {
387
+ let step = (steps)[index];
388
+ let request = ((__eliscript_value_23) => (__eliscript_truthy(__eliscript_value_23) ? __eliscript_value_23 : ({"operation": "build", "target": ((step)["build"])["host"]})))((step)["request"]);
389
+ return report(phase, index, request);
390
+ }
391
+ }));
392
+ return state;
393
+ }
394
+ }
395
+ }));
396
+ Object.defineProperties(observed, descriptors);
397
+ return ((session = await (createCompilerSession(({"host": "javascript", "compiler": observed})))));
398
+ })());
399
+ })(Object.create(Object.getPrototypeOf(compiler))));
400
+ })((create_descriptor)["value"]));
401
+ })((descriptors)["compiler_session_new"]));
402
+ })(Object.getOwnPropertyDescriptors(compiler)));
403
+ })(require_module(resolve(dirname(metadata_path), (metadata)["path"]))));
404
+ })(createRequire(metadata_path)));
405
+ })()) : null);
406
+ return (await (async () => {
407
+ while (__eliscript_numeric_relation("<", index, ((steps) ?? []).length)) {
408
+ (await (async (step) => {
409
+ return (await (async (request) => {
410
+ return (await (async (output) => {
411
+ return (await (async (source_path) => {
412
+ return (await (async (module_sources) => {
413
+ return (await (async (build) => {
414
+ return (await (async () => {
415
+ if ((!__eliscript_truthy(((__eliscript_value_24) => (__eliscript_truthy(__eliscript_value_24) ? (((__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) === "string") : __eliscript_value_24))(((__eliscript_value_25) => (__eliscript_truthy(__eliscript_value_25) ? __eliscript_value_25 : build))(request))))) {
416
+ ((__eliscript_value_26) => { throw __eliscript_value_26; })(new (globalThis.Error)("each request requires an output path"));
417
+ }
418
+ return (__eliscript_truthy(build) ? (await (async (host) => {
419
+ return ((artifact) => {
420
+ return (() => {
421
+ report("build-complete", index, ({"operation": "build", "target": host}));
422
+ return ((globalThis.process)["stdout"])["write"](((artifact)["metadataPath"] + "\n"));
423
+ })();
424
+ })(await (buildIndependentCompiler(({"host": host, "outputRoot": resolve(base, output), "profile": ((build)["profile"] ?? "full-runtime"), "nativeTarget": ((build)["nativeTarget"] ?? "arm64-macos"), "retainIR": false, "debug": true, "session": session, "onPhase": ((phase, counts) => {
425
+ return report(phase, index, ({"operation": "build", "target": host}));
426
+ })}))));
427
+ })((build)["host"])) : (await (async () => {
428
+ (__eliscript_truthy(source_path) ? (await (async () => {
429
+ ((request)["source"] = await (readFile(resolve(base, source_path), "utf8")));
430
+ if ((!__eliscript_truthy((request)["filename"]))) {
431
+ return ((request)["filename"] = source_path);
432
+ } else {
433
+ return null;
434
+ }
435
+ })()) : null);
436
+ (__eliscript_truthy(module_sources) ? (await (async () => {
437
+ if ((!__eliscript_truthy(Array.isArray(module_sources)))) {
438
+ ((__eliscript_value_27) => { throw __eliscript_value_27; })(new (globalThis.Error)("moduleSources must be an array"));
439
+ }
440
+ return (await (async (modules, position) => {
441
+ (await (async () => {
442
+ while (__eliscript_numeric_relation("<", position, ((module_sources) ?? []).length)) {
443
+ (await (async (item) => {
444
+ return (await (async (filename) => {
445
+ return ((source) => {
446
+ return (modules)["push"](({"id": (item)["id"], "filename": filename, "source": source}));
447
+ })(await (readFile(resolve(base, (item)["sourcePath"]), "utf8")));
448
+ })((item)["filename"]));
449
+ })((module_sources)[position]));
450
+ ((position = (position + 1)));
451
+ }
452
+ return null;
453
+ })());
454
+ return ((request)["modules"] = modules);
455
+ })([], 0));
456
+ })()) : null);
457
+ report("request-start", index, request);
458
+ return (await (async (result) => {
459
+ return (await (async (javascript) => {
460
+ return (await (async (expected_path) => {
461
+ return (await (async (path) => {
462
+ return (await (async () => {
463
+ (__eliscript_truthy(expected_path) ? ((!(javascript === await (readFile(resolve(base, expected_path), "utf8")))) ? ((__eliscript_value_28) => { throw __eliscript_value_28; })(new (globalThis.Error)("compiler JavaScript output differs from the bound reference")) : null) : null);
464
+ await (mkdir(dirname(path), ({"recursive": true})));
465
+ ((((__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; } })(javascript) === "string") ? await (writeFile(path, javascript)) : await (writeCompilerMetadata(path, result)));
466
+ return report("request-complete", index, request);
467
+ })());
468
+ })(resolve(base, output)));
469
+ })((step)["expectedJavascriptPath"]));
470
+ })((result)["javascript"]));
471
+ })(await ((session)["request"](request))));
472
+ })()));
473
+ })());
474
+ })((step)["build"]));
475
+ })((step)["moduleSources"]));
476
+ })((step)["sourcePath"]));
477
+ })((step)["output"]));
478
+ })((step)["request"]));
479
+ })((steps)[index]));
480
+ ((index = (index + 1)));
481
+ }
482
+ return null;
483
+ })());
484
+ } catch (error) {
485
+ ((failed = true));
486
+ return ((__eliscript_value_29) => { throw __eliscript_value_29; })(error);
487
+ } finally {
488
+ (await (async () => {
489
+ try {
490
+ return await ((session)["close"]());
491
+ } catch (close_error) {
492
+ if ((!__eliscript_truthy(failed))) {
493
+ return ((__eliscript_value_30) => { throw __eliscript_value_30; })(close_error);
494
+ } else {
495
+ return null;
496
+ }
497
+ }
498
+ })());
499
+ }
500
+ })());
501
+ })));
502
+ })());
503
+ })(0));
504
+ })(false));
505
+ })(null));
506
+ })(JSON.parse(await (readFile(sequence_path, "utf8")))));
507
+ })(undefined));
508
+ })(dirname(sequence_path)));
509
+ })(resolve((arguments$)[1])));
510
+ })(resolve((arguments$)[0])));
511
+ }
512
+ export {finalize_runtime_diagnostic, run_artifact_mode, runtime_diagnostic_options, configure_runtime_diagnostic, run_artifact};
513
+ ((__eliscript_numeric_relation(">", (((globalThis.process)["argv"]) ?? []).length, 1) && (basename(((globalThis.process)["argv"])[1]) === "run-artifact.mjs")) ? (run_artifact(((globalThis.process)["argv"])["slice"](2)))["catch"](((error) => {
514
+ ((globalThis.process)["stderr"])["write"]((JSON.stringify(compilerFailure(error)) + "\n"));
515
+ return ((globalThis.process)["exitCode"] = 1);
516
+ })) : null);
517
+ //# sourceMappingURL=run-artifact.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-artifact.mjs","sources":["../eliscript/run-artifact.eli"],"sourcesContent":["(module tools.backends.run-artifact\n (import \"node:fs/promises\" readFile writeFile mkdir)\n (import \"node:path\" resolve dirname basename)\n (import \"node:module\" createRequire)\n (import \"../compiler-metadata.mjs\" readCompilerMetadata)\n (import \"../compiler-bootstrap.mjs\" openCompilerArtifact compilerFailure assertCompilerArtifactSources)\n (import \"../compiler-build.mjs\" writeCompilerMetadata buildIndependentCompiler loadCompilerSources)\n (import \"../compiler-session.mjs\" createCompilerSession)\n (import \"../managed-runtime.mjs\" instantiateManagedRuntime readManagedAllocatorSnapshot)\n (import \"../managed-host.mjs\" failManagedRuntime)\n\n (defun runtime-diagnostic-options (first-step)\n (let ((options (get first-step :runtimeOptions)) (configuration (js-object)))\n (unless (undefined? options)\n (unless (and (not (nullish? options)) (= (value-type options) \"object\")\n (not (Array/isArray options)))\n (failManagedRuntime 3))\n (when (Object/hasOwn options \"auto\")\n (let ((auto (get options :auto)))\n ;; Match runtime.auto's word validation without touching a heap.\n ;; In particular, zero disables automatic GC and is no default.\n (unless (and (= (value-type auto) \"number\") (Number/isInteger auto)\n (>= auto 0) (<= auto 4294967295) (not (Object/is auto -0)))\n (failManagedRuntime 3))\n (put configuration :auto auto))))\n (Object/freeze configuration)))\n\n (defun configure-runtime-diagnostic (runtime metadata configuration)\n (js-call runtime :auto (if (Object/hasOwn configuration \"auto\")\n (get configuration :auto) (get metadata :auto))))\n\n (defun runtime-session-options (first-step)\n (let ((options (get first-step :runtimeOptions)) (configuration (js-object :debug false)))\n (unless (undefined? options)\n (unless (and (not (nullish? options)) (= (value-type options) \"object\")\n (not (Array/isArray options)))\n (throw (new globalThis.TypeError \"runtimeOptions must be an object\")))\n ;; Snapshot spread semantics once, including an own __proto__ field,\n ;; without invoking inherited setters. The ordinary loader retains\n ;; responsibility for its existing resource-option validation.\n (let ((keys (Reflect/ownKeys options)) (index 0))\n (while (< index (js-length keys))\n (let* ((key (aref keys index)) (descriptor (Object/getOwnPropertyDescriptor options key)))\n (when (and descriptor (get descriptor :enumerable))\n (Object/defineProperty configuration key (js-object :value (get options key)\n :enumerable t :writable t :configurable t))))\n (setq index (1+ index))))\n (runtime-diagnostic-options (js-object :runtimeOptions configuration)))\n ;; Source-frame loading remains disabled for functional compiler calls;\n ;; request.debug still reaches project emission independently.\n (put configuration :debug false)\n (Object/freeze configuration)))\n\n (defun capture-runtime-diagnostic (runtime snapshot-reader phase)\n (let ((record (js-object :phase phase)))\n ;; Read raw allocator state first: stats may clear lastError while\n ;; calling the runtime. Neither reader can hide the other's evidence.\n (try (put record :allocator (funcall snapshot-reader runtime))\n (catch ignored (put record :allocatorUnavailable t)))\n (try (put record :stats (js-call runtime :stats))\n (catch ignored (put record :statsUnavailable t)))\n record))\n\n (defun write-runtime-diagnostic (record)\n (try (js-call (get globalThis.process :stderr) :write (+ (JSON/stringify record) \"\\n\"))\n (catch ignored nil)))\n\n (defun finalize-runtime-diagnostic (runtime state phase-key values snapshot-reader)\n ;; This is a diagnostic/cleanup boundary, never a replacement source error.\n ;; The caller's handles remain rooted across both snapshots and collection.\n (write-runtime-diagnostic (capture-runtime-diagnostic runtime snapshot-reader \"runtime-heap\"))\n (try (js-call runtime :collect) (catch ignored nil))\n ;; Snapshot the post-collection allocator before any checkpoint conversion\n ;; can touch lastError or create an unrelated managed temporary.\n (let ((record (capture-runtime-diagnostic runtime snapshot-reader \"runtime-checkpoint\")))\n (if (and (not (undefined? state)) (not (undefined? phase-key)))\n (try\n (let ((phase (js-call runtime :objectGet state phase-key)))\n (try (put record :checkpoint (js-call runtime :toHostValue phase))\n (finally (try (js-call runtime :release phase) (catch ignored nil)))))\n (catch ignored (put record :checkpointUnavailable t)))\n (put record :checkpointUnavailable t))\n (write-runtime-diagnostic record))\n (let ((index 0))\n (while (< index (js-length values))\n (unless (undefined? (aref values index))\n (try (js-call runtime :release (aref values index)) (catch ignored nil)))\n (setq index (1+ index))))\n (try (js-call runtime :closeModule) (catch ignored nil))\n (try (js-call runtime :collect) (catch ignored nil))\n (try (js-call runtime :close) (catch ignored nil)))\n\n ;; Preserve the full request and its first failure while exposing only scalar\n ;; counters. This mode diagnoses a real capacity failure; it is no grid cell.\n (defasync runtime-diagnostic (metadata metadata-path configuration)\n (unless (= (get metadata :host) \"wasm\")\n (throw (new globalThis.Error \"runtime diagnostic requires a WASM compiler\")))\n (let* ((verified (await (openCompilerArtifact metadata (js-object :debug false))))\n (runtime undefined) (state undefined) (input undefined) (output undefined)\n (phase-key undefined))\n (await (js-call verified :close))\n (try\n (setq runtime (instantiateManagedRuntime\n (await (readFile (resolve (dirname metadata-path) (get metadata :path))))\n (Object/assign (js-object) (get metadata :budget)\n (js-object :initializeModule false))))\n (configure-runtime-diagnostic runtime metadata configuration)\n (js-call runtime :initializeModule)\n (setq state (js-call runtime :invoke \"compiler_session_new\"))\n (setq phase-key (js-call runtime :string \"lastPhase\"))\n (let* ((graph (await (loadCompilerSources)))\n (request (js-object :operation \"runtime\"\n :source (get (get graph :runtime) :source)\n :filename (get (get graph :runtime) :filename)\n :literalSources (get graph :literalSources))))\n (assertCompilerArtifactSources metadata graph)\n (setq input (js-call runtime :string (JSON/stringify request)))\n (setq output (js-call runtime :invoke \"compiler_session_request\" (js-array state input)))\n (js-call (get globalThis.process :stdout) :write\n (+ (js-call runtime :readString output) \"\\n\")))\n (catch error (throw error))\n (finally\n (when runtime\n (finalize-runtime-diagnostic runtime state phase-key (js-array output input state phase-key)\n readManagedAllocatorSnapshot))))))\n\n ;; Keep an actual emitted compiler alive across a complete request sequence.\n ;; Existing host loaders provide file and machine-library access only; every\n ;; compilation request executes the selected compiler's own implementation.\n (defun report (phase index request)\n (js-call (get globalThis.process :stdout) :write\n (+ (JSON/stringify\n (js-object :phase phase :index index\n :operation (get request :operation)\n :target (get request :target))) \"\\n\")))\n\n (defasync run-artifact-mode (first-step diagnostic sequence)\n (if (get first-step :runtimeDiagnostic)\n ;; Validate and snapshot before the branch may perform artifact IO,\n ;; initialize a compiler, or call any managed operation.\n (let ((configuration (runtime-diagnostic-options first-step)))\n (await (funcall diagnostic configuration)))\n (await (funcall sequence (runtime-session-options first-step)))))\n\n (defasync run-artifact (arguments)\n (unless (= (js-length arguments) 2)\n (throw (new globalThis.Error\n \"Usage: run-artifact ARTIFACT_METADATA REQUEST_SEQUENCE_JSON\")))\n (let* ((metadata-path (resolve (aref arguments 0)))\n (sequence-path (resolve (aref arguments 1)))\n (base (dirname sequence-path))\n (metadata undefined)\n (steps (JSON/parse (await (readFile sequence-path \"utf8\"))))\n (session nil) (failed false) (index 0))\n (unless (and (Array/isArray steps) (> (js-length steps) 0))\n (throw (new globalThis.Error \"request sequence must be a nonempty array\")))\n ;; Binary debug data remains an authenticated build deliverable. Loading\n ;; it is unnecessary when exercising the compiler's functional requests.\n (await (run-artifact-mode (aref steps 0)\n (async (configuration)\n (setq metadata (await (readCompilerMetadata metadata-path)))\n (put metadata :metadataPath metadata-path)\n (await (runtime-diagnostic metadata metadata-path configuration)))\n (async (configuration)\n (setq metadata (await (readCompilerMetadata metadata-path)))\n (put metadata :metadataPath metadata-path)\n (setq session (await (openCompilerArtifact metadata configuration)))\n (try\n ;; The wire transport consumes a fresh decoded graph in bounded events.\n ;; Authenticate the emitted compiler through the normal loader first;\n ;; changing transport never substitutes a compiler implementation.\n (when (get (aref steps 0) :wireTransport)\n (unless (= (get metadata :host) \"javascript\")\n (throw (new globalThis.Error \"wire transport requires a JavaScript compiler artifact\")))\n (await (js-call session :close))\n (let* ((require-module (createRequire metadata-path))\n (compiler (funcall require-module\n (resolve (dirname metadata-path) (get metadata :path))))\n (descriptors (Object/getOwnPropertyDescriptors compiler))\n (create-descriptor (get descriptors \"compiler_session_new\"))\n (create (get create-descriptor :value))\n (observed (Object/create (Object/getPrototypeOf compiler))))\n ;; Preserve the authenticated module's other exports and every\n ;; property descriptor. Only the local state constructor installs\n ;; the existing private observer; it never enters request data.\n (put create-descriptor :value\n (lambda (&rest arguments)\n (let ((state (Reflect/apply create compiler arguments)))\n (put state :phaseObserver\n (lambda (phase counts)\n (let* ((step (aref steps index))\n (request (or (get step :request)\n (js-object :operation \"build\" :target (get (get step :build) :host)))))\n (report phase index request))))\n state)))\n (Object/defineProperties observed descriptors)\n (setq session (await (createCompilerSession\n (js-object :host \"javascript\" :compiler observed))))))\n (while (< index (js-length steps))\n (let* ((step (aref steps index)) (request (get step :request))\n (output (get step :output)) (source-path (get step :sourcePath))\n (module-sources (get step :moduleSources)) (build (get step :build)))\n (unless (and (or request build) (= (value-type output) \"string\"))\n (throw (new globalThis.Error \"each request requires an output path\")))\n (if build\n (let* ((host (get build :host))\n (artifact (await (buildIndependentCompiler\n (js-object :host host :outputRoot (resolve base output)\n :profile (get build :profile \"full-runtime\")\n :nativeTarget (get build :nativeTarget \"arm64-macos\")\n :retainIR false :debug t :session session\n :onPhase (lambda (phase counts)\n (report phase index (js-object :operation \"build\" :target host))))))))\n (report \"build-complete\" index (js-object :operation \"build\" :target host))\n (js-call (get globalThis.process :stdout) :write\n (+ (get artifact :metadataPath) \"\\n\")))\n (progn\n (when source-path\n (put request :source (await (readFile (resolve base source-path) \"utf8\")))\n (unless (get request :filename) (put request :filename source-path)))\n (when module-sources\n (unless (Array/isArray module-sources)\n (throw (new globalThis.Error \"moduleSources must be an array\")))\n (let ((modules (js-array)) (position 0))\n (while (< position (js-length module-sources))\n (let* ((item (aref module-sources position))\n (filename (get item :filename))\n (source (await (readFile\n (resolve base (get item :sourcePath)) \"utf8\"))))\n (js-call modules :push\n (js-object :id (get item :id) :filename filename :source source)))\n (setq position (1+ position)))\n (put request :modules modules)))\n (report \"request-start\" index request)\n (let* ((result (await (js-call session :request request)))\n (javascript (get result :javascript))\n (expected-path (get step :expectedJavascriptPath))\n (path (resolve base output)))\n (when expected-path\n (unless (= javascript (await (readFile (resolve base expected-path) \"utf8\")))\n (throw (new globalThis.Error \"compiler JavaScript output differs from the bound reference\"))))\n (await (mkdir (dirname path) (js-object :recursive t)))\n (if (= (value-type javascript) \"string\")\n (await (writeFile path javascript))\n (await (writeCompilerMetadata path result)))\n (report \"request-complete\" index request)))))\n (setq index (1+ index)))\n (catch error (setq failed t) (throw error))\n (finally\n (try (await (js-call session :close))\n (catch close-error (unless failed (throw close-error)))))))))))\n\n (export finalize-runtime-diagnostic run-artifact-mode runtime-diagnostic-options configure-runtime-diagnostic run-artifact)\n (when (and (> (js-length (get globalThis.process :argv)) 1)\n (= (basename (aref (get globalThis.process :argv) 1)) \"run-artifact.mjs\"))\n (js-call (run-artifact (js-call (get globalThis.process :argv) :slice 2)) :catch\n (lambda (error)\n (js-call (get globalThis.process :stderr) :write\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