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,462 @@
1
+ // Generated by Eliscript. Do not edit.
2
+ import { tdz as __eliscript_tdz_error, immutable as __eliscript_const_error } from "data:text/javascript;base64,Y29uc3QgRSA9IFJlZmVyZW5jZUVycm9yOyBjb25zdCBUID0gVHlwZUVycm9yOyBleHBvcnQgZnVuY3Rpb24gdGR6KG5hbWUpIHsgdGhyb3cgbmV3IEUoIkNhbm5vdCBhY2Nlc3MgJyIgKyBuYW1lICsgIicgYmVmb3JlIGluaXRpYWxpemF0aW9uIik7IH0gZXhwb3J0IGZ1bmN0aW9uIGltbXV0YWJsZSgpIHsgdGhyb3cgbmV3IFQoIkFzc2lnbm1lbnQgdG8gY29uc3RhbnQgdmFyaWFibGUuIik7IH0K";
3
+ var __eliscript_tdz_ready_0;
4
+ function __eliscript_tdz_read_0() { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("release_help"); return release_help; }
5
+ function __eliscript_tdz_write_0(__eliscript_tdz_value_0) { if (__eliscript_tdz_ready_0 !== true) __eliscript_tdz_error("release_help"); return __eliscript_const_error(); }
6
+ import "eliscript/runtime/unicode-case.mjs";
7
+ const __eliscript_truthy = (value) => value !== false && value != null;
8
+ const __eliscript_number_intrinsic = globalThis.Number;
9
+ const __eliscript_bigint_intrinsic = globalThis.BigInt;
10
+ const __eliscript_numeric_apply = globalThis.Reflect.apply;
11
+ const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
12
+ const __eliscript_numeric_error = globalThis.TypeError;
13
+ const __eliscript_numeric_trim = globalThis.String.prototype.trim;
14
+ const __eliscript_numeric_slice = globalThis.String.prototype.slice;
15
+ const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
16
+ const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
17
+ const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
18
+ const __eliscript_numeric_primitive = (value) => {
19
+ if (!__eliscript_numeric_object(value)) return value;
20
+ const exotic = value[__eliscript_numeric_symbol];
21
+ if (exotic !== void 0 && exotic !== null) {
22
+ const result = __eliscript_numeric_apply(exotic, value, ["number"]);
23
+ if (!__eliscript_numeric_object(result)) return result;
24
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
25
+ }
26
+ for (let index = 0; index < 2; index++) {
27
+ const method = value[index === 0 ? "valueOf" : "toString"];
28
+ if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
29
+ const result = __eliscript_numeric_apply(method, value, []);
30
+ if (!__eliscript_numeric_object(result)) return result;
31
+ }
32
+ }
33
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
34
+ };
35
+ const __eliscript_to_number = (value) => {
36
+ const primitive = __eliscript_numeric_primitive(value);
37
+ if (typeof primitive === "string") {
38
+ const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
39
+ if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
40
+ let first = 2;
41
+ while (first < text.length && text[first] === "0") first++;
42
+ if (first === text.length) return 0;
43
+ const prefix = text[1];
44
+ const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
45
+ if (text.length - first > limit) return 1 / 0;
46
+ const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
47
+ return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
48
+ }
49
+ }
50
+ return __eliscript_number_intrinsic(primitive);
51
+ };
52
+ const __eliscript_numeric = (value) => {
53
+ if (typeof value === "number" || typeof value === "bigint") return value;
54
+ const primitive = __eliscript_numeric_primitive(value);
55
+ if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
56
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
57
+ };
58
+ const __eliscript_implicit_number = (value) => {
59
+ if (typeof value === "number") return value;
60
+ const primitive = __eliscript_numeric_primitive(value);
61
+ if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
62
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
63
+ };
64
+ const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
65
+ const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
66
+ const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
67
+ const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
68
+ const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
69
+ const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
70
+ const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
71
+ const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
72
+ const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
73
+ const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
74
+ const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
75
+ const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
76
+ const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
77
+ const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
78
+ const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
79
+ const __eliscript_numeric_relation = (operator, left, right) => {
80
+ if (typeof left === "number" && typeof right === "number") {
81
+ if (operator === "<") return left < right;
82
+ if (operator === "<=") return left <= right;
83
+ if (operator === ">") return left > right;
84
+ return left >= right;
85
+ }
86
+ let a = __eliscript_numeric_primitive(left);
87
+ let b = __eliscript_numeric_primitive(right);
88
+ const x = typeof a, y = typeof b;
89
+ if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
90
+ a = __eliscript_numeric(a);
91
+ b = __eliscript_numeric(b);
92
+ }
93
+ if (operator === "<") return a < b;
94
+ if (operator === "<=") return a <= b;
95
+ if (operator === ">") return a > b;
96
+ return a >= b;
97
+ };
98
+
99
+ import {readFile, writeFile, mkdir, cp} from "node:fs/promises";
100
+ import {existsSync} from "node:fs";
101
+ import {resolve, dirname, join, relative, isAbsolute, sep} from "node:path";
102
+ import {fileURLToPath} from "node:url";
103
+ import {parseArgs, isDeepStrictEqual} from "node:util";
104
+ import {root} from "../build.mjs";
105
+ import {runCompilerCLI} from "../compiler-cli-legacy.mjs";
106
+ import {compilerFailure, saveCompilerMetadata} from "../compiler-bootstrap.mjs";
107
+ import {independentCompilerProductIdentity} from "../compiler-build.mjs";
108
+ import {readCompilerMetadata} from "../compiler-metadata.mjs";
109
+ import {loadCompilerMatrixCorpus} from "../compiler-matrix.mjs";
110
+ import {bootstrapJsStages} from "./bootstrap-js-stages.mjs";
111
+ import {runStage3Targets, authenticateStage3Targets} from "../stage3-targets.mjs";
112
+ const release_help = "Eliscript JavaScript compiler bootstrap and final outputs\n\n bootstrap --stage0-manifest FILE --output DIRECTORY\n verify-bootstrap [--bootstrap-manifest FILE]\n targets [--bootstrap-manifest FILE] [--corpus-records FILE] [--output DIRECTORY] [--functional-runtime-profile small]\n compile [--bootstrap-manifest FILE] --input SOURCE --target javascript|wasm|native --output PATH\n compile [--bootstrap-manifest FILE] --project ENTRY --root DIRECTORY --target TARGET --output PATH\n request [--bootstrap-manifest FILE] --request FILE [--output PATH]\n package [--bootstrap-manifest FILE] --output DIRECTORY\n prepare-release-package [--bootstrap-manifest FILE]\n\nEmacs generates JavaScript stage0. stage0 -> stage1 -> stage2 -> stage3 all run as JavaScript.\nOnly stage3 supplies the final javascript, wasm and native program outputs.\nThe stage2/stage3 fixed point is verified before a final compiler is used.\nFunctional small resources explicitly defer the original sequence capacity acceptance.\n";
113
+ __eliscript_tdz_ready_0 = true;
114
+ function release_default(value, fallback) {
115
+ if ((value === undefined)) {
116
+ return fallback;
117
+ } else {
118
+ return value;
119
+ }
120
+ }
121
+ function release_type_error(message) {
122
+ return ((__eliscript_value_1) => { throw __eliscript_value_1; })(new (globalThis.TypeError)(message));
123
+ }
124
+ function default_release_manifest() {
125
+ {
126
+ const __eliscript_value_2 = resolve(root, "dist/bootstrap-release/bootstrap.json");
127
+ const __eliscript_value_3 = resolve(root, "dist/stage3-release.json");
128
+ {
129
+ let bootstrap_path = __eliscript_value_2;
130
+ let release_path = __eliscript_value_3;
131
+ if (__eliscript_truthy(((__eliscript_value_4) => (__eliscript_truthy(__eliscript_value_4) ? existsSync(release_path) : __eliscript_value_4))((!__eliscript_truthy(existsSync(bootstrap_path)))))) {
132
+ return release_path;
133
+ } else {
134
+ return bootstrap_path;
135
+ }
136
+ }
137
+ }
138
+ }
139
+ function release_manifest(values) {
140
+ return resolve(release_default((values)["bootstrap-manifest"], release_default(((globalThis.process)["env"])["ELISCRIPT_BOOTSTRAP_MANIFEST"], default_release_manifest())));
141
+ }
142
+ async function resolveReleaseCompiler(options = null) {
143
+ return (await (async (settings) => {
144
+ if ((!__eliscript_truthy(((__eliscript_value_5) => (__eliscript_truthy(__eliscript_value_5) ? ((((__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; } })(settings) === "object") && (!__eliscript_truthy(Array.isArray(settings)))) : __eliscript_value_5))(settings)))) {
145
+ release_type_error("final compiler options must be an object");
146
+ }
147
+ return await (authenticateStage3Targets(({"bootstrapManifestPath": release_default((settings)["bootstrapManifestPath"], release_manifest(({}))), "stage3MetadataPath": (settings)["stage3MetadataPath"]})));
148
+ })(((options === undefined) ? ({}) : options)));
149
+ }
150
+ function release_forward_arguments(arguments$, metadata_path) {
151
+ {
152
+ const __eliscript_value_6 = [];
153
+ const __eliscript_value_7 = 0;
154
+ const __eliscript_value_8 = false;
155
+ {
156
+ let result = __eliscript_value_6;
157
+ let index = __eliscript_value_7;
158
+ let artifact = __eliscript_value_8;
159
+ while (__eliscript_numeric_relation("<", index, ((arguments$) ?? []).length)) {
160
+ {
161
+ const __eliscript_value_9 = (arguments$)[index];
162
+ {
163
+ let value = __eliscript_value_9;
164
+ if (((value === "--bootstrap-manifest") || (value === "--host"))) {
165
+ ((index = (index + 1)));
166
+ } else {
167
+ if (__eliscript_truthy(((__eliscript_value_10) => (__eliscript_truthy(__eliscript_value_10) ? __eliscript_value_10 : (value)["startsWith"]("--host=")))((value)["startsWith"]("--bootstrap-manifest=")))) {
168
+ null;
169
+ } else {
170
+ if (__eliscript_truthy(((__eliscript_value_11) => (__eliscript_truthy(__eliscript_value_11) ? __eliscript_value_11 : (value)["startsWith"]("--compiler-artifact=")))((value === "--compiler-artifact")))) {
171
+ ((artifact = true));
172
+ }
173
+ (result)["push"](value);
174
+ }
175
+ }
176
+ }
177
+ }
178
+ ((index = (index + 1)));
179
+ }
180
+ if ((!__eliscript_truthy(artifact))) {
181
+ (result)["push"]("--compiler-artifact", metadata_path);
182
+ }
183
+ return result;
184
+ }
185
+ }
186
+ }
187
+ async function verify_release_bootstrap(values) {
188
+ (Object.keys(values))["forEach"](((key) => {
189
+ if ((!__eliscript_truthy((["bootstrap-manifest", "json-errors"])["includes"](key)))) {
190
+ return release_type_error(("verify-bootstrap does not accept " + key));
191
+ } else {
192
+ return null;
193
+ }
194
+ }));
195
+ return ((certified) => {
196
+ return ((source) => {
197
+ return ({"format": "eliscript-bootstrap-verification", "version": 1, "scope": "stage2-stage3-complete-products", "verification": "identical", "bootstrapManifestPath": (certified)["bootstrapManifestPath"], "fileCount": (certified)["fixedPointFileCount"], "stage2": ({"stage": 2, "metadataPath": (certified)["stage2MetadataPath"], "productSha256": ((certified)["stage2ProductIdentity"])["sha256"]}), "stage3": ({"stage": 3, "metadataPath": (certified)["stage3MetadataPath"], "productSha256": ((certified)["productIdentity"])["sha256"]}), "sourceIdentity": ({"entry": (source)["entry"], "encoding": (source)["encoding"], "sha256": (source)["sha256"]})});
198
+ })((certified)["sourceIdentity"]);
199
+ })(await (resolveReleaseCompiler(({"bootstrapManifestPath": release_manifest(values)}))));
200
+ }
201
+ async function require_prepared_runtime(certified) {
202
+ return (await (async (metadata_path) => {
203
+ return (await (async (metadata) => {
204
+ return (await (async (supports) => {
205
+ return (await (async (index) => {
206
+ return (await (async () => {
207
+ while (__eliscript_numeric_relation("<", index, ((supports) ?? []).length)) {
208
+ (await (async (support) => {
209
+ return (await (async (actual) => {
210
+ return ((prepared) => {
211
+ return ((!__eliscript_truthy(isDeepStrictEqual(actual, prepared))) ? release_type_error("prepare-release-package must install the final stage3 runtime before compiler execution") : null);
212
+ })(await (readFile(resolve(root, (support)["id"]))));
213
+ })(await (readFile(resolve(dirname(metadata_path), (support)["path"])))));
214
+ })((supports)[index]));
215
+ ((index = (index + 1)));
216
+ }
217
+ return null;
218
+ })());
219
+ })(0));
220
+ })(((metadata)["modules"])["filter"](((record) => {
221
+ return (["runtime/math.mjs", "runtime/unicode-case.mjs", "runtime/unicode-case-data.mjs"])["includes"]((record)["id"]);
222
+ }))));
223
+ })(await (readCompilerMetadata(metadata_path))));
224
+ })((certified)["stage3MetadataPath"]));
225
+ }
226
+ function release_write(io, text) {
227
+ if (__eliscript_truthy(((__eliscript_value_12) => (__eliscript_truthy(__eliscript_value_12) ? (((__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; } })((io)["write"]) === "function") : __eliscript_value_12))(io))) {
228
+ return (io)["write"](text);
229
+ } else {
230
+ return ((globalThis.process)["stdout"])["write"](text);
231
+ }
232
+ }
233
+ function release_progress(event) {
234
+ return (() => {
235
+ try {
236
+ {
237
+ const __eliscript_value_13 = ({});
238
+ const __eliscript_value_14 = ["phase", "stage", "generation", "target", "filename", "index", "completed", "total"];
239
+ const __eliscript_value_15 = 0;
240
+ {
241
+ let record = __eliscript_value_13;
242
+ let fields = __eliscript_value_14;
243
+ let index = __eliscript_value_15;
244
+ while (__eliscript_numeric_relation("<", index, ((fields) ?? []).length)) {
245
+ {
246
+ let key = (fields)[index];
247
+ let value = (event)[key];
248
+ 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"))) {
249
+ ((record)[key] = value);
250
+ }
251
+ }
252
+ ((index = (index + 1)));
253
+ }
254
+ return ((globalThis.process)["stderr"])["write"](("eliscript release " + JSON.stringify(record) + "\n"));
255
+ }
256
+ }
257
+ } catch (ignored) {
258
+ return null;
259
+ }
260
+ })();
261
+ }
262
+ async function release_corpus_path(values, output) {
263
+ return ((!((values)["corpus-records"] === undefined)) ? resolve((values)["corpus-records"]) : (await (async (corpus) => {
264
+ return (await (async (path) => {
265
+ return (await (async () => {
266
+ await (mkdir(output, ({"recursive": true})));
267
+ await (writeFile(path, (corpus)["recordsBytes"]));
268
+ return path;
269
+ })());
270
+ })(resolve(output, "original-corpus.json")));
271
+ })(await (loadCompilerMatrixCorpus(({"sourceRoot": root}))))));
272
+ }
273
+ async function copy_if_different(source, destination) {
274
+ return ((!(resolve(source) === resolve(destination))) ? (await (async () => {
275
+ await (mkdir(dirname(destination), ({"recursive": true})));
276
+ return await (cp(source, destination));
277
+ })()) : null);
278
+ }
279
+ async function prepareReleasePackage(options = null) {
280
+ return (await (async (settings) => {
281
+ return (await (async (certified) => {
282
+ return (await (async (metadata_path) => {
283
+ return (await (async (metadata) => {
284
+ return (await (async (directory) => {
285
+ return (await (async (modules) => {
286
+ return (await (async (index) => {
287
+ return (await (async () => {
288
+ if ((!__eliscript_truthy(((__eliscript_value_16) => (__eliscript_truthy(__eliscript_value_16) ? ((__eliscript_value_17) => (__eliscript_truthy(__eliscript_value_17) ? __eliscript_numeric_relation(">", ((modules) ?? []).length, 0) : __eliscript_value_17))(Array.isArray(modules)) : __eliscript_value_16))(((metadata)["host"] === "javascript"))))) {
289
+ release_type_error("stage3 package requires the complete JavaScript module graph");
290
+ }
291
+ (await (async () => {
292
+ while (__eliscript_numeric_relation("<", index, ((modules) ?? []).length)) {
293
+ (await (async (record) => {
294
+ return (await (async (id) => {
295
+ return (await (async (module_path) => {
296
+ return (await (async () => {
297
+ 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; } })(id) === "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; } })(module_path) === "string") && (!__eliscript_truthy(isAbsolute(id))) && (!__eliscript_truthy((id)["includes"]("\\"))) && (!__eliscript_truthy(((id)["split"]("/"))["includes"]("..")))))) {
298
+ release_type_error("stage3 package contains an invalid module path");
299
+ }
300
+ return (await (async (source) => {
301
+ return (await (async (part) => {
302
+ return (await (async (destination) => {
303
+ return (await (async () => {
304
+ if (__eliscript_truthy(((__eliscript_value_18) => (__eliscript_truthy(__eliscript_value_18) ? __eliscript_value_18 : ((__eliscript_value_19) => (__eliscript_truthy(__eliscript_value_19) ? __eliscript_value_19 : (part)["startsWith"]((".." + sep))))((part === ".."))))(isAbsolute(part)))) {
305
+ release_type_error("stage3 package source escapes its artifact");
306
+ }
307
+ await (copy_if_different(source, destination));
308
+ (__eliscript_truthy((["runtime/math.mjs", "runtime/unicode-case.mjs", "runtime/unicode-case-data.mjs"])["includes"](id)) ? await (copy_if_different(source, resolve(root, id))) : null);
309
+ return ((((__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; } })((record)["sourceMapPath"]) === "string") ? (await (async () => {
310
+ await (copy_if_different(resolve(directory, (record)["sourceMapPath"]), (destination + ".map")));
311
+ return (__eliscript_truthy((["runtime/math.mjs", "runtime/unicode-case.mjs", "runtime/unicode-case-data.mjs"])["includes"](id)) ? await (copy_if_different(resolve(directory, (record)["sourceMapPath"]), resolve(root, (id + ".map")))) : null);
312
+ })()) : null);
313
+ })());
314
+ })(resolve(root, "dist", id)));
315
+ })(relative(directory, source)));
316
+ })(resolve(directory, module_path)));
317
+ })());
318
+ })(release_default((record)["path"], id)));
319
+ })((record)["id"]));
320
+ })((modules)[index]));
321
+ ((index = (index + 1)));
322
+ }
323
+ return null;
324
+ })());
325
+ (await (async (runtime_rel, literals, lit_index) => {
326
+ await (copy_if_different(resolve(directory, "package.json"), resolve(root, "dist/package.json")));
327
+ await (copy_if_different(resolve(directory, runtime_rel), resolve(root, "dist", runtime_rel)));
328
+ return (await (async () => {
329
+ while (__eliscript_numeric_relation("<", lit_index, ((literals) ?? []).length)) {
330
+ (await (async (item) => {
331
+ return (await (async (lit_path) => {
332
+ return ((((__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; } })(lit_path) === "string") ? await (copy_if_different(resolve(directory, lit_path), resolve(root, "dist", lit_path))) : null);
333
+ })((item)["path"]));
334
+ })((literals)[lit_index]));
335
+ ((lit_index = (lit_index + 1)));
336
+ }
337
+ return null;
338
+ })());
339
+ })(release_default((metadata)["runtimePath"], "runtime.eli"), release_default((metadata)["literalSources"], []), 0));
340
+ ((!(resolve(directory) === resolve(root, "dist"))) ? (await (async (all_files) => {
341
+ return (await (async (packaged_files) => {
342
+ return (await (async (file_index) => {
343
+ return (await (async () => {
344
+ (await (async () => {
345
+ while (__eliscript_numeric_relation("<", file_index, ((packaged_files) ?? []).length)) {
346
+ (await (async (rel_path) => {
347
+ return await (copy_if_different(resolve(directory, rel_path), resolve(root, "dist", rel_path)));
348
+ })(((packaged_files)[file_index])["path"]));
349
+ ((file_index = (file_index + 1)));
350
+ }
351
+ return null;
352
+ })());
353
+ return (await (async (packaged_product_identity) => {
354
+ return (await (async (packaged_metadata) => {
355
+ return (await (async (release_receipt) => {
356
+ return (await (async () => {
357
+ Reflect.deleteProperty(packaged_metadata, "frontendIR");
358
+ Reflect.deleteProperty(packaged_metadata, "literalIR");
359
+ await (saveCompilerMetadata(resolve(root, "dist/compiler-artifact.json"), packaged_metadata));
360
+ return await (saveCompilerMetadata(resolve(root, "dist/stage3-release.json"), release_receipt));
361
+ })());
362
+ })(({"format": "eliscript-stage3-release", "version": 1, "status": "accepted", "scope": "stage2-stage3-complete-products", "verification": "identical", "metadataPath": "compiler-artifact.json", "fixedPointFileCount": (certified)["fixedPointFileCount"], "formalSourceIdentity": (certified)["sourceIdentity"], "artifactSourceIdentity": (metadata)["sourceIdentity"], "stage2ProductIdentity": (certified)["stage2ProductIdentity"], "stage3ProductIdentity": (certified)["productIdentity"], "packagedProductIdentity": packaged_product_identity})));
363
+ })(Object.assign(({}), metadata, ({"artifactIdentity": ({"algorithm": "sha256", "files": packaged_files}), "productIdentity": packaged_product_identity, "stage3FullProductIdentity": (metadata)["productIdentity"]}))));
364
+ })(independentCompilerProductIdentity(({"host": (metadata)["host"], "nativeTarget": (metadata)["nativeTarget"], "files": packaged_files, "descriptor": (metadata)["descriptor"], "typed": (metadata)["typed"]}))));
365
+ })());
366
+ })(0));
367
+ })((all_files)["filter"](((entry) => {
368
+ return (!__eliscript_truthy(((entry)["path"])["startsWith"]("ir/")));
369
+ }))));
370
+ })(((metadata)["artifactIdentity"])["files"])) : null);
371
+ return certified;
372
+ })());
373
+ })(0));
374
+ })((metadata)["modules"]));
375
+ })(dirname(metadata_path)));
376
+ })(await (readCompilerMetadata(metadata_path))));
377
+ })((certified)["stage3MetadataPath"]));
378
+ })(await (resolveReleaseCompiler(settings))));
379
+ })(((options === undefined) ? ({}) : options)));
380
+ }
381
+ async function runReleaseCLI(arguments$, io = null) {
382
+ if ((!__eliscript_truthy(((__eliscript_value_20) => (__eliscript_truthy(__eliscript_value_20) ? (arguments$)["every"](((value) => {
383
+ return (((__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");
384
+ })) : __eliscript_value_20))(Array.isArray(arguments$))))) {
385
+ release_type_error("compiler CLI requires an argument array");
386
+ }
387
+ return (await (async (parsed) => {
388
+ return (await (async (values) => {
389
+ return (await (async (positionals) => {
390
+ return (await (async (command) => {
391
+ return (__eliscript_truthy((values)["help"]) ? release_write(io, (__eliscript_tdz_read_0())) : (await (async () => {
392
+ if (__eliscript_truthy(((__eliscript_value_21) => (__eliscript_truthy(__eliscript_value_21) ? __eliscript_value_21 : ((!((values)["host"] === undefined)) && ((__eliscript_value_22, __eliscript_value_23) => (__eliscript_value_22 !== __eliscript_value_23))((values)["host"], "javascript"))))((values)["hosts"]))) {
393
+ release_type_error("this release supports only a JavaScript compiler host");
394
+ }
395
+ if ((!(((positionals) ?? []).length === 1))) {
396
+ release_type_error("provide exactly one compiler command");
397
+ }
398
+ if ((!((values)["functional-runtime-profile"] === undefined))) {
399
+ if ((!((command === "targets") && ((values)["functional-runtime-profile"] === "small")))) {
400
+ release_type_error("functionalRuntimeProfile is supported only as targets --functional-runtime-profile small");
401
+ }
402
+ }
403
+ if (__eliscript_truthy((["compiler-grid", "matrix", "bootstrap-all", "build"])["includes"](command))) {
404
+ release_type_error("cancelled compiler-host or grid command; use the JavaScript bootstrap");
405
+ }
406
+ return ((command === "verify-bootstrap") ? ((report) => {
407
+ release_write(io, (JSON.stringify(report) + "\n"));
408
+ return report;
409
+ })(await (verify_release_bootstrap(values))) : ((command === "bootstrap") ? (await (async () => {
410
+ if ((!__eliscript_truthy(((__eliscript_value_24) => (__eliscript_truthy(__eliscript_value_24) ? (values)["output"] : __eliscript_value_24))((values)["stage0-manifest"])))) {
411
+ release_type_error("bootstrap requires --stage0-manifest and --output");
412
+ }
413
+ release_progress(({"phase": "bootstrap-start"}));
414
+ return ((result) => {
415
+ release_write(io, ((result)["manifestPath"] + "\n"));
416
+ return result;
417
+ })(await (bootstrapJsStages(({"stage0ManifestPath": resolve((values)["stage0-manifest"]), "sourceRoot": resolve(release_default((values)["root"], root)), "outputRoot": resolve((values)["output"]), "onStage": release_progress}))));
418
+ })()) : ((command === "targets") ? (await (async () => {
419
+ await (require_prepared_runtime(await (resolveReleaseCompiler(({"bootstrapManifestPath": release_manifest(values), "stage3MetadataPath": (values)["compiler-artifact"]})))));
420
+ return (await (async (output) => {
421
+ return (await (async (corpus_path) => {
422
+ return (await (async () => {
423
+ release_progress(({"phase": "targets-start"}));
424
+ return ((result) => {
425
+ release_write(io, (((((__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; } })(result) === "string") ? result : release_default((result)["reportPath"], release_default((result)["manifestPath"], "targets-complete"))) + "\n"));
426
+ return result;
427
+ })(await (runStage3Targets(({"bootstrapManifestPath": release_manifest(values), "stage3MetadataPath": (values)["compiler-artifact"], "corpusRecordsPath": corpus_path, "functionalRuntimeProfile": (values)["functional-runtime-profile"], "outputRoot": output, "nativeTarget": release_default((values)["native-target"], (((globalThis.process)["platform"] === "linux") ? "arm64-linux" : "arm64-macos")), "onStage": release_progress}))));
428
+ })());
429
+ })(await (release_corpus_path(values, output))));
430
+ })(resolve(release_default((values)["output"], resolve(root, "dist/bootstrap-release/targets")))));
431
+ })()) : ((command === "prepare-release-package") ? ((result) => {
432
+ release_write(io, ((result)["stage3MetadataPath"] + "\n"));
433
+ return result;
434
+ })(await (prepareReleasePackage(({"bootstrapManifestPath": release_manifest(values)})))) : (__eliscript_truthy((["compile", "request", "package"])["includes"](command)) ? (await (async (certified) => {
435
+ await (require_prepared_runtime(certified));
436
+ return await (runCompilerCLI(release_forward_arguments(arguments$, (certified)["stage3MetadataPath"])));
437
+ })(await (resolveReleaseCompiler(({"bootstrapManifestPath": release_manifest(values), "stage3MetadataPath": (values)["compiler-artifact"]}))))) : release_type_error(("unsupported compiler command: " + command)))))));
438
+ })()));
439
+ })((positionals)[0]));
440
+ })((parsed)["positionals"]));
441
+ })((parsed)["values"]));
442
+ })(parseArgs(({"args": arguments$, "allowPositionals": true, "strict": true, "options": ({"help": ({"type": "boolean", "short": "h"}), "json-errors": ({"type": "boolean"}), "host": ({"type": "string"}), "hosts": ({"type": "string"}), "seed": ({"type": "boolean"}), "profile": ({"type": "string"}), "stage0-manifest": ({"type": "string"}), "bootstrap-manifest": ({"type": "string"}), "compiler-artifact": ({"type": "string"}), "corpus-records": ({"type": "string"}), "functional-runtime-profile": ({"type": "string"}), "output": ({"type": "string", "short": "o"}), "input": ({"type": "string", "short": "i"}), "project": ({"type": "string"}), "root": ({"type": "string"}), "target": ({"type": "string"}), "request": ({"type": "string"}), "runtime": ({"type": "string"}), "host-modules": ({"type": "string"}), "macro-capability": ({"type": "string", "multiple": true}), "macro-dependency": ({"type": "string", "multiple": true}), "source-map": ({"type": "boolean"}), "debug": ({"type": "boolean"}), "native-target": ({"type": "string"}), "native-format": ({"type": "string"})})}))));
443
+ }
444
+ function renderReleaseCLIError(error, options = null) {
445
+ if (__eliscript_truthy(((__eliscript_value_25) => (__eliscript_truthy(__eliscript_value_25) ? (options)["json"] : __eliscript_value_25))(options))) {
446
+ return JSON.stringify(({"format": "eliscript-compiler-cli-error", "version": 1, "error": compilerFailure(error)}));
447
+ } else {
448
+ {
449
+ const __eliscript_value_26 = compilerFailure(error);
450
+ {
451
+ let record = __eliscript_value_26;
452
+ return release_default((record)["stack"], JSON.stringify(record, null, 2));
453
+ }
454
+ }
455
+ }
456
+ }
457
+ (__eliscript_truthy(((__eliscript_value_27) => (__eliscript_truthy(__eliscript_value_27) ? (resolve(((globalThis.process)["argv"])[1]) === fileURLToPath(import.meta.url)) : __eliscript_value_27))(((globalThis.process)["argv"])[1])) ? (runReleaseCLI(((globalThis.process)["argv"])["slice"](2)))["catch"](((error) => {
458
+ ((globalThis.process)["stderr"])["write"]((renderReleaseCLIError(error, ({"json": ((globalThis.process)["argv"])["includes"]("--json-errors")})) + "\n"));
459
+ return ((globalThis.process)["exitCode"] = 1);
460
+ })) : null);
461
+ export {runReleaseCLI, resolveReleaseCompiler, renderReleaseCLIError, prepareReleasePackage};
462
+ //# sourceMappingURL=release-cli.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"release-cli.mjs","sources":["../eliscript/release-cli.eli"],"sourcesContent":["(module tools.backends.release-cli\n (import \"node:fs/promises\" readFile writeFile mkdir cp)\n (import \"node:fs\" existsSync)\n (import \"node:path\" resolve dirname join relative isAbsolute sep)\n (import \"node:url\" fileURLToPath)\n (import \"node:util\" parseArgs isDeepStrictEqual)\n (import \"../build.mjs\" root)\n (import \"../compiler-cli-legacy.mjs\" runCompilerCLI)\n (import \"../compiler-bootstrap.mjs\" compilerFailure saveCompilerMetadata)\n (import \"../compiler-build.mjs\" independentCompilerProductIdentity)\n (import \"../compiler-metadata.mjs\" readCompilerMetadata)\n (import \"../compiler-matrix.mjs\" loadCompilerMatrixCorpus)\n (import \"./bootstrap-js-stages.mjs\" bootstrapJsStages)\n (import \"../stage3-targets.mjs\" runStage3Targets authenticateStage3Targets)\n\n (defconst release-help\n \"Eliscript JavaScript compiler bootstrap and final outputs\\n\\n bootstrap --stage0-manifest FILE --output DIRECTORY\\n verify-bootstrap [--bootstrap-manifest FILE]\\n targets [--bootstrap-manifest FILE] [--corpus-records FILE] [--output DIRECTORY] [--functional-runtime-profile small]\\n compile [--bootstrap-manifest FILE] --input SOURCE --target javascript|wasm|native --output PATH\\n compile [--bootstrap-manifest FILE] --project ENTRY --root DIRECTORY --target TARGET --output PATH\\n request [--bootstrap-manifest FILE] --request FILE [--output PATH]\\n package [--bootstrap-manifest FILE] --output DIRECTORY\\n prepare-release-package [--bootstrap-manifest FILE]\\n\\nEmacs generates JavaScript stage0. stage0 -> stage1 -> stage2 -> stage3 all run as JavaScript.\\nOnly stage3 supplies the final javascript, wasm and native program outputs.\\nThe stage2/stage3 fixed point is verified before a final compiler is used.\\nFunctional small resources explicitly defer the original sequence capacity acceptance.\\n\")\n\n (defun release-default (value fallback) (if (undefined? value) fallback value))\n (defun release-type-error (message) (throw (new globalThis.TypeError message)))\n (defun default-release-manifest ()\n (let ((bootstrap-path (resolve root \"dist/bootstrap-release/bootstrap.json\"))\n (release-path (resolve root \"dist/stage3-release.json\")))\n (if (and (not (existsSync bootstrap-path)) (existsSync release-path))\n release-path\n bootstrap-path)))\n (defun release-manifest (values)\n (resolve (release-default (get values :bootstrap-manifest)\n (release-default (get (get globalThis.process :env) :ELISCRIPT_BOOTSTRAP_MANIFEST)\n (default-release-manifest)))))\n\n (defasync resolveReleaseCompiler (&optional options)\n (let ((settings (if (undefined? options) (js-object) options)))\n (unless (and settings (= (value-type settings) \"object\") (not (Array/isArray settings)))\n (release-type-error \"final compiler options must be an object\"))\n (await (authenticateStage3Targets\n (js-object :bootstrapManifestPath (release-default (get settings :bootstrapManifestPath)\n (release-manifest (js-object))) :stage3MetadataPath (get settings :stage3MetadataPath))))))\n\n (defun release-forward-arguments (arguments metadata-path)\n (let ((result (js-array)) (index 0) (artifact false))\n (while (< index (js-length arguments))\n (let ((value (aref arguments index)))\n (cond\n ((or (= value \"--bootstrap-manifest\") (= value \"--host\"))\n (setq index (1+ index)))\n ((or (js-call value :startsWith \"--bootstrap-manifest=\")\n (js-call value :startsWith \"--host=\")) nil)\n (t\n (when (or (= value \"--compiler-artifact\")\n (js-call value :startsWith \"--compiler-artifact=\")) (setq artifact t))\n (js-call result :push value))))\n (setq index (1+ index)))\n (unless artifact (js-call result :push \"--compiler-artifact\" metadata-path)) result))\n\n (defasync verify-release-bootstrap (values)\n ;; Read-only verification is deliberately independent of public runtime\n ;; preparation and compiler dispatch. The authenticator rereads and compares\n ;; every declared product byte and the original fixed-point receipt.\n (js-call (Object/keys values) :forEach (lambda (key)\n (unless (js-call (js-array \"bootstrap-manifest\" \"json-errors\") :includes key)\n (release-type-error (+ \"verify-bootstrap does not accept \" key)))))\n (let* ((certified (await (resolveReleaseCompiler\n (js-object :bootstrapManifestPath (release-manifest values)))))\n (source (get certified :sourceIdentity)))\n (js-object :format \"eliscript-bootstrap-verification\" :version 1\n :scope \"stage2-stage3-complete-products\" :verification \"identical\"\n :bootstrapManifestPath (get certified :bootstrapManifestPath)\n :fileCount (get certified :fixedPointFileCount)\n :stage2 (js-object :stage 2 :metadataPath (get certified :stage2MetadataPath)\n :productSha256 (get (get certified :stage2ProductIdentity) :sha256))\n :stage3 (js-object :stage 3 :metadataPath (get certified :stage3MetadataPath)\n :productSha256 (get (get certified :productIdentity) :sha256))\n :sourceIdentity (js-object :entry (get source :entry) :encoding (get source :encoding)\n :sha256 (get source :sha256)))))\n\n (defasync require-prepared-runtime (certified)\n (let* ((metadata-path (get certified :stage3MetadataPath))\n (metadata (await (readCompilerMetadata metadata-path)))\n (supports (js-call (get metadata :modules) :filter\n (lambda (record) (js-call (js-array \"runtime/math.mjs\" \"runtime/unicode-case.mjs\"\n \"runtime/unicode-case-data.mjs\") :includes (get record :id))))) (index 0))\n (while (< index (js-length supports))\n (let* ((support (aref supports index))\n (actual (await (readFile (resolve (dirname metadata-path) (get support :path)))))\n (prepared (await (readFile (resolve root (get support :id))))))\n (unless (isDeepStrictEqual actual prepared)\n (release-type-error \"prepare-release-package must install the final stage3 runtime before compiler execution\")))\n (setq index (1+ index)))))\n\n (defun release-write (io text)\n (if (and io (= (value-type (get io :write)) \"function\"))\n (js-call io :write text)\n (js-call (get globalThis.process :stdout) :write text)))\n\n (defun release-progress (event)\n ;; Only scalar progress is observed; a broken output pipe cannot replace\n ;; the compiler's result or original exception.\n (try\n (let ((record (js-object))\n (fields (js-array \"phase\" \"stage\" \"generation\" \"target\" \"filename\" \"index\" \"completed\" \"total\"))\n (index 0))\n (while (< index (js-length fields))\n (let* ((key (aref fields index)) (value (get event key)))\n (when (or (= (value-type value) \"string\") (= (value-type value) \"number\"))\n (put record key value)))\n (setq index (1+ index)))\n (js-call (get globalThis.process :stderr) :write (+ \"eliscript release \" (JSON/stringify record) \"\\n\")))\n (catch ignored nil)))\n\n (defasync release-corpus-path (values output)\n (if (not (undefined? (get values :corpus-records))) (resolve (get values :corpus-records))\n (let* ((corpus (await (loadCompilerMatrixCorpus (js-object :sourceRoot root))))\n (path (resolve output \"original-corpus.json\")))\n (await (mkdir output (js-object :recursive t)))\n (await (writeFile path (get corpus :recordsBytes))) path)))\n\n (defasync copy-if-different (source destination)\n (unless (= (resolve source) (resolve destination))\n (await (mkdir (dirname destination) (js-object :recursive t)))\n (await (cp source destination))))\n\n (defasync prepareReleasePackage (&optional options)\n (let* ((settings (if (undefined? options) (js-object) options))\n (certified (await (resolveReleaseCompiler settings)))\n (metadata-path (get certified :stage3MetadataPath))\n (metadata (await (readCompilerMetadata metadata-path)))\n (directory (dirname metadata-path)) (modules (get metadata :modules)) (index 0))\n (unless (and (= (get metadata :host) \"javascript\") (Array/isArray modules) (> (js-length modules) 0))\n (release-type-error \"stage3 package requires the complete JavaScript module graph\"))\n ;; Copy the actual final frontend modules into the established public\n ;; compiler paths. The full authenticated stage3 remains alongside them.\n (while (< index (js-length modules))\n (let* ((record (aref modules index)) (id (get record :id))\n (module-path (release-default (get record :path) id)))\n (unless (and (= (value-type id) \"string\") (= (value-type module-path) \"string\")\n (not (isAbsolute id)) (not (js-call id :includes \"\\\\\"))\n (not (js-call (js-call id :split \"/\") :includes \"..\")))\n (release-type-error \"stage3 package contains an invalid module path\"))\n (let* ((source (resolve directory module-path))\n (part (relative directory source)) (destination (resolve root \"dist\" id)))\n (when (or (isAbsolute part) (= part \"..\") (js-call part :startsWith (+ \"..\" sep)))\n (release-type-error \"stage3 package source escapes its artifact\"))\n (await (copy-if-different source destination))\n (when (js-call (js-array \"runtime/math.mjs\" \"runtime/unicode-case.mjs\" \"runtime/unicode-case-data.mjs\") :includes id)\n (await (copy-if-different source (resolve root id))))\n (when (= (value-type (get record :sourceMapPath)) \"string\")\n (await (copy-if-different (resolve directory (get record :sourceMapPath)) (+ destination \".map\")))\n (when (js-call (js-array \"runtime/math.mjs\" \"runtime/unicode-case.mjs\" \"runtime/unicode-case-data.mjs\") :includes id)\n (await (copy-if-different (resolve directory (get record :sourceMapPath))\n (resolve root (+ id \".map\"))))))))\n (setq index (1+ index)))\n (let ((runtime-rel (release-default (get metadata :runtimePath) \"runtime.eli\"))\n (literals (release-default (get metadata :literalSources) (js-array)))\n (lit-index 0))\n (await (copy-if-different (resolve directory \"package.json\") (resolve root \"dist/package.json\")))\n (await (copy-if-different (resolve directory runtime-rel) (resolve root \"dist\" runtime-rel)))\n (while (< lit-index (js-length literals))\n (let* ((item (aref literals lit-index))\n (lit-path (get item :path)))\n (when (= (value-type lit-path) \"string\")\n (await (copy-if-different (resolve directory lit-path) (resolve root \"dist\" lit-path)))))\n (setq lit-index (1+ lit-index))))\n (unless (= (resolve directory) (resolve root \"dist\"))\n (let* ((all-files (get (get metadata :artifactIdentity) :files))\n (packaged-files (js-call all-files :filter\n (lambda (entry) (not (js-call (get entry :path) :startsWith \"ir/\")))))\n (file-index 0))\n (while (< file-index (js-length packaged-files))\n (let ((rel-path (get (aref packaged-files file-index) :path)))\n (await (copy-if-different (resolve directory rel-path) (resolve root \"dist\" rel-path))))\n (setq file-index (1+ file-index)))\n (let* ((packaged-product-identity (independentCompilerProductIdentity\n (js-object :host (get metadata :host) :nativeTarget (get metadata :nativeTarget)\n :files packaged-files :descriptor (get metadata :descriptor) :typed (get metadata :typed))))\n (packaged-metadata (Object/assign (js-object) metadata\n (js-object :artifactIdentity (js-object :algorithm \"sha256\" :files packaged-files)\n :productIdentity packaged-product-identity\n :stage3FullProductIdentity (get metadata :productIdentity))))\n (release-receipt (js-object\n :format \"eliscript-stage3-release\" :version 1 :status \"accepted\"\n :scope \"stage2-stage3-complete-products\" :verification \"identical\"\n :metadataPath \"compiler-artifact.json\"\n :fixedPointFileCount (get certified :fixedPointFileCount)\n :formalSourceIdentity (get certified :sourceIdentity)\n :artifactSourceIdentity (get metadata :sourceIdentity)\n :stage2ProductIdentity (get certified :stage2ProductIdentity)\n :stage3ProductIdentity (get certified :productIdentity)\n :packagedProductIdentity packaged-product-identity)))\n (Reflect/deleteProperty packaged-metadata \"frontendIR\")\n (Reflect/deleteProperty packaged-metadata \"literalIR\")\n (await (saveCompilerMetadata (resolve root \"dist/compiler-artifact.json\") packaged-metadata))\n (await (saveCompilerMetadata (resolve root \"dist/stage3-release.json\") release-receipt)))))\n certified))\n\n (defasync runReleaseCLI (arguments &optional io)\n (unless (and (Array/isArray arguments)\n (js-call arguments :every (lambda (value) (= (value-type value) \"string\"))))\n (release-type-error \"compiler CLI requires an argument array\"))\n (let* ((parsed (parseArgs (js-object :args arguments :allowPositionals t :strict t\n :options (js-object\n :help (js-object :type \"boolean\" :short \"h\")\n :json-errors (js-object :type \"boolean\")\n :host (js-object :type \"string\") :hosts (js-object :type \"string\")\n :seed (js-object :type \"boolean\") :profile (js-object :type \"string\")\n :stage0-manifest (js-object :type \"string\")\n :bootstrap-manifest (js-object :type \"string\")\n :compiler-artifact (js-object :type \"string\")\n :corpus-records (js-object :type \"string\")\n :functional-runtime-profile (js-object :type \"string\")\n :output (js-object :type \"string\" :short \"o\")\n :input (js-object :type \"string\" :short \"i\")\n :project (js-object :type \"string\") :root (js-object :type \"string\")\n :target (js-object :type \"string\") :request (js-object :type \"string\")\n :runtime (js-object :type \"string\") :host-modules (js-object :type \"string\")\n :macro-capability (js-object :type \"string\" :multiple t)\n :macro-dependency (js-object :type \"string\" :multiple t)\n :source-map (js-object :type \"boolean\") :debug (js-object :type \"boolean\")\n :native-target (js-object :type \"string\") :native-format (js-object :type \"string\")))))\n (values (get parsed :values)) (positionals (get parsed :positionals))\n (command (aref positionals 0)))\n (if (get values :help) (release-write io release-help)\n (progn\n (when (or (get values :hosts)\n (and (not (undefined? (get values :host))) (/= (get values :host) \"javascript\")))\n (release-type-error \"this release supports only a JavaScript compiler host\"))\n (unless (= (js-length positionals) 1) (release-type-error \"provide exactly one compiler command\"))\n (unless (undefined? (get values :functional-runtime-profile))\n (unless (and (= command \"targets\") (= (get values :functional-runtime-profile) \"small\"))\n (release-type-error \"functionalRuntimeProfile is supported only as targets --functional-runtime-profile small\")))\n (when (js-call (js-array \"compiler-grid\" \"matrix\" \"bootstrap-all\" \"build\") :includes command)\n (release-type-error \"cancelled compiler-host or grid command; use the JavaScript bootstrap\"))\n (cond\n ((= command \"verify-bootstrap\")\n (let ((report (await (verify-release-bootstrap values))))\n (release-write io (+ (JSON/stringify report) \"\\n\")) report))\n ((= command \"bootstrap\")\n (unless (and (get values :stage0-manifest) (get values :output))\n (release-type-error \"bootstrap requires --stage0-manifest and --output\"))\n (release-progress (js-object :phase \"bootstrap-start\"))\n (let ((result (await (bootstrapJsStages\n (js-object :stage0ManifestPath (resolve (get values :stage0-manifest))\n :sourceRoot (resolve (release-default (get values :root) root))\n :outputRoot (resolve (get values :output)) :onStage release-progress)))))\n (release-write io (+ (get result :manifestPath) \"\\n\")) result))\n ((= command \"targets\")\n (await (require-prepared-runtime (await (resolveReleaseCompiler\n (js-object :bootstrapManifestPath (release-manifest values)\n :stage3MetadataPath (get values :compiler-artifact))))))\n (let* ((output (resolve (release-default (get values :output) (resolve root \"dist/bootstrap-release/targets\"))))\n (corpus-path (await (release-corpus-path values output))))\n (release-progress (js-object :phase \"targets-start\"))\n (let ((result (await (runStage3Targets\n (js-object :bootstrapManifestPath (release-manifest values)\n :stage3MetadataPath (get values :compiler-artifact) :corpusRecordsPath corpus-path\n :functionalRuntimeProfile (get values :functional-runtime-profile)\n :outputRoot output :nativeTarget (release-default (get values :native-target)\n (if (= (get globalThis.process :platform) \"linux\") \"arm64-linux\" \"arm64-macos\"))\n :onStage release-progress)))))\n (release-write io (+ (if (= (value-type result) \"string\") result\n (release-default (get result :reportPath) (release-default (get result :manifestPath) \"targets-complete\"))) \"\\n\")) result)))\n ((= command \"prepare-release-package\")\n (let ((result (await (prepareReleasePackage (js-object :bootstrapManifestPath (release-manifest values))))))\n (release-write io (+ (get result :stage3MetadataPath) \"\\n\")) result))\n ((js-call (js-array \"compile\" \"request\" \"package\") :includes command)\n (let ((certified (await (resolveReleaseCompiler\n (js-object :bootstrapManifestPath (release-manifest values)\n :stage3MetadataPath (get values :compiler-artifact))))))\n (await (require-prepared-runtime certified))\n (await (runCompilerCLI (release-forward-arguments arguments (get certified :stage3MetadataPath))))))\n (t (release-type-error (+ \"unsupported compiler command: \" command))))))))\n\n (defun renderReleaseCLIError (error &optional options)\n (if (and options (get options :json))\n (JSON/stringify (js-object :format \"eliscript-compiler-cli-error\" :version 1 :error (compilerFailure error)))\n (let ((record (compilerFailure error)))\n (release-default (get record :stack) (JSON/stringify record nil 2)))))\n\n (when (and (aref (get globalThis.process :argv) 1)\n (= (resolve (aref (get globalThis.process :argv) 1)) (fileURLToPath (js* \"import.meta.url\"))))\n (js-call (runReleaseCLI (js-call (get globalThis.process :argv) :slice 2)) :catch\n (lambda (error)\n (js-call (get globalThis.process :stderr) :write\n (+ (renderReleaseCLIError error (js-object :json\n (js-call (get globalThis.process :argv) :includes \"--json-errors\"))) \"\\n\"))\n (put globalThis.process :exitCode 1))))\n (export runReleaseCLI resolveReleaseCompiler renderReleaseCLIError prepareReleasePackage))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;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