eliscript 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (526) hide show
  1. package/COPYING.RUNTIME +93 -0
  2. package/README.md +15 -3
  3. package/bin/eliscript-test +29 -0
  4. package/bootstrap/backends/README.md +5 -4
  5. package/bootstrap/backends/binary.eli +89 -22
  6. package/bootstrap/backends/capabilities.eli +9 -4
  7. package/bootstrap/backends/managed-layout.eli +93 -81
  8. package/bootstrap/backends/managed.eli +651 -125
  9. package/bootstrap/backends/native.eli +1791 -324
  10. package/bootstrap/backends/numeric.eli +71 -7
  11. package/bootstrap/backends/sha256.eli +165 -68
  12. package/bootstrap/backends/wasm.eli +461 -52
  13. package/bootstrap/compiler/analyzer.eli +692 -2
  14. package/bootstrap/compiler/compiler.eli +16 -3
  15. package/bootstrap/compiler/emitter.eli +80 -35
  16. package/bootstrap/compiler/project.eli +175 -1
  17. package/bootstrap/compiler/transient-analysis.eli +2 -2
  18. package/bootstrap/host/build.eli +1 -0
  19. package/bootstrap/host/build.mjs +1 -1
  20. package/bootstrap/host/build.mjs.map +1 -1
  21. package/bootstrap/host/bun.mjs +7 -9
  22. package/bootstrap/host/bun.mjs.map +1 -1
  23. package/bootstrap/host/check-cli-ground.eli +47 -5
  24. package/bootstrap/host/check-cli-ground.mjs +60 -19
  25. package/bootstrap/host/check-cli-ground.mjs.map +1 -1
  26. package/bootstrap/host/check-cli.mjs +41 -1
  27. package/bootstrap/host/check-cli.mjs.map +1 -1
  28. package/bootstrap/host/compiler-session.eli +136 -22
  29. package/bootstrap/host/eliscript-cli.mjs +1 -1
  30. package/bootstrap/host/eliscript-cli.mjs.map +1 -1
  31. package/bootstrap/host/evaluation-cli.eli +33 -1
  32. package/bootstrap/host/evaluation-cli.mjs +65 -28
  33. package/bootstrap/host/evaluation-cli.mjs.map +1 -1
  34. package/bootstrap/host/evaluation.eli +651 -42
  35. package/bootstrap/host/evaluation.mjs +884 -72
  36. package/bootstrap/host/evaluation.mjs.map +1 -1
  37. package/bootstrap/host/project-cli-ground.eli +6 -1
  38. package/bootstrap/host/project-cli-ground.mjs +33 -32
  39. package/bootstrap/host/project-cli-ground.mjs.map +1 -1
  40. package/bootstrap/host/project-cli.mjs +1 -1
  41. package/bootstrap/host/project-cli.mjs.map +1 -1
  42. package/bootstrap/host/project-ground.eli +266 -45
  43. package/bootstrap/host/project-ground.mjs +429 -159
  44. package/bootstrap/host/project-ground.mjs.map +1 -1
  45. package/bootstrap/host/project.mjs +30 -40
  46. package/bootstrap/host/project.mjs.map +1 -1
  47. package/bootstrap/host/test-cli.eli +379 -0
  48. package/bootstrap/host/test-cli.mjs +494 -0
  49. package/bootstrap/host/test-cli.mjs.map +1 -0
  50. package/browser/README.md +7 -0
  51. package/browser/host.mjs +21 -29
  52. package/browser/host.mjs.map +1 -1
  53. package/browser/worker.mjs +7 -9
  54. package/browser/worker.mjs.map +1 -1
  55. package/compiler/eliscript-analyzer.el +694 -0
  56. package/compiler/eliscript-cli.el +66 -22
  57. package/compiler/eliscript-emitter.el +67 -43
  58. package/compiler/eliscript-ir-emitter.el +71 -36
  59. package/compiler/eliscript-project.el +360 -80
  60. package/compiler/eliscript-transient-analysis.el +5 -5
  61. package/compiler/eliscript.el +6 -0
  62. package/dist/backends/binary.mjs +148 -26
  63. package/dist/backends/binary.mjs.map +1 -1
  64. package/dist/backends/capabilities.mjs +11 -4
  65. package/dist/backends/capabilities.mjs.map +1 -1
  66. package/dist/backends/elf.mjs +4 -4
  67. package/dist/backends/elf.mjs.map +1 -1
  68. package/dist/backends/managed-layout.mjs +53 -56
  69. package/dist/backends/managed-layout.mjs.map +1 -1
  70. package/dist/backends/managed.mjs +1116 -375
  71. package/dist/backends/managed.mjs.map +1 -1
  72. package/dist/backends/memory.mjs +24 -26
  73. package/dist/backends/memory.mjs.map +1 -1
  74. package/dist/backends/native.mjs +2529 -434
  75. package/dist/backends/native.mjs.map +1 -1
  76. package/dist/backends/numeric.mjs +140 -33
  77. package/dist/backends/numeric.mjs.map +1 -1
  78. package/dist/backends/optimize.mjs +2 -2
  79. package/dist/backends/optimize.mjs.map +1 -1
  80. package/dist/backends/regexp.mjs +33 -35
  81. package/dist/backends/regexp.mjs.map +1 -1
  82. package/dist/backends/sha256.mjs +159 -59
  83. package/dist/backends/sha256.mjs.map +1 -1
  84. package/dist/backends/wasm.mjs +609 -73
  85. package/dist/backends/wasm.mjs.map +1 -1
  86. package/dist/bootstrap/analyzer.mjs +1018 -2
  87. package/dist/bootstrap/analyzer.mjs.map +1 -1
  88. package/dist/bootstrap/compiler.mjs +30 -23
  89. package/dist/bootstrap/compiler.mjs.map +1 -1
  90. package/dist/bootstrap/emitter.mjs +206 -161
  91. package/dist/bootstrap/emitter.mjs.macro-origins.json +16 -16
  92. package/dist/bootstrap/emitter.mjs.map +1 -1
  93. package/dist/bootstrap/expander.mjs +27 -31
  94. package/dist/bootstrap/expander.mjs.map +1 -1
  95. package/dist/bootstrap/ir.mjs +22 -24
  96. package/dist/bootstrap/ir.mjs.map +1 -1
  97. package/dist/bootstrap/project.mjs +246 -1
  98. package/dist/bootstrap/project.mjs.map +1 -1
  99. package/dist/bootstrap/reader.mjs +2 -2
  100. package/dist/bootstrap/reader.mjs.map +1 -1
  101. package/dist/bootstrap/source-map.mjs +34 -48
  102. package/dist/bootstrap/source-map.mjs.map +1 -1
  103. package/dist/bootstrap/transient-analysis.mjs +2 -2
  104. package/dist/bootstrap/transient-analysis.mjs.map +1 -1
  105. package/dist/browser/compiler.js +106 -106
  106. package/dist/browser/host.mjs +21 -29
  107. package/dist/browser/loader.js +1 -1
  108. package/dist/browser/worker.mjs +95 -95
  109. package/dist/compiler-artifact.json +1 -1
  110. package/dist/host/compiler-session.mjs +405 -228
  111. package/dist/host/compiler-session.mjs.map +1 -1
  112. package/dist/host/compiler-tools.mjs +44 -46
  113. package/dist/host/compiler-tools.mjs.map +1 -1
  114. package/dist/literal-sources/runtime/core/array-map.eli +45 -0
  115. package/dist/literal-sources/runtime/core/collection-internals.eli +22 -2
  116. package/dist/literal-sources/runtime/core/collection.eli +282 -23
  117. package/dist/literal-sources/runtime/core/data-text.eli +196 -13
  118. package/dist/literal-sources/runtime/core/data.eli +1 -1
  119. package/dist/literal-sources/runtime/core/identifier.eli +1 -1
  120. package/dist/literal-sources/runtime/core/lazy-sequence.eli +822 -44
  121. package/dist/literal-sources/runtime/core/list.eli +1 -1
  122. package/dist/literal-sources/runtime/core/map.eli +1 -1
  123. package/dist/literal-sources/runtime/core/metadata-internals.eli +2 -2
  124. package/dist/literal-sources/runtime/core/metadata.eli +2 -2
  125. package/dist/literal-sources/{stdlib/core/object.eli → runtime/core/object-impl.eli} +6 -6
  126. package/dist/literal-sources/runtime/core/object.eli +1 -1
  127. package/dist/literal-sources/runtime/core/order.eli +3 -3
  128. package/dist/literal-sources/runtime/core/persistent-kind.eli +1 -1
  129. package/dist/literal-sources/{stdlib/core/protocol.eli → runtime/core/protocol-impl.eli} +2 -2
  130. package/dist/literal-sources/runtime/core/protocol.eli +5 -3
  131. package/dist/literal-sources/runtime/core/queue.eli +1 -1
  132. package/dist/literal-sources/runtime/core/record.eli +3 -3
  133. package/dist/literal-sources/runtime/core/regex.eli +2 -2
  134. package/dist/literal-sources/runtime/core/sequence.eli +1 -1
  135. package/dist/literal-sources/runtime/core/set-algebra.eli +1 -1
  136. package/dist/literal-sources/runtime/core/set.eli +1 -1
  137. package/dist/literal-sources/runtime/core/sorted.eli +4 -4
  138. package/dist/literal-sources/{stdlib/core/text.eli → runtime/core/text-impl.eli} +2 -2
  139. package/dist/literal-sources/runtime/core/text.eli +1 -1
  140. package/dist/literal-sources/runtime/core/transducer.eli +24 -2
  141. package/dist/literal-sources/runtime/core/transient.eli +7 -5
  142. package/dist/literal-sources/runtime/core/type.eli +1 -1
  143. package/dist/literal-sources/runtime/core/value-internals.eli +3 -3
  144. package/dist/literal-sources/runtime/core/value.eli +2 -2
  145. package/dist/literal-sources/runtime/core/vector.eli +5 -2
  146. package/dist/literal-sources/{stdlib → runtime/managed}/managed-literal-protocols.eli +100 -34
  147. package/dist/literal-sources/{stdlib → runtime/managed}/managed-literals.eli +406 -81
  148. package/{stdlib → dist/literal-sources/runtime/managed}/managed-queue-state.eli +1 -1
  149. package/{stdlib → dist/literal-sources/runtime/managed}/managed-sorted-state.eli +1 -1
  150. package/dist/literal-sources/runtime/managed/managed-transient-state.eli +1206 -0
  151. package/{stdlib → dist/literal-sources/runtime/managed}/managed-value-state.eli +30 -6
  152. package/dist/literal-sources/{stdlib → runtime/managed}/managed-vector-view-state.eli +1 -1
  153. package/dist/literal-sources/runtime/wire/http-rpc.eli +1 -1
  154. package/dist/literal-sources/runtime/wire/markdown.eli +1 -1
  155. package/dist/literal-sources/runtime/wire/schema.eli +1 -1
  156. package/dist/literal-sources/stdlib/bit.eli +89 -1
  157. package/dist/literal-sources/stdlib/data.eli +522 -0
  158. package/dist/literal-sources/stdlib/interop/object.eli +39 -0
  159. package/dist/literal-sources/stdlib/persistent-list.eli +60 -21
  160. package/dist/literal-sources/stdlib/persistent-map.eli +335 -324
  161. package/dist/literal-sources/stdlib/persistent-set.eli +8 -6
  162. package/dist/literal-sources/stdlib/persistent-vector.eli +18 -18
  163. package/dist/literal-sources/stdlib/protocol.eli +63 -0
  164. package/{stdlib/core → dist/literal-sources/stdlib}/set.eli +8 -8
  165. package/dist/literal-sources/stdlib/string.eli +362 -0
  166. package/dist/runtime/lisp/async-runtime.mjs +55 -59
  167. package/dist/runtime/lisp/async-runtime.mjs.map +1 -1
  168. package/dist/runtime/lisp/builtins.mjs +232 -280
  169. package/dist/runtime/lisp/builtins.mjs.map +1 -1
  170. package/dist/runtime/lisp/cli.mjs +159 -167
  171. package/dist/runtime/lisp/cli.mjs.map +1 -1
  172. package/dist/runtime/lisp/compiler.mjs +359 -419
  173. package/dist/runtime/lisp/compiler.mjs.map +1 -1
  174. package/dist/runtime/lisp/core.mjs +24 -24
  175. package/dist/runtime/lisp/core.mjs.map +1 -1
  176. package/dist/runtime/lisp/evaluator.mjs +315 -385
  177. package/dist/runtime/lisp/evaluator.mjs.map +1 -1
  178. package/dist/runtime/lisp/extensions.mjs +85 -103
  179. package/dist/runtime/lisp/extensions.mjs.map +1 -1
  180. package/dist/runtime/lisp/host-io.mjs +106 -122
  181. package/dist/runtime/lisp/host-io.mjs.map +1 -1
  182. package/dist/runtime/lisp/io-worker.mjs +117 -135
  183. package/dist/runtime/lisp/io-worker.mjs.map +1 -1
  184. package/dist/runtime/lisp/keymap.mjs +5 -5
  185. package/dist/runtime/lisp/keymap.mjs.map +1 -1
  186. package/dist/runtime/lisp/macros-forms.mjs +49 -51
  187. package/dist/runtime/lisp/macros-forms.mjs.map +1 -1
  188. package/dist/runtime/lisp/reader-format.mjs +31 -31
  189. package/dist/runtime/lisp/reader-format.mjs.map +1 -1
  190. package/dist/runtime/lisp/regexp-buffer.mjs +9 -9
  191. package/dist/runtime/lisp/regexp-buffer.mjs.map +1 -1
  192. package/dist/runtime/math.mjs +32 -38
  193. package/dist/runtime/math.mjs.map +1 -1
  194. package/dist/runtime/number-radix.mjs +5 -7
  195. package/dist/runtime/number-radix.mjs.map +1 -1
  196. package/dist/runtime/primitives.mjs +81 -46
  197. package/dist/runtime/primitives.mjs.macro-origins.json +294 -44
  198. package/dist/runtime/primitives.mjs.map +1 -1
  199. package/dist/runtime/unicode-case.mjs +6 -6
  200. package/dist/runtime/unicode-case.mjs.map +1 -1
  201. package/dist/runtime.eli +3068 -1882
  202. package/dist/stage3-release.json +1 -1
  203. package/dist/stdlib/async.mjs +1838 -0
  204. package/dist/stdlib/bit.mjs +116 -0
  205. package/dist/stdlib/collection.mjs +193 -0
  206. package/dist/stdlib/core.mjs +28 -0
  207. package/dist/stdlib/data-text.mjs +54 -0
  208. package/dist/stdlib/data.mjs +601 -0
  209. package/dist/stdlib/devtools.mjs +565 -0
  210. package/dist/stdlib/diff.mjs +180 -0
  211. package/dist/stdlib/fn.mjs +164 -0
  212. package/dist/stdlib/hierarchy.mjs +189 -0
  213. package/dist/stdlib/identifier.mjs +33 -0
  214. package/dist/stdlib/interop/js.mjs +706 -0
  215. package/dist/stdlib/interop/object.mjs +40 -0
  216. package/dist/stdlib/json.mjs +843 -0
  217. package/dist/stdlib/lazy-sequence.mjs +117 -0
  218. package/dist/stdlib/math.mjs +386 -0
  219. package/dist/stdlib/meta.mjs +21 -0
  220. package/dist/stdlib/multimethod.mjs +345 -0
  221. package/dist/stdlib/numeric.mjs +327 -0
  222. package/dist/stdlib/order.mjs +194 -0
  223. package/dist/stdlib/persistent-list.mjs +171 -0
  224. package/dist/stdlib/persistent-map.mjs +781 -0
  225. package/dist/stdlib/persistent-queue.mjs +44 -0
  226. package/dist/stdlib/persistent-set.mjs +225 -0
  227. package/dist/stdlib/persistent-vector.mjs +316 -0
  228. package/dist/stdlib/portable/data-text.mjs +1094 -0
  229. package/dist/stdlib/portable/data.mjs +62 -0
  230. package/dist/stdlib/portable/identifier.mjs +179 -0
  231. package/dist/stdlib/portable/metadata.mjs +63 -0
  232. package/dist/stdlib/portable/object.mjs +140 -0
  233. package/dist/stdlib/portable/sequence.mjs +142 -0
  234. package/dist/stdlib/portable/text.mjs +111 -0
  235. package/dist/stdlib/pprint.mjs +807 -0
  236. package/dist/stdlib/protocol.mjs +61 -0
  237. package/dist/stdlib/record.mjs +25 -0
  238. package/dist/stdlib/regex.mjs +115 -0
  239. package/dist/stdlib/result.mjs +198 -0
  240. package/dist/stdlib/schema.mjs +2828 -0
  241. package/dist/stdlib/seq.mjs +913 -0
  242. package/dist/stdlib/set.mjs +317 -0
  243. package/dist/stdlib/sorted.mjs +56 -0
  244. package/dist/stdlib/state.mjs +451 -0
  245. package/dist/stdlib/string.mjs +494 -0
  246. package/dist/stdlib/tap.mjs +187 -0
  247. package/dist/stdlib/test.mjs +669 -0
  248. package/dist/stdlib/time.mjs +522 -0
  249. package/dist/stdlib/transducer.mjs +85 -0
  250. package/dist/stdlib/transient.mjs +32 -0
  251. package/dist/stdlib/type.mjs +28 -0
  252. package/dist/stdlib/uuid.mjs +377 -0
  253. package/dist/stdlib/value.mjs +334 -0
  254. package/dist/stdlib/walk.mjs +243 -0
  255. package/dist/stdlib/wire/gepo.mjs +28 -0
  256. package/dist/stdlib/wire/mdp.mjs +13 -0
  257. package/dist/stdlib/wire/mds.mjs +10 -0
  258. package/dist/stdlib/zipper.mjs +1025 -0
  259. package/editor/README.md +15 -0
  260. package/editor/eliscript-data.el +221 -8
  261. package/editor/eliscript-mode.el +207 -48
  262. package/editor/eliscript-runtime.el +6 -3
  263. package/package.json +49 -15
  264. package/platform/README.md +6 -0
  265. package/platform/browser.mjs +10 -12
  266. package/platform/browser.mjs.map +1 -1
  267. package/runtime/README.md +12 -5
  268. package/runtime/core/array-map.eli +538 -0
  269. package/runtime/core/array-map.mjs +651 -0
  270. package/runtime/core/array-map.mjs.map +1 -0
  271. package/runtime/core/collection-internals.eli +85 -33
  272. package/runtime/core/collection-internals.mjs +245 -193
  273. package/runtime/core/collection-internals.mjs.map +1 -1
  274. package/runtime/core/collection.eli +105 -3
  275. package/runtime/core/collection.mjs +190 -53
  276. package/runtime/core/collection.mjs.map +1 -1
  277. package/runtime/core/data-text.eli +224 -16
  278. package/runtime/core/data-text.mjs +345 -83
  279. package/runtime/core/data-text.mjs.map +1 -1
  280. package/runtime/core/data.eli +50 -33
  281. package/runtime/core/data.mjs +72 -36
  282. package/runtime/core/data.mjs.map +1 -1
  283. package/runtime/core/identifier.mjs +15 -19
  284. package/runtime/core/identifier.mjs.map +1 -1
  285. package/runtime/core/lazy-sequence.eli +885 -15
  286. package/runtime/core/lazy-sequence.mjs +1265 -38
  287. package/runtime/core/lazy-sequence.mjs.map +1 -1
  288. package/runtime/core/map-internals.eli +209 -1
  289. package/runtime/core/map-internals.mjs +359 -71
  290. package/runtime/core/map-internals.mjs.map +1 -1
  291. package/runtime/core/map.eli +75 -7
  292. package/runtime/core/map.mjs +122 -47
  293. package/runtime/core/map.mjs.map +1 -1
  294. package/{stdlib/core/object.eli → runtime/core/object-impl.eli} +6 -6
  295. package/runtime/core/object-impl.mjs +5 -5
  296. package/runtime/core/object-impl.mjs.map +1 -1
  297. package/runtime/core/order.eli +15 -3
  298. package/runtime/core/order.mjs +23 -8
  299. package/runtime/core/order.mjs.map +1 -1
  300. package/runtime/core/persistent-kind.mjs +9 -13
  301. package/runtime/core/persistent-kind.mjs.map +1 -1
  302. package/runtime/core/protocol-error.mjs +9 -11
  303. package/runtime/core/protocol-error.mjs.map +1 -1
  304. package/{stdlib/core/protocol.eli → runtime/core/protocol-impl.eli} +2 -2
  305. package/runtime/core/protocol-impl.mjs +10 -10
  306. package/runtime/core/protocol-impl.mjs.map +1 -1
  307. package/runtime/core/queue.mjs +14 -16
  308. package/runtime/core/queue.mjs.map +1 -1
  309. package/runtime/core/record.eli +2 -2
  310. package/runtime/core/record.mjs +13 -17
  311. package/runtime/core/record.mjs.map +1 -1
  312. package/runtime/core/regex.mjs +18 -22
  313. package/runtime/core/regex.mjs.map +1 -1
  314. package/runtime/core/sequence.eli +33 -31
  315. package/runtime/core/sequence.mjs +60 -93
  316. package/runtime/core/sequence.mjs.map +1 -1
  317. package/runtime/core/set.eli +53 -27
  318. package/runtime/core/set.mjs +113 -82
  319. package/runtime/core/set.mjs.map +1 -1
  320. package/runtime/core/sorted.mjs +91 -108
  321. package/runtime/core/sorted.mjs.map +1 -1
  322. package/{stdlib/core/text.eli → runtime/core/text-impl.eli} +2 -2
  323. package/runtime/core/text-impl.mjs +1 -1
  324. package/runtime/core/text-impl.mjs.map +1 -1
  325. package/runtime/core/transducer.eli +24 -0
  326. package/runtime/core/transducer.mjs +27 -1
  327. package/runtime/core/transducer.mjs.map +1 -1
  328. package/runtime/core/transient-internals.eli +12 -4
  329. package/runtime/core/transient-internals.mjs +19 -6
  330. package/runtime/core/transient-internals.mjs.map +1 -1
  331. package/runtime/core/transient.eli +31 -0
  332. package/runtime/core/transient.mjs +33 -2
  333. package/runtime/core/transient.mjs.map +1 -1
  334. package/runtime/core/value-internals.mjs +29 -35
  335. package/runtime/core/value-internals.mjs.map +1 -1
  336. package/runtime/core/vector.eli +73 -20
  337. package/runtime/core/vector.mjs +159 -156
  338. package/runtime/core/vector.mjs.map +1 -1
  339. package/runtime/literals.eli +16 -9
  340. package/runtime/literals.mjs +25 -9
  341. package/runtime/literals.mjs.map +1 -1
  342. package/{stdlib → runtime/managed}/managed-literal-protocols.eli +100 -34
  343. package/{stdlib → runtime/managed}/managed-literals.eli +406 -81
  344. package/{dist/literal-sources/stdlib → runtime/managed}/managed-queue-state.eli +1 -1
  345. package/runtime/managed/managed-runtime-array-map.eli +45 -0
  346. package/{stdlib → runtime/managed}/managed-runtime-collection-internals.eli +22 -2
  347. package/{stdlib → runtime/managed}/managed-runtime-collection.eli +282 -23
  348. package/{stdlib → runtime/managed}/managed-runtime-data-text.eli +196 -13
  349. package/{stdlib → runtime/managed}/managed-runtime-data.eli +1 -1
  350. package/{stdlib → runtime/managed}/managed-runtime-identifier.eli +1 -1
  351. package/runtime/managed/managed-runtime-lazy-sequence.eli +935 -0
  352. package/{stdlib → runtime/managed}/managed-runtime-list.eli +1 -1
  353. package/{stdlib → runtime/managed}/managed-runtime-map.eli +1 -1
  354. package/{stdlib → runtime/managed}/managed-runtime-metadata-internals.eli +2 -2
  355. package/{stdlib → runtime/managed}/managed-runtime-metadata.eli +2 -2
  356. package/{stdlib → runtime/managed}/managed-runtime-object.eli +1 -1
  357. package/{stdlib → runtime/managed}/managed-runtime-order.eli +3 -3
  358. package/{stdlib → runtime/managed}/managed-runtime-persistent-kind.eli +1 -1
  359. package/{stdlib → runtime/managed}/managed-runtime-protocol.eli +5 -3
  360. package/{stdlib → runtime/managed}/managed-runtime-queue.eli +1 -1
  361. package/{stdlib → runtime/managed}/managed-runtime-record.eli +3 -3
  362. package/{stdlib → runtime/managed}/managed-runtime-regex.eli +2 -2
  363. package/{stdlib → runtime/managed}/managed-runtime-sequence.eli +1 -1
  364. package/{stdlib → runtime/managed}/managed-runtime-set-algebra.eli +1 -1
  365. package/{stdlib → runtime/managed}/managed-runtime-set.eli +1 -1
  366. package/{stdlib → runtime/managed}/managed-runtime-sorted.eli +4 -4
  367. package/{stdlib → runtime/managed}/managed-runtime-text.eli +1 -1
  368. package/{stdlib → runtime/managed}/managed-runtime-transducer.eli +24 -2
  369. package/{stdlib → runtime/managed}/managed-runtime-transient.eli +7 -5
  370. package/{stdlib → runtime/managed}/managed-runtime-type.eli +1 -1
  371. package/{stdlib → runtime/managed}/managed-runtime-value-internals.eli +3 -3
  372. package/{stdlib → runtime/managed}/managed-runtime-value.eli +2 -2
  373. package/{stdlib → runtime/managed}/managed-runtime-vector.eli +5 -2
  374. package/{dist/literal-sources/stdlib → runtime/managed}/managed-sorted-state.eli +1 -1
  375. package/runtime/managed/managed-transient-state.eli +1206 -0
  376. package/{dist/literal-sources/stdlib → runtime/managed}/managed-value-state.eli +30 -6
  377. package/{stdlib → runtime/managed}/managed-vector-view-state.eli +1 -1
  378. package/{stdlib → runtime/managed}/managed-wire-http-rpc.eli +1 -1
  379. package/{stdlib → runtime/managed}/managed-wire-markdown.eli +1 -1
  380. package/{stdlib → runtime/managed}/managed-wire-schema.eli +1 -1
  381. package/runtime/math.mjs +32 -38
  382. package/runtime/math.mjs.map +1 -1
  383. package/runtime/number-radix.mjs +5 -7
  384. package/runtime/number-radix.mjs.map +1 -1
  385. package/runtime/primitives.eli +19 -6
  386. package/runtime/primitives.mjs +81 -46
  387. package/runtime/primitives.mjs.map +1 -1
  388. package/runtime/source-mapping.mjs +17 -23
  389. package/runtime/source-mapping.mjs.map +1 -1
  390. package/runtime/testing/map.eli +70 -41
  391. package/runtime/testing/map.mjs +57 -34
  392. package/runtime/testing/map.mjs.map +1 -1
  393. package/runtime/unicode-case.mjs +6 -6
  394. package/runtime/unicode-case.mjs.map +1 -1
  395. package/runtime/wire/http-rpc.mjs +12 -18
  396. package/runtime/wire/http-rpc.mjs.map +1 -1
  397. package/runtime/wire/markdown.mjs +42 -42
  398. package/runtime/wire/markdown.mjs.map +1 -1
  399. package/runtime/wire/schema.mjs +13 -13
  400. package/runtime/wire/schema.mjs.map +1 -1
  401. package/runtime/worker-value-codec.mjs +5 -7
  402. package/runtime/worker-value-codec.mjs.map +1 -1
  403. package/runtime/worker-value-stream.mjs +128 -135
  404. package/runtime/worker-value-stream.mjs.map +1 -1
  405. package/runtime/worker.mjs +75 -89
  406. package/runtime/worker.mjs.map +1 -1
  407. package/stdlib/README.md +25 -18
  408. package/stdlib/async.eli +1245 -0
  409. package/stdlib/bit.eli +89 -1
  410. package/stdlib/bit.mjs +89 -2
  411. package/stdlib/bit.mjs.map +1 -1
  412. package/stdlib/{core/collection.eli → collection.eli} +39 -4
  413. package/stdlib/core.eli +956 -0
  414. package/stdlib/data-text.eli +62 -1091
  415. package/stdlib/data.eli +517 -37
  416. package/stdlib/devtools.eli +399 -0
  417. package/stdlib/diff.eli +134 -0
  418. package/stdlib/{function.eli → fn.eli} +1 -1
  419. package/stdlib/identifier.eli +21 -136
  420. package/stdlib/interop/object.eli +39 -0
  421. package/stdlib/{core/lazy-sequence.eli → lazy-sequence.eli} +28 -2
  422. package/stdlib/math.eli +267 -0
  423. package/stdlib/{core/metadata.eli → meta.eli} +2 -2
  424. package/stdlib/{core/order.eli → order.eli} +6 -6
  425. package/stdlib/persistent-list.eli +60 -21
  426. package/stdlib/persistent-map.eli +335 -324
  427. package/stdlib/persistent-set.eli +8 -6
  428. package/stdlib/persistent-vector.eli +18 -18
  429. package/stdlib/portable/data-text.eli +1092 -0
  430. package/stdlib/portable/data.eli +42 -0
  431. package/stdlib/portable/identifier.eli +147 -0
  432. package/stdlib/{metadata.eli → portable/metadata.eli} +5 -5
  433. package/stdlib/{object.eli → portable/object.eli} +1 -1
  434. package/stdlib/{sequence.eli → portable/sequence.eli} +1 -1
  435. package/stdlib/{text.eli → portable/text.eli} +1 -1
  436. package/stdlib/pprint.eli +588 -0
  437. package/stdlib/protocol.eli +63 -0
  438. package/stdlib/{core/record.eli → record.eli} +2 -2
  439. package/stdlib/regex.eli +70 -0
  440. package/stdlib/result.eli +53 -44
  441. package/stdlib/schema.eli +1886 -0
  442. package/stdlib/{core/seq.eli → seq.eli} +97 -90
  443. package/{dist/literal-sources/stdlib/core → stdlib}/set.eli +8 -8
  444. package/stdlib/{core/sorted.eli → sorted.eli} +2 -2
  445. package/stdlib/{state/atom.eli → state.eli} +137 -7
  446. package/stdlib/string.eli +362 -0
  447. package/stdlib/tap.eli +135 -0
  448. package/stdlib/test.eli +566 -0
  449. package/stdlib/time.eli +419 -0
  450. package/stdlib/{core/transducer.eli → transducer.eli} +4 -2
  451. package/stdlib/{core/transient.eli → transient.eli} +11 -5
  452. package/stdlib/{core/type.eli → type.eli} +2 -2
  453. package/stdlib/uuid.eli +288 -0
  454. package/stdlib/{core/walk.eli → walk.eli} +6 -6
  455. package/stdlib/{gepo.eli → wire/gepo.eli} +2 -2
  456. package/stdlib/{mdp.eli → wire/mdp.eli} +2 -2
  457. package/stdlib/{mds.eli → wire/mds.eli} +2 -2
  458. package/stdlib/{core/zipper.eli → zipper.eli} +179 -138
  459. package/tests/helpers/wasm-managed-math-node.mjs +495 -582
  460. package/tools/acceptance/check-ground.mjs +106 -132
  461. package/tools/acceptance/check.mjs +16 -16
  462. package/tools/acceptance/retained-performance-snapshot.mjs +265 -149
  463. package/tools/acceptance/retained-soak.mjs +5 -7
  464. package/tools/acceptance/retained-transient.mjs +5 -7
  465. package/tools/backends/build.mjs +373 -95
  466. package/tools/backends/compiler-bootstrap.mjs +271 -317
  467. package/tools/backends/compiler-browser.mjs +7 -9
  468. package/tools/backends/compiler-build.mjs +77 -97
  469. package/tools/backends/compiler-cli-ground.mjs +47 -47
  470. package/tools/backends/compiler-data-transport.mjs +27 -31
  471. package/tools/backends/compiler-host-iteration.mjs +13 -21
  472. package/tools/backends/compiler-host-record.mjs +28 -34
  473. package/tools/backends/compiler-metadata.mjs +145 -53
  474. package/tools/backends/compiler-package-ground.mjs +39 -47
  475. package/tools/backends/compiler-package-loader.mjs +164 -206
  476. package/tools/backends/compiler-session.mjs +432 -324
  477. package/tools/backends/compiler-worker.mjs +79 -89
  478. package/tools/backends/dist/bootstrap-js-stages.mjs +17 -19
  479. package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -1
  480. package/tools/backends/dist/managed-ir-inventory.mjs +1 -1
  481. package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -1
  482. package/tools/backends/dist/release-cli.mjs +151 -22
  483. package/tools/backends/dist/release-cli.mjs.map +1 -1
  484. package/tools/backends/dist/run-artifact.mjs +54 -76
  485. package/tools/backends/dist/run-artifact.mjs.map +1 -1
  486. package/tools/backends/managed-foreign-binding.mjs +370 -114
  487. package/tools/backends/managed-host-ground.mjs +14 -17
  488. package/tools/backends/managed-host-lifecycle.mjs +42 -53
  489. package/tools/backends/managed-host-object-realm.mjs +121 -111
  490. package/tools/backends/managed-host-proxy.mjs +5 -7
  491. package/tools/backends/managed-host-runtime.mjs +6295 -4350
  492. package/tools/backends/managed-host.mjs +234 -188
  493. package/tools/backends/managed-layout.mjs +53 -56
  494. package/tools/backends/managed-module-graph-ground.mjs +488 -568
  495. package/tools/backends/managed-module-graph.mjs +62 -76
  496. package/tools/backends/managed-runtime-host-ground.mjs +352 -400
  497. package/tools/backends/managed-runtime.mjs +227 -266
  498. package/tools/backends/managed-source-view-ground.mjs +165 -161
  499. package/tools/backends/managed-source-view.mjs +415 -154
  500. package/tools/backends/native-managed-runtime.mjs +96 -138
  501. package/tools/backends/native-memory.mjs +1122 -742
  502. package/tools/backends/native-node-ffi.mjs +2439 -0
  503. package/tools/backends/native-node-memory.mjs +793 -383
  504. package/tools/backends/native-node-runner.mjs +1458 -579
  505. package/tools/backends/native-node-watchdog.mjs +12 -14
  506. package/tools/backends/native-node-worker.mjs +46 -50
  507. package/tools/backends/stage3-targets.mjs +2 -2
  508. package/tools/bootstrap-runtime.el +4 -4
  509. package/tools/collections/transient-builder-benchmark.mjs +17 -17
  510. package/tools/project/check-cli.eli +27 -3
  511. package/tools/project/project-cli.eli +1 -1
  512. package/tools/testing/maintained-suite-source.mjs +5 -7
  513. package/tools/testing/maintained-suite-source.mjs.map +1 -1
  514. package/dist/literal-sources/stdlib/core/data.eli +0 -306
  515. package/dist/literal-sources/stdlib/managed-transient-state.eli +0 -353
  516. package/stdlib/core/data-text.eli +0 -16
  517. package/stdlib/core/data.eli +0 -306
  518. package/stdlib/core/identifier.eli +0 -32
  519. package/stdlib/core/regex.eli +0 -17
  520. package/stdlib/deferred.eli +0 -70
  521. package/stdlib/managed-runtime-lazy-sequence.eli +0 -157
  522. package/stdlib/managed-transient-state.eli +0 -353
  523. /package/{stdlib → runtime/managed}/managed-protocol-error.eli +0 -0
  524. /package/{stdlib → runtime/managed}/managed-runtime-literals.eli +0 -0
  525. /package/{stdlib → runtime/managed}/managed-runtime-truth.eli +0 -0
  526. /package/{stdlib → runtime/managed}/managed-testing-value.eli +0 -0
@@ -97,13 +97,11 @@ function read_val(a, v) {
97
97
  while (__eliscript_numeric_relation("<", index, len)) {
98
98
  {
99
99
  let child = (a)["get"](v, index);
100
- (() => {
101
- try {
102
- return (output)["push"](read_val(a, child));
103
- } finally {
104
- (a)["release"](child);
105
- }
106
- })();
100
+ try {
101
+ (output)["push"](read_val(a, child));
102
+ } finally {
103
+ (a)["release"](child);
104
+ }
107
105
  }
108
106
  ((index = (index + 1)));
109
107
  }
@@ -126,13 +124,11 @@ function value(a, name, ...__host_default_arguments_1) {
126
124
  let arguments_list = __eliscript_value_1;
127
125
  {
128
126
  let result = (a)["invoke"](name, ((arguments_list === undefined) ? [] : arguments_list));
129
- return (() => {
130
- try {
131
- return read_val(a, result);
132
- } finally {
133
- (a)["release"](result);
134
- }
135
- })();
127
+ try {
128
+ return read_val(a, result);
129
+ } finally {
130
+ (a)["release"](result);
131
+ }
136
132
  }
137
133
  }
138
134
  }
@@ -156,18 +152,16 @@ function invoke_val(a, name, ...__host_default_arguments_2) {
156
152
  {
157
153
  let roots = [];
158
154
  let list_in = ((inputs === undefined) ? [] : inputs);
159
- return (() => {
160
- try {
161
- (list_in)["forEach"](((input) => {
162
- return (roots)["push"](box(a, input));
163
- }));
164
- return value(a, name, roots);
165
- } finally {
166
- (roots)["forEach"](((r) => {
167
- return (a)["release"](r);
168
- }));
169
- }
170
- })();
155
+ try {
156
+ (list_in)["forEach"](((input) => {
157
+ return (roots)["push"](box(a, input));
158
+ }));
159
+ return value(a, name, roots);
160
+ } finally {
161
+ (roots)["forEach"](((r) => {
162
+ return (a)["release"](r);
163
+ }));
164
+ }
171
165
  }
172
166
  }
173
167
  }
@@ -176,21 +170,19 @@ function exact(actual, expected, label) {
176
170
  return assert(Object.is(actual, expected), (String(label) + String(": got ") + String(globalThis.String(actual)) + String(", expected ") + String(globalThis.String(expected))));
177
171
  }
178
172
  function finish(a) {
179
- return (() => {
180
- try {
181
- (a)["closeModule"]();
182
- (a)["collect"]();
183
- (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
184
- return (assert)["equal"]((a)["live"](), 0);
185
- } finally {
186
- {
187
- let cl = (a)["close"];
188
- if ((__eliscript_value_type(cl) === "function")) {
189
- (a)["close"]();
190
- }
173
+ try {
174
+ (a)["closeModule"]();
175
+ (a)["collect"]();
176
+ (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
177
+ return (assert)["equal"]((a)["live"](), 0);
178
+ } finally {
179
+ {
180
+ let cl = (a)["close"];
181
+ if ((__eliscript_value_type(cl) === "function")) {
182
+ (a)["close"]();
191
183
  }
192
184
  }
193
- })();
185
+ }
194
186
  }
195
187
  function compare_fixture(a, reference, name, ...__host_default_arguments_3) {
196
188
  {
@@ -218,63 +210,59 @@ function check_namespace(a, reference) {
218
210
  let abs_key = (a)["string"]("abs");
219
211
  let abs_fn = (a)["invoke"]("namespace-pass", [ns, abs_key]);
220
212
  let qualified = (a)["invoke"]("qualified-abs-value");
221
- return (() => {
222
- try {
223
- (assert)["equal"]((ns)["kind"], 13, "Math is an ordinary namespace object");
224
- assert((a)["keyEqual"](ns, glob));
225
- assert((a)["keyEqual"](ns, raw));
226
- assert((a)["keyEqual"](abs_fn, qualified));
227
- (Object.keys((__eliscript_tdz_ready_21 === true ? method_lengths : __eliscript_tdz_error("method_lengths"))))["forEach"](((name) => {
228
- return compare_fixture(a, reference, "method-description", [name]);
229
- }));
230
- ((__eliscript_tdz_ready_20 === true ? constants : __eliscript_tdz_error("constants")))["forEach"](((name) => {
231
- return compare_fixture(a, reference, "constant-description", [name]);
232
- }));
233
- compare_fixture(a, reference, "method-description", ["sqrt"]);
234
- ([1, -0.0, (globalThis.Number)["MIN_VALUE"], (globalThis.Number)["MAX_VALUE"], -1])["forEach"](((input) => {
235
- return exact(invoke_val(a, "math-invoke", ["sqrt", input]), Math.sqrt(input), "namespace sqrt receiver");
236
- }));
237
- (["acos", "random"])["forEach"](((name) => {
238
- compare_fixture(a, reference, "method-description", [name]);
239
- {
240
- let actual = invoke_val(a, "math-invoke", [name, 1]);
241
- if ((name === "acos")) {
242
- return exact(actual, Math.acos(1), "the original acos input now executes exactly");
243
- } else {
244
- return assert((__eliscript_numeric_relation(">=", actual, 0) && __eliscript_numeric_relation("<", actual, 1)), "the original random input executes while its extra argument remains ignored");
245
- }
246
- }
247
- }));
248
- {
249
- let names = value(a, "namespace-names");
250
- let expected_keys = (((__eliscript_tdz_ready_20 === true ? constants : __eliscript_tdz_error("constants")))["concat"](Object.keys((__eliscript_tdz_ready_21 === true ? method_lengths : __eliscript_tdz_error("method_lengths")))))["concat"](["acos", "sqrt", "random"]);
251
- (expected_keys)["forEach"](((key) => {
252
- return assert((names)["includes"](key));
253
- }));
254
- assert((names)["every"](((key) => {
255
- return ((__eliscript_value_type(key) === "string") && (!__eliscript_truthy((key)["startsWith"]("__eliscript"))));
256
- })), "private holder and cache keys must not become visible own properties");
257
- }
258
- (a)["collect"]();
213
+ try {
214
+ (assert)["equal"]((ns)["kind"], 13, "Math is an ordinary namespace object");
215
+ assert((a)["keyEqual"](ns, glob));
216
+ assert((a)["keyEqual"](ns, raw));
217
+ assert((a)["keyEqual"](abs_fn, qualified));
218
+ (Object.keys((__eliscript_tdz_ready_21 === true ? method_lengths : __eliscript_tdz_error("method_lengths"))))["forEach"](((name) => {
219
+ return compare_fixture(a, reference, "method-description", [name]);
220
+ }));
221
+ ((__eliscript_tdz_ready_20 === true ? constants : __eliscript_tdz_error("constants")))["forEach"](((name) => {
222
+ return compare_fixture(a, reference, "constant-description", [name]);
223
+ }));
224
+ compare_fixture(a, reference, "method-description", ["sqrt"]);
225
+ ([1, -0.0, (globalThis.Number)["MIN_VALUE"], (globalThis.Number)["MAX_VALUE"], -1])["forEach"](((input) => {
226
+ return exact(invoke_val(a, "math-invoke", ["sqrt", input]), Math.sqrt(input), "namespace sqrt receiver");
227
+ }));
228
+ (["acos", "random"])["forEach"](((name) => {
229
+ compare_fixture(a, reference, "method-description", [name]);
259
230
  {
260
- let again = (a)["invoke"]("namespace-value");
261
- let again_abs = (a)["invoke"]("qualified-abs-value");
262
- return (() => {
263
- try {
264
- assert((a)["keyEqual"](ns, again));
265
- return assert((a)["keyEqual"](abs_fn, again_abs));
266
- } finally {
267
- (a)["release"](again);
268
- (a)["release"](again_abs);
269
- }
270
- })();
231
+ let actual = invoke_val(a, "math-invoke", [name, 1]);
232
+ if ((name === "acos")) {
233
+ return exact(actual, Math.acos(1), "the original acos input now executes exactly");
234
+ } else {
235
+ return assert((__eliscript_numeric_relation(">=", actual, 0) && __eliscript_numeric_relation("<", actual, 1)), "the original random input executes while its extra argument remains ignored");
236
+ }
271
237
  }
272
- } finally {
273
- ([ns, glob, raw, abs_key, abs_fn, qualified])["forEach"](((r) => {
274
- return (a)["release"](r);
238
+ }));
239
+ {
240
+ let names = value(a, "namespace-names");
241
+ let expected_keys = (((__eliscript_tdz_ready_20 === true ? constants : __eliscript_tdz_error("constants")))["concat"](Object.keys((__eliscript_tdz_ready_21 === true ? method_lengths : __eliscript_tdz_error("method_lengths")))))["concat"](["acos", "sqrt", "random"]);
242
+ (expected_keys)["forEach"](((key) => {
243
+ return assert((names)["includes"](key));
275
244
  }));
245
+ assert((names)["every"](((key) => {
246
+ return ((__eliscript_value_type(key) === "string") && (!__eliscript_truthy((key)["startsWith"]("__eliscript"))));
247
+ })), "private holder and cache keys must not become visible own properties");
248
+ }
249
+ (a)["collect"]();
250
+ {
251
+ let again = (a)["invoke"]("namespace-value");
252
+ let again_abs = (a)["invoke"]("qualified-abs-value");
253
+ try {
254
+ assert((a)["keyEqual"](ns, again));
255
+ return assert((a)["keyEqual"](abs_fn, again_abs));
256
+ } finally {
257
+ (a)["release"](again);
258
+ (a)["release"](again_abs);
259
+ }
276
260
  }
277
- })();
261
+ } finally {
262
+ ([ns, glob, raw, abs_key, abs_fn, qualified])["forEach"](((r) => {
263
+ return (a)["release"](r);
264
+ }));
265
+ }
278
266
  }
279
267
  }
280
268
  function check_mutations(a, reference) {
@@ -297,22 +285,20 @@ function check_mutations(a, reference) {
297
285
  let ns = (a)["invoke"]("namespace-value");
298
286
  let fround_key = (a)["string"]("fround");
299
287
  let fround_fn = (a)["invoke"]("namespace-pass", [ns, fround_key]);
300
- (() => {
301
- try {
302
- exact(value(a, "set-namespace-state", [negative_zero]), -0.0, "namespace mutation");
303
- (a)["collect"]();
304
- exact(value(a, "read-namespace-state"), -0.0, "namespace mutation after GC");
305
- {
306
- let captured = value(a, "invoke-held", [fround_fn, negative_zero]);
307
- return exact(captured, Math.fround(-0.0), "method held through namespace back-edge");
308
- }
309
- } finally {
310
- (a)["release"](negative_zero);
311
- (a)["release"](ns);
312
- (a)["release"](fround_key);
313
- (a)["release"](fround_fn);
288
+ try {
289
+ exact(value(a, "set-namespace-state", [negative_zero]), -0.0, "namespace mutation");
290
+ (a)["collect"]();
291
+ exact(value(a, "read-namespace-state"), -0.0, "namespace mutation after GC");
292
+ {
293
+ let captured = value(a, "invoke-held", [fround_fn, negative_zero]);
294
+ exact(captured, Math.fround(-0.0), "method held through namespace back-edge");
314
295
  }
315
- })();
296
+ } finally {
297
+ (a)["release"](negative_zero);
298
+ (a)["release"](ns);
299
+ (a)["release"](fround_key);
300
+ (a)["release"](fround_fn);
301
+ }
316
302
  }
317
303
  (a)["collect"]();
318
304
  exact(value(a, "read-namespace-state"), -0.0, "public mutation without caller roots");
@@ -480,36 +466,32 @@ function check_fround(a, inputs) {
480
466
  {
481
467
  let key = (a)["string"]("fround");
482
468
  let method = (a)["invoke"]("namespace-get", [key]);
483
- return (() => {
484
- try {
485
- {
486
- let index = 0;
487
- while (__eliscript_numeric_relation("<", index, (inputs)["length"])) {
469
+ try {
470
+ {
471
+ let index = 0;
472
+ while (__eliscript_numeric_relation("<", index, (inputs)["length"])) {
473
+ {
474
+ let input = (inputs)[index];
475
+ let expected = Math.fround(input);
476
+ exact(invoke_val(a, "direct-fround", [input]), expected, (String("direct fround case ") + String(index)));
477
+ exact(invoke_val(a, "math-invoke", ["fround", input]), expected, (String("dynamic fround case ") + String(index)));
488
478
  {
489
- let input = (inputs)[index];
490
- let expected = Math.fround(input);
491
- exact(invoke_val(a, "direct-fround", [input]), expected, (String("direct fround case ") + String(index)));
492
- exact(invoke_val(a, "math-invoke", ["fround", input]), expected, (String("dynamic fround case ") + String(index)));
493
- {
494
- let argument = (a)["number"](input);
495
- (() => {
496
- try {
497
- return exact(value(a, "invoke-held", [method, argument]), expected, (String("held fround case ") + String(index)));
498
- } finally {
499
- (a)["release"](argument);
500
- }
501
- })();
479
+ let argument = (a)["number"](input);
480
+ try {
481
+ exact(value(a, "invoke-held", [method, argument]), expected, (String("held fround case ") + String(index)));
482
+ } finally {
483
+ (a)["release"](argument);
502
484
  }
503
485
  }
504
- ((index = (index + 1)));
505
486
  }
487
+ ((index = (index + 1)));
506
488
  }
507
- return (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
508
- } finally {
509
- (a)["release"](key);
510
- (a)["release"](method);
511
489
  }
512
- })();
490
+ return (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
491
+ } finally {
492
+ (a)["release"](key);
493
+ (a)["release"](method);
494
+ }
513
495
  }
514
496
  }
515
497
  function number_word(num) {
@@ -668,52 +650,48 @@ function check_f16(a) {
668
650
  {
669
651
  let key = (a)["string"]("f16round");
670
652
  let method = (a)["invoke"]("namespace-get", [key]);
671
- return (() => {
672
- try {
673
- (assert)["deepEqual"](invoke_val(a, "method-description", ["f16round"]), [true, true, true, false, true, "f16round", 1, false]);
674
- {
675
- let inputs = (f16_boundaries())["concat"]((fround_random())["slice"](0, 48));
676
- let index = 0;
677
- let host_f16 = (globalThis.Math)["f16round"];
678
- while (__eliscript_numeric_relation("<", index, (inputs)["length"])) {
653
+ try {
654
+ (assert)["deepEqual"](invoke_val(a, "method-description", ["f16round"]), [true, true, true, false, true, "f16round", 1, false]);
655
+ {
656
+ let inputs = (f16_boundaries())["concat"]((fround_random())["slice"](0, 48));
657
+ let index = 0;
658
+ let host_f16 = (globalThis.Math)["f16round"];
659
+ while (__eliscript_numeric_relation("<", index, (inputs)["length"])) {
660
+ {
661
+ let input = (inputs)[index];
662
+ let expected = f16_model(input);
663
+ if ((__eliscript_value_type(host_f16) === "function")) {
664
+ exact_bits((globalThis.Math)["f16round"](input), expected, (String("host f16 oracle ") + String(index)));
665
+ }
666
+ exact_bits(invoke_val(a, "direct-f16round", [input]), expected, (String("direct f16 case ") + String(index)));
667
+ exact_bits(invoke_val(a, "math-invoke", ["f16round", input]), expected, (String("dynamic f16 case ") + String(index)));
679
668
  {
680
- let input = (inputs)[index];
681
- let expected = f16_model(input);
682
- if ((__eliscript_value_type(host_f16) === "function")) {
683
- exact_bits((globalThis.Math)["f16round"](input), expected, (String("host f16 oracle ") + String(index)));
684
- }
685
- exact_bits(invoke_val(a, "direct-f16round", [input]), expected, (String("direct f16 case ") + String(index)));
686
- exact_bits(invoke_val(a, "math-invoke", ["f16round", input]), expected, (String("dynamic f16 case ") + String(index)));
687
- {
688
- let argument = (a)["number"](input);
689
- (() => {
690
- try {
691
- return exact_bits(value(a, "invoke-held", [method, argument]), expected, (String("held f16 case ") + String(index)));
692
- } finally {
693
- (a)["release"](argument);
694
- }
695
- })();
669
+ let argument = (a)["number"](input);
670
+ try {
671
+ exact_bits(value(a, "invoke-held", [method, argument]), expected, (String("held f16 case ") + String(index)));
672
+ } finally {
673
+ (a)["release"](argument);
696
674
  }
697
675
  }
698
- ((index = (index + 1)));
699
676
  }
677
+ ((index = (index + 1)));
700
678
  }
701
- ((__eliscript_tdz_ready_22 === true ? primitives : __eliscript_tdz_error("primitives")))["forEach"](((input) => {
702
- return exact_bits(invoke_val(a, "direct-f16round", [input]), f16_model(input), (String("f16 primitive ") + String(globalThis.String(input))));
703
- }));
704
- exact_bits(invoke_val(a, "math-invoke", ["f16round"]), (globalThis.Number)["NaN"], "f16 omitted argument");
705
- exact_bits(invoke_val(a, "math-invoke", ["f16round", -0.0, 19]), -0.0, "f16 ignored extra argument");
706
- (assert)["deepEqual"](invoke_val(a, "conversion-order", ["f16round"]), [-1.5, ["arg-a", "arg-b", "arg-extra", "a.valueOf", "a.toString"]]);
707
- (assert)["deepEqual"](invoke_val(a, "conversion-hint", ["f16round"]), [-0.0, ["number", true]]);
708
- (assert)["deepEqual"](invoke_val(a, "primitive-rejections", ["f16round"]), ["TypeError", "TypeError", "TypeError"]);
709
- (assert)["deepEqual"](invoke_val(a, "conversion-abrupt", ["f16round", 0]), ["marker", ["arg-a", "arg-b", "a.valueOf"], 9]);
710
- (assert)["deepEqual"](invoke_val(a, "conversion-abrupt", ["f16round", 2]), ["TypeError", ["arg-a", "arg-b", "a.valueOf", "a.toString"], 9]);
711
- return (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
712
- } finally {
713
- (a)["release"](method);
714
- (a)["release"](key);
715
679
  }
716
- })();
680
+ ((__eliscript_tdz_ready_22 === true ? primitives : __eliscript_tdz_error("primitives")))["forEach"](((input) => {
681
+ return exact_bits(invoke_val(a, "direct-f16round", [input]), f16_model(input), (String("f16 primitive ") + String(globalThis.String(input))));
682
+ }));
683
+ exact_bits(invoke_val(a, "math-invoke", ["f16round"]), (globalThis.Number)["NaN"], "f16 omitted argument");
684
+ exact_bits(invoke_val(a, "math-invoke", ["f16round", -0.0, 19]), -0.0, "f16 ignored extra argument");
685
+ (assert)["deepEqual"](invoke_val(a, "conversion-order", ["f16round"]), [-1.5, ["arg-a", "arg-b", "arg-extra", "a.valueOf", "a.toString"]]);
686
+ (assert)["deepEqual"](invoke_val(a, "conversion-hint", ["f16round"]), [-0.0, ["number", true]]);
687
+ (assert)["deepEqual"](invoke_val(a, "primitive-rejections", ["f16round"]), ["TypeError", "TypeError", "TypeError"]);
688
+ (assert)["deepEqual"](invoke_val(a, "conversion-abrupt", ["f16round", 0]), ["marker", ["arg-a", "arg-b", "a.valueOf"], 9]);
689
+ (assert)["deepEqual"](invoke_val(a, "conversion-abrupt", ["f16round", 2]), ["TypeError", ["arg-a", "arg-b", "a.valueOf", "a.toString"], 9]);
690
+ return (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
691
+ } finally {
692
+ (a)["release"](method);
693
+ (a)["release"](key);
694
+ }
717
695
  }
718
696
  }
719
697
  function sum_precise_model(iterable) {
@@ -753,27 +731,21 @@ function sum_precise_model(iterable) {
753
731
  if ((!(__eliscript_value_type(item) === "number"))) {
754
732
  {
755
733
  let original = new (globalThis.TypeError)("sumPrecise requires Number elements");
756
- (() => {
757
- try {
758
- {
759
- let close_fn = (iterator)["return"];
760
- if (!((close_fn == null))) {
761
- {
762
- let closed = __eliscript_at(Reflect, "apply")(close_fn, iterator, []);
763
- if ((!__eliscript_truthy(is_obj(closed)))) {
764
- return ((__eliscript_value_8) => { throw __eliscript_value_8; })(new (globalThis.TypeError)("iterator return must be an object"));
765
- } else {
766
- return null;
767
- }
734
+ try {
735
+ {
736
+ let close_fn = (iterator)["return"];
737
+ if (!((close_fn == null))) {
738
+ {
739
+ let closed = __eliscript_at(Reflect, "apply")(close_fn, iterator, []);
740
+ if ((!__eliscript_truthy(is_obj(closed)))) {
741
+ ((__eliscript_value_8) => { throw __eliscript_value_8; })(new (globalThis.TypeError)("iterator return must be an object"));
768
742
  }
769
- } else {
770
- return null;
771
743
  }
772
744
  }
773
- } catch (_ignored) {
774
- return null;
775
745
  }
776
- })();
746
+ } catch (_ignored) {
747
+ null;
748
+ }
777
749
  ((__eliscript_value_9) => { throw __eliscript_value_9; })(original);
778
750
  }
779
751
  }
@@ -992,18 +964,16 @@ function sum_iterator_observation(mode, ...__host_default_arguments_4) {
992
964
  function sum_array(a, numbers) {
993
965
  {
994
966
  let roots = [];
995
- return (() => {
996
- try {
997
- (numbers)["forEach"](((num) => {
998
- return (roots)["push"]((a)["number"](num));
999
- }));
1000
- return (a)["sourceArray"](roots);
1001
- } finally {
1002
- (roots)["forEach"](((r) => {
1003
- return (a)["release"](r);
1004
- }));
1005
- }
1006
- })();
967
+ try {
968
+ (numbers)["forEach"](((num) => {
969
+ return (roots)["push"]((a)["number"](num));
970
+ }));
971
+ return (a)["sourceArray"](roots);
972
+ } finally {
973
+ (roots)["forEach"](((r) => {
974
+ return (a)["release"](r);
975
+ }));
976
+ }
1007
977
  }
1008
978
  }
1009
979
  function check_host_sum_oracle() {
@@ -1066,99 +1036,90 @@ function check_sum_precise(a, ...__host_forwarded_arguments_2) {
1066
1036
  {
1067
1037
  let key = (a)["string"]("sumPrecise");
1068
1038
  let method = (a)["invoke"]("namespace-get", [key]);
1069
- return (() => {
1070
- try {
1071
- {
1072
- let samples = sum_samples();
1073
- let index = 0;
1074
- while (__eliscript_numeric_relation("<", index, (samples)["length"])) {
1075
- {
1076
- let numbers = (samples)[index];
1077
- let expected = sum_precise_model(numbers);
1078
- let arr = sum_array(a, numbers);
1079
- (() => {
1080
- try {
1081
- exact_bits(value(a, "sum-direct", [arr]), expected, (String("direct precise sum ") + String(index)));
1082
- exact_bits(value(a, "sum-dynamic", [arr]), expected, (String("dynamic precise sum ") + String(index)));
1083
- (a)["collect"]();
1084
- exact_bits(value(a, "invoke-held", [method, arr]), expected, (String("held precise sum after GC ") + String(index)));
1085
- (assert)["equal"]((a)["length"](arr), (numbers)["length"], "sum leaves its source array unchanged");
1039
+ try {
1040
+ {
1041
+ let samples = sum_samples();
1042
+ let index = 0;
1043
+ while (__eliscript_numeric_relation("<", index, (samples)["length"])) {
1044
+ {
1045
+ let numbers = (samples)[index];
1046
+ let expected = sum_precise_model(numbers);
1047
+ let arr = sum_array(a, numbers);
1048
+ try {
1049
+ exact_bits(value(a, "sum-direct", [arr]), expected, (String("direct precise sum ") + String(index)));
1050
+ exact_bits(value(a, "sum-dynamic", [arr]), expected, (String("dynamic precise sum ") + String(index)));
1051
+ (a)["collect"]();
1052
+ exact_bits(value(a, "invoke-held", [method, arr]), expected, (String("held precise sum after GC ") + String(index)));
1053
+ (assert)["equal"]((a)["length"](arr), (numbers)["length"], "sum leaves its source array unchanged");
1054
+ {
1055
+ let at = 0;
1056
+ while (__eliscript_numeric_relation("<", at, (numbers)["length"])) {
1086
1057
  {
1087
- let at = 0;
1088
- while (__eliscript_numeric_relation("<", at, (numbers)["length"])) {
1089
- {
1090
- let item = (a)["get"](arr, at);
1091
- (() => {
1092
- try {
1093
- return exact_bits((a)["readNumber"](item), (numbers)[at], (String("unchanged sum item ") + String(at)));
1094
- } finally {
1095
- (a)["release"](item);
1096
- }
1097
- })();
1098
- }
1099
- ((at = (at + 1)));
1058
+ let item = (a)["get"](arr, at);
1059
+ try {
1060
+ exact_bits((a)["readNumber"](item), (numbers)[at], (String("unchanged sum item ") + String(at)));
1061
+ } finally {
1062
+ (a)["release"](item);
1100
1063
  }
1101
- return null;
1102
1064
  }
1103
- } finally {
1104
- (a)["release"](arr);
1065
+ ((at = (at + 1)));
1105
1066
  }
1106
- })();
1107
- (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
1067
+ }
1068
+ } finally {
1069
+ (a)["release"](arr);
1108
1070
  }
1109
- ((index = (index + 1)));
1071
+ (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
1110
1072
  }
1073
+ ((index = (index + 1)));
1111
1074
  }
1112
- rec("sum/samples-complete");
1113
- {
1114
- let mode = 0;
1115
- while (__eliscript_numeric_relation("<=", mode, 29)) {
1116
- rec((String("sum/iterator/") + String(mode) + String("/before")));
1117
- {
1118
- let expected = sum_iterator_observation(mode);
1119
- (assert)["deepEqual"](invoke_val(a, "sum-iterator-case", [mode]), expected, (String("sum iterator mode ") + String(mode)));
1120
- assert((!__eliscript_truthy(((expected)[1])["some"](((item) => {
1121
- return ((item === "bad.valueOf") || (item === "bad.toString"));
1122
- })))), "non-Numbers are never converted");
1123
- if (__eliscript_truthy(([1, 2, 3, 4, 12, 13, 14, 15, 21])["includes"](mode))) {
1124
- assert((!__eliscript_truthy(((expected)[1])["includes"]("return.get"))), "IteratorStepValue failures must not close");
1125
- }
1126
- if (__eliscript_truthy(([5, 6, 7, 8, 9, 10, 11, 19, 20, 22, 23, 25, 26, 27, 28, 29])["includes"](mode))) {
1127
- (assert)["equal"]((expected)[0], "TypeError", "bad element remains the first error even if closing fails");
1128
- assert(((expected)[1])["includes"]("return.get"), "bad elements must close their iterator");
1129
- }
1130
- (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
1075
+ }
1076
+ rec("sum/samples-complete");
1077
+ {
1078
+ let mode = 0;
1079
+ while (__eliscript_numeric_relation("<=", mode, 29)) {
1080
+ rec((String("sum/iterator/") + String(mode) + String("/before")));
1081
+ {
1082
+ let expected = sum_iterator_observation(mode);
1083
+ (assert)["deepEqual"](invoke_val(a, "sum-iterator-case", [mode]), expected, (String("sum iterator mode ") + String(mode)));
1084
+ assert((!__eliscript_truthy(((expected)[1])["some"](((item) => {
1085
+ return ((item === "bad.valueOf") || (item === "bad.toString"));
1086
+ })))), "non-Numbers are never converted");
1087
+ if (__eliscript_truthy(([1, 2, 3, 4, 12, 13, 14, 15, 21])["includes"](mode))) {
1088
+ assert((!__eliscript_truthy(((expected)[1])["includes"]("return.get"))), "IteratorStepValue failures must not close");
1089
+ }
1090
+ if (__eliscript_truthy(([5, 6, 7, 8, 9, 10, 11, 19, 20, 22, 23, 25, 26, 27, 28, 29])["includes"](mode))) {
1091
+ (assert)["equal"]((expected)[0], "TypeError", "bad element remains the first error even if closing fails");
1092
+ assert(((expected)[1])["includes"]("return.get"), "bad elements must close their iterator");
1131
1093
  }
1132
- rec((String("sum/iterator/") + String(mode) + String("/complete")));
1133
- ((mode = (mode + 1)));
1094
+ (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
1134
1095
  }
1096
+ rec((String("sum/iterator/") + String(mode) + String("/complete")));
1097
+ ((mode = (mode + 1)));
1135
1098
  }
1136
- rec("sum/iterators-complete");
1137
- rec("sum/extra-order-before");
1138
- (assert)["deepEqual"](value(a, "sum-extra-order"), [3, ["get", "values", "extra"]]);
1139
- rec("sum/extra-order-complete");
1140
- (assert)["equal"](value(a, "sum-array-like-rejection"), "TypeError");
1141
- exact_bits(invoke_val(a, "sum-direct", [""]), -0.0, "an empty String is a real empty iterable");
1142
- ([undefined, null, false, 1, "12"])["forEach"](((input) => {
1143
- return (assert)["throws"]((() => {
1144
- return invoke_val(a, "sum-direct", [input]);
1145
- }), globalThis.TypeError, "sum rejects a noniterable or non-Number element");
1146
- }));
1147
- {
1148
- let empty = (a)["sourceArray"]([]);
1149
- return (() => {
1150
- try {
1151
- return exact_bits(value(a, "sum-direct", [empty]), -0.0, "recovery after iterator errors");
1152
- } finally {
1153
- (a)["release"](empty);
1154
- }
1155
- })();
1099
+ }
1100
+ rec("sum/iterators-complete");
1101
+ rec("sum/extra-order-before");
1102
+ (assert)["deepEqual"](value(a, "sum-extra-order"), [3, ["get", "values", "extra"]]);
1103
+ rec("sum/extra-order-complete");
1104
+ (assert)["equal"](value(a, "sum-array-like-rejection"), "TypeError");
1105
+ exact_bits(invoke_val(a, "sum-direct", [""]), -0.0, "an empty String is a real empty iterable");
1106
+ ([undefined, null, false, 1, "12"])["forEach"](((input) => {
1107
+ return (assert)["throws"]((() => {
1108
+ return invoke_val(a, "sum-direct", [input]);
1109
+ }), globalThis.TypeError, "sum rejects a noniterable or non-Number element");
1110
+ }));
1111
+ {
1112
+ let empty = (a)["sourceArray"]([]);
1113
+ try {
1114
+ return exact_bits(value(a, "sum-direct", [empty]), -0.0, "recovery after iterator errors");
1115
+ } finally {
1116
+ (a)["release"](empty);
1156
1117
  }
1157
- } finally {
1158
- (a)["release"](method);
1159
- (a)["release"](key);
1160
1118
  }
1161
- })();
1119
+ } finally {
1120
+ (a)["release"](method);
1121
+ (a)["release"](key);
1122
+ }
1162
1123
  }
1163
1124
  }
1164
1125
  }
@@ -1174,69 +1135,61 @@ function check_pressure(a) {
1174
1135
  {
1175
1136
  let sum_input = (a)["sourceArray"]([saved]);
1176
1137
  (a)["frameSet"](frame, 0, saved);
1177
- (() => {
1178
- try {
1179
- {
1180
- let index = 0;
1181
- while ((__eliscript_numeric_relation("<=", index, 1024) && !(__eliscript_truthy(exhausted)))) {
1182
- (() => {
1183
- try {
1184
- return (fillers)["push"]((a)["array"]());
1185
- } catch (error) {
1186
- {
1187
- let diag = (error)["eliscriptDiagnostic"];
1188
- (assert)["equal"](((diag == null) ? undefined : (diag)["code"]), "ELI-RT0002");
1189
- return ((exhausted = true));
1190
- }
1191
- }
1192
- })();
1193
- ((index = (index + 1)));
1194
- }
1195
- }
1196
- assert(exhausted, "the unchanged default 1024-slot budget must be exhausted");
1197
- ([["direct-fround", saved], ["direct-f16round", saved], ["sum-direct", sum_input]])["forEach"](((pair) => {
1198
- return (assert)["throws"]((() => {
1199
- return (a)["invoke"]((pair)[0], [(pair)[1]]);
1200
- }), ((error) => {
1138
+ try {
1139
+ {
1140
+ let index = 0;
1141
+ while ((__eliscript_numeric_relation("<=", index, 2048) && !(__eliscript_truthy(exhausted)))) {
1142
+ try {
1143
+ (fillers)["push"]((a)["array"]());
1144
+ } catch (error) {
1201
1145
  {
1202
1146
  let diag = (error)["eliscriptDiagnostic"];
1203
- return ((!(diag == null)) && ((diag)["code"] === "ELI-RT0002"));
1204
- }
1205
- }));
1206
- }));
1207
- (assert)["equal"](((a)["stats"]())["frameDepth"], 1);
1208
- exact((a)["readNumber"](saved), -0.0, "caller root after capacity failure");
1209
- {
1210
- let item = (a)["get"](sum_input, 0);
1211
- return (() => {
1212
- try {
1213
- return exact_bits((a)["readNumber"](item), -0.0, "sum source root after capacity failure");
1214
- } finally {
1215
- (a)["release"](item);
1147
+ (assert)["equal"](((diag == null) ? undefined : (diag)["code"]), "ELI-RT0002");
1148
+ ((exhausted = true));
1216
1149
  }
1217
- })();
1150
+ }
1151
+ ((index = (index + 1)));
1218
1152
  }
1219
- } finally {
1220
- (fillers)["forEach"](((r) => {
1221
- return (a)["release"](r);
1222
- }));
1223
- (a)["leaveFrame"](frame);
1224
- (a)["release"](ns);
1225
1153
  }
1226
- })();
1227
- return (() => {
1228
- try {
1229
- (a)["collect"]();
1230
- exact(value(a, "direct-fround", [saved]), -0.0, "fround recovers after OOM");
1231
- exact_bits(value(a, "direct-f16round", [saved]), -0.0, "f16round recovers after OOM");
1232
- exact_bits(value(a, "sum-direct", [sum_input]), -0.0, "sumPrecise recovers after OOM");
1233
- exact(value(a, "direct-abs", [saved]), 0, "abs recovers after OOM");
1234
- return (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
1235
- } finally {
1236
- (a)["release"](sum_input);
1237
- (a)["release"](saved);
1154
+ assert(exhausted, "the unchanged default 1024-slot budget must be exhausted");
1155
+ ([["direct-fround", saved], ["direct-f16round", saved], ["sum-direct", sum_input]])["forEach"](((pair) => {
1156
+ return (assert)["throws"]((() => {
1157
+ return (a)["invoke"]((pair)[0], [(pair)[1]]);
1158
+ }), ((error) => {
1159
+ {
1160
+ let diag = (error)["eliscriptDiagnostic"];
1161
+ return ((!(diag == null)) && ((diag)["code"] === "ELI-RT0002"));
1162
+ }
1163
+ }));
1164
+ }));
1165
+ (assert)["equal"](((a)["stats"]())["frameDepth"], 1);
1166
+ exact((a)["readNumber"](saved), -0.0, "caller root after capacity failure");
1167
+ {
1168
+ let item = (a)["get"](sum_input, 0);
1169
+ try {
1170
+ exact_bits((a)["readNumber"](item), -0.0, "sum source root after capacity failure");
1171
+ } finally {
1172
+ (a)["release"](item);
1173
+ }
1238
1174
  }
1239
- })();
1175
+ } finally {
1176
+ (fillers)["forEach"](((r) => {
1177
+ return (a)["release"](r);
1178
+ }));
1179
+ (a)["leaveFrame"](frame);
1180
+ (a)["release"](ns);
1181
+ }
1182
+ try {
1183
+ (a)["collect"]();
1184
+ exact(value(a, "direct-fround", [saved]), -0.0, "fround recovers after OOM");
1185
+ exact_bits(value(a, "direct-f16round", [saved]), -0.0, "f16round recovers after OOM");
1186
+ exact_bits(value(a, "sum-direct", [sum_input]), -0.0, "sumPrecise recovers after OOM");
1187
+ exact(value(a, "direct-abs", [saved]), 0, "abs recovers after OOM");
1188
+ return (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
1189
+ } finally {
1190
+ (a)["release"](sum_input);
1191
+ (a)["release"](saved);
1192
+ }
1240
1193
  }
1241
1194
  }
1242
1195
  }
@@ -1279,48 +1232,44 @@ function check_math_composite(a, reference, frozen_reference, target) {
1279
1232
  check_fn(a);
1280
1233
  return record_stage((String(name) + String("/complete")));
1281
1234
  });
1282
- return (() => {
1283
- try {
1284
- run_group("namespace", ((rt) => {
1285
- return check_namespace(rt, reference);
1286
- }));
1287
- run_group("mutations", ((rt) => {
1288
- return check_mutations(rt, reference);
1289
- }));
1290
- run_group("unary", check_unary);
1291
- run_group("imul", check_imul);
1292
- run_group("conversions", ((rt) => {
1293
- return check_conversions(rt, reference);
1294
- }));
1295
- run_group("fround-boundaries", ((rt) => {
1296
- return check_fround(rt, fround_boundaries());
1297
- }));
1298
- run_group("fround-random", ((rt) => {
1299
- return check_fround(rt, fround_random());
1300
- }));
1301
- run_group("f16", check_f16);
1302
- run_group("sum", ((rt) => {
1303
- return check_sum_precise(rt, record_stage);
1304
- }));
1305
- run_group("pressure", check_pressure);
1306
- return run_group("freeze", ((rt) => {
1307
- return check_freeze(rt, frozen_reference);
1308
- }));
1309
- } catch (error) {
1310
- {
1311
- let failed_stage = stage;
1312
- record_stage((String(failed_stage) + String("/failure")));
1313
- (() => {
1314
- try {
1315
- return ((globalThis.process)["stderr"])["write"]((String("[math-composite-failure] ") + String(JSON.stringify(({"target": target, "stage": failed_stage, "snapshots": snapshots, "iteratorSnapshots": iterator_snapshots, "truncated": truncated}))) + String("\n")));
1316
- } catch (_ignored) {
1317
- return null;
1318
- }
1319
- })();
1235
+ try {
1236
+ run_group("namespace", ((rt) => {
1237
+ return check_namespace(rt, reference);
1238
+ }));
1239
+ run_group("mutations", ((rt) => {
1240
+ return check_mutations(rt, reference);
1241
+ }));
1242
+ run_group("unary", check_unary);
1243
+ run_group("imul", check_imul);
1244
+ run_group("conversions", ((rt) => {
1245
+ return check_conversions(rt, reference);
1246
+ }));
1247
+ run_group("fround-boundaries", ((rt) => {
1248
+ return check_fround(rt, fround_boundaries());
1249
+ }));
1250
+ run_group("fround-random", ((rt) => {
1251
+ return check_fround(rt, fround_random());
1252
+ }));
1253
+ run_group("f16", check_f16);
1254
+ run_group("sum", ((rt) => {
1255
+ return check_sum_precise(rt, record_stage);
1256
+ }));
1257
+ run_group("pressure", check_pressure);
1258
+ return run_group("freeze", ((rt) => {
1259
+ return check_freeze(rt, frozen_reference);
1260
+ }));
1261
+ } catch (error) {
1262
+ {
1263
+ let failed_stage = stage;
1264
+ record_stage((String(failed_stage) + String("/failure")));
1265
+ try {
1266
+ ((globalThis.process)["stderr"])["write"]((String("[math-composite-failure] ") + String(JSON.stringify(({"target": target, "stage": failed_stage, "snapshots": snapshots, "iteratorSnapshots": iterator_snapshots, "truncated": truncated}))) + String("\n")));
1267
+ } catch (_ignored) {
1268
+ null;
1320
1269
  }
1321
- return ((__eliscript_value_23) => { throw __eliscript_value_23; })(error);
1322
1270
  }
1323
- })();
1271
+ return ((__eliscript_value_23) => { throw __eliscript_value_23; })(error);
1272
+ }
1324
1273
  }
1325
1274
  }
1326
1275
  function sqrt_inputs() {
@@ -1360,98 +1309,86 @@ function check_sqrt_access(a, sqrt_reference, ...__host_default_arguments_5) {
1360
1309
  (a)["release"](first);
1361
1310
  }
1362
1311
  })();
1363
- return (() => {
1364
- try {
1365
- (assert)["equal"]((held)["kind"], 18);
1366
- {
1367
- let description = [true, true, true, "sqrt", 1, false, true, false, true, false, false, true, false, false, true];
1368
- (assert)["deepEqual"]((sqrt_reference)["sqrt_description"]((sqrt_reference)["sqrt_method"](fmode)), description);
1369
- (assert)["deepEqual"](value(a, "sqrt-description", [held]), description);
1370
- }
1371
- {
1372
- let mode = 0;
1373
- while (__eliscript_numeric_relation("<", mode, 3)) {
1374
- {
1375
- let mode_value = (a)["number"](mode);
1376
- (() => {
1312
+ try {
1313
+ (assert)["equal"]((held)["kind"], 18);
1314
+ {
1315
+ let description = [true, true, true, "sqrt", 1, false, true, false, true, false, false, true, false, false, true];
1316
+ (assert)["deepEqual"]((sqrt_reference)["sqrt_description"]((sqrt_reference)["sqrt_method"](fmode)), description);
1317
+ (assert)["deepEqual"](value(a, "sqrt-description", [held]), description);
1318
+ }
1319
+ {
1320
+ let mode = 0;
1321
+ while (__eliscript_numeric_relation("<", mode, 3)) {
1322
+ {
1323
+ let mode_value = (a)["number"](mode);
1324
+ try {
1325
+ {
1326
+ let again = (a)["invoke"]("sqrt-method", [mode_value]);
1377
1327
  try {
1378
- {
1379
- let again = (a)["invoke"]("sqrt-method", [mode_value]);
1380
- return (() => {
1381
- try {
1382
- return assert((a)["keyEqual"](again, held), "all sqrt reads must return the held callable");
1383
- } finally {
1384
- (a)["release"](again);
1385
- }
1386
- })();
1387
- }
1328
+ assert((a)["keyEqual"](again, held), "all sqrt reads must return the held callable");
1388
1329
  } finally {
1389
- (a)["release"](mode_value);
1330
+ (a)["release"](again);
1390
1331
  }
1391
- })();
1332
+ }
1333
+ } finally {
1334
+ (a)["release"](mode_value);
1392
1335
  }
1393
- ((mode = (mode + 1)));
1394
1336
  }
1337
+ ((mode = (mode + 1)));
1395
1338
  }
1396
- ([-0.0, 0, -1, (globalThis.Number)["MIN_VALUE"], (globalThis.Number)["MAX_VALUE"], (globalThis.Number)["NaN"], (globalThis.Number)["POSITIVE_INFINITY"], (globalThis.Number)["NEGATIVE_INFINITY"], "81"])["forEach"](((input) => {
1397
- {
1398
- let mode = 0;
1399
- while (__eliscript_numeric_relation("<", mode, 10)) {
1400
- {
1401
- let expected = (sqrt_reference)["sqrt_call"](mode, input);
1402
- exact(expected, Math.sqrt(input), (String("JS sqrt route ") + String(mode)));
1403
- exact(invoke_val(a, "sqrt-call", [mode, input]), expected, (String("managed sqrt route ") + String(mode)));
1404
- }
1405
- ((mode = (mode + 1)));
1339
+ }
1340
+ ([-0.0, 0, -1, (globalThis.Number)["MIN_VALUE"], (globalThis.Number)["MAX_VALUE"], (globalThis.Number)["NaN"], (globalThis.Number)["POSITIVE_INFINITY"], (globalThis.Number)["NEGATIVE_INFINITY"], "81"])["forEach"](((input) => {
1341
+ {
1342
+ let mode = 0;
1343
+ while (__eliscript_numeric_relation("<", mode, 10)) {
1344
+ {
1345
+ let expected = (sqrt_reference)["sqrt_call"](mode, input);
1346
+ exact(expected, Math.sqrt(input), (String("JS sqrt route ") + String(mode)));
1347
+ exact(invoke_val(a, "sqrt-call", [mode, input]), expected, (String("managed sqrt route ") + String(mode)));
1406
1348
  }
1407
- return null;
1349
+ ((mode = (mode + 1)));
1408
1350
  }
1409
- }));
1410
- (sqrt_inputs())["forEach"](((input) => {
1411
- exact(invoke_val(a, "sqrt-call", [0, input]), Math.sqrt(input), (String("static sqrt/") + String(globalThis.String(input))));
1412
- return exact(invoke_val(a, "sqrt-call", [2, input]), (sqrt_reference)["sqrt_call"](2, input), (String("computed sqrt/") + String(globalThis.String(input))));
1413
- }));
1414
- ([[], [undefined], [null], [-0.0, 99, "ignored"]])["forEach"](((args) => {
1415
- {
1416
- let roots = (args)["map"](((input) => {
1417
- return box(a, input);
1351
+ return null;
1352
+ }
1353
+ }));
1354
+ (sqrt_inputs())["forEach"](((input) => {
1355
+ exact(invoke_val(a, "sqrt-call", [0, input]), Math.sqrt(input), (String("static sqrt/") + String(globalThis.String(input))));
1356
+ return exact(invoke_val(a, "sqrt-call", [2, input]), (sqrt_reference)["sqrt_call"](2, input), (String("computed sqrt/") + String(globalThis.String(input))));
1357
+ }));
1358
+ ([[], [undefined], [null], [-0.0, 99, "ignored"]])["forEach"](((args) => {
1359
+ {
1360
+ let roots = (args)["map"](((input) => {
1361
+ return box(a, input);
1362
+ }));
1363
+ try {
1364
+ return exact(value(a, "sqrt-held", ([held])["concat"](roots)), __eliscript_at(Reflect, "apply")((globalThis.Math)["sqrt"], globalThis.Math, args), "held sqrt logical arity");
1365
+ } finally {
1366
+ (roots)["forEach"](((r) => {
1367
+ return (a)["release"](r);
1418
1368
  }));
1419
- return (() => {
1420
- try {
1421
- return exact(value(a, "sqrt-held", ([held])["concat"](roots)), __eliscript_at(Reflect, "apply")((globalThis.Math)["sqrt"], globalThis.Math, args), "held sqrt logical arity");
1422
- } finally {
1423
- (roots)["forEach"](((r) => {
1424
- return (a)["release"](r);
1425
- }));
1426
- }
1427
- })();
1428
1369
  }
1429
- }));
1430
- (a)["collect"]();
1431
- {
1432
- let again_mode = (a)["number"](fmode);
1433
- (() => {
1370
+ }
1371
+ }));
1372
+ (a)["collect"]();
1373
+ {
1374
+ let again_mode = (a)["number"](fmode);
1375
+ try {
1376
+ {
1377
+ let again = (a)["invoke"]("sqrt-method", [again_mode]);
1434
1378
  try {
1435
- {
1436
- let again = (a)["invoke"]("sqrt-method", [again_mode]);
1437
- return (() => {
1438
- try {
1439
- return assert((a)["keyEqual"](held, again), "sqrt identity must survive a forced collection");
1440
- } finally {
1441
- (a)["release"](again);
1442
- }
1443
- })();
1444
- }
1379
+ assert((a)["keyEqual"](held, again), "sqrt identity must survive a forced collection");
1445
1380
  } finally {
1446
- (a)["release"](again_mode);
1381
+ (a)["release"](again);
1447
1382
  }
1448
- })();
1383
+ }
1384
+ } finally {
1385
+ (a)["release"](again_mode);
1449
1386
  }
1450
- return (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
1451
- } finally {
1452
- (a)["release"](held);
1453
1387
  }
1454
- })();
1388
+ return (assert)["equal"](((a)["stats"]())["frameDepth"], 0);
1389
+ } finally {
1390
+ (a)["release"](held);
1391
+ }
1455
1392
  }
1456
1393
  }
1457
1394
  }
@@ -1509,14 +1446,12 @@ function check_sqrt_semantics(a, sqrt_reference) {
1509
1446
  {
1510
1447
  let mode_v = (a)["number"](0);
1511
1448
  let held = (a)["invoke"]("sqrt-method", [mode_v]);
1512
- (() => {
1513
- try {
1514
- return (assert)["deepEqual"](value(a, "sqrt-description", [held]), [true, true, true, "sqrt", 1, false, true, false, true, false, false, true, false, false, true]);
1515
- } finally {
1516
- (a)["release"](held);
1517
- (a)["release"](mode_v);
1518
- }
1519
- })();
1449
+ try {
1450
+ (assert)["deepEqual"](value(a, "sqrt-description", [held]), [true, true, true, "sqrt", 1, false, true, false, true, false, false, true, false, false, true]);
1451
+ } finally {
1452
+ (a)["release"](held);
1453
+ (a)["release"](mode_v);
1454
+ }
1520
1455
  }
1521
1456
  {
1522
1457
  let mode = 0;
@@ -1539,14 +1474,12 @@ function check_sqrt_semantics(a, sqrt_reference) {
1539
1474
  (assert)["equal"](compare("sqrt-shadow"), 12);
1540
1475
  {
1541
1476
  let threw = false;
1542
- (() => {
1543
- try {
1544
- return (a)["invoke"]("sqrt-throw", [false]);
1545
- } catch (error) {
1546
- ((threw = true));
1547
- return (assert)["strictEqual"](error, false);
1548
- }
1549
- })();
1477
+ try {
1478
+ (a)["invoke"]("sqrt-throw", [false]);
1479
+ } catch (error) {
1480
+ ((threw = true));
1481
+ (assert)["strictEqual"](error, false);
1482
+ }
1550
1483
  assert(threw, "sqrt must propagate the original false thrown by ToNumber");
1551
1484
  }
1552
1485
  (a)["collect"]();
@@ -1563,103 +1496,89 @@ function check_sqrt_pressure(a) {
1563
1496
  let frame = (a)["frame"](1);
1564
1497
  let fillers = [];
1565
1498
  (a)["frameSet"](frame, 0, saved);
1566
- return (() => {
1567
- try {
1568
- exact(value(a, "sqrt-held", [held, saved]), -0.0, "sqrt before pressure");
1569
- {
1570
- let marker = (a)["sourceArray"]([saved]);
1571
- (() => {
1499
+ try {
1500
+ exact(value(a, "sqrt-held", [held, saved]), -0.0, "sqrt before pressure");
1501
+ {
1502
+ let marker = (a)["sourceArray"]([saved]);
1503
+ try {
1504
+ {
1505
+ let threw = false;
1572
1506
  try {
1573
- {
1574
- let threw = false;
1575
- (() => {
1576
- try {
1577
- return (a)["invoke"]("sqrt-throw", [marker]);
1578
- } catch (error) {
1579
- ((threw = true));
1580
- return (() => {
1581
- try {
1582
- return assert((a)["keyEqual"](error, marker), "sqrt must preserve the original object thrown by conversion");
1583
- } finally {
1584
- (a)["release"](error);
1585
- }
1586
- })();
1587
- }
1588
- })();
1589
- return assert(threw);
1590
- }
1591
- } finally {
1592
- (a)["release"](marker);
1593
- }
1594
- })();
1595
- }
1596
- (a)["collect"]();
1597
- (assert)["equal"](((a)["stats"]())["frameDepth"], 1);
1598
- {
1599
- let exhausted = false;
1600
- let index = 0;
1601
- while ((__eliscript_numeric_relation("<=", index, 1024) && !(__eliscript_truthy(exhausted)))) {
1602
- (() => {
1507
+ (a)["invoke"]("sqrt-throw", [marker]);
1508
+ } catch (error) {
1509
+ ((threw = true));
1603
1510
  try {
1604
- return (fillers)["push"]((a)["array"]());
1605
- } catch (error) {
1606
- {
1607
- let diag = (error)["eliscriptDiagnostic"];
1608
- (assert)["equal"](((diag == null) ? undefined : (diag)["code"]), "ELI-RT0002");
1609
- return ((exhausted = true));
1610
- }
1511
+ assert((a)["keyEqual"](error, marker), "sqrt must preserve the original object thrown by conversion");
1512
+ } finally {
1513
+ (a)["release"](error);
1611
1514
  }
1612
- })();
1613
- ((index = (index + 1)));
1515
+ }
1516
+ assert(threw);
1614
1517
  }
1615
- assert(exhausted, "sqrt must retain the default 1024-slot hard capacity");
1518
+ } finally {
1519
+ (a)["release"](marker);
1616
1520
  }
1617
- (assert)["throws"]((() => {
1618
- return (a)["invoke"]("sqrt-held", [held, saved]);
1619
- }), ((error) => {
1620
- {
1621
- let diag = (error)["eliscriptDiagnostic"];
1622
- return ((!(diag == null)) && ((diag)["code"] === "ELI-RT0002"));
1623
- }
1624
- }));
1625
- (assert)["equal"](((a)["stats"]())["frameDepth"], 1);
1626
- exact((a)["readNumber"](saved), -0.0, "sqrt capacity failure preserves the caller value");
1627
- (fillers)["forEach"](((r) => {
1628
- return (a)["release"](r);
1629
- }));
1630
- ((fillers)["length"] = 0);
1631
- (a)["collect"]();
1632
- exact(value(a, "sqrt-held", [held, saved]), -0.0, "sqrt recovers with the same arguments");
1633
- {
1634
- let again = (a)["invoke"]("sqrt-method", [mode]);
1635
- (() => {
1636
- try {
1637
- return assert((a)["keyEqual"](held, again));
1638
- } finally {
1639
- (a)["release"](again);
1521
+ }
1522
+ (a)["collect"]();
1523
+ (assert)["equal"](((a)["stats"]())["frameDepth"], 1);
1524
+ {
1525
+ let exhausted = false;
1526
+ let index = 0;
1527
+ while ((__eliscript_numeric_relation("<=", index, 1024) && !(__eliscript_truthy(exhausted)))) {
1528
+ try {
1529
+ (fillers)["push"]((a)["array"]());
1530
+ } catch (error) {
1531
+ {
1532
+ let diag = (error)["eliscriptDiagnostic"];
1533
+ (assert)["equal"](((diag == null) ? undefined : (diag)["code"]), "ELI-RT0002");
1534
+ ((exhausted = true));
1640
1535
  }
1641
- })();
1536
+ }
1537
+ ((index = (index + 1)));
1642
1538
  }
1539
+ assert(exhausted, "sqrt must retain the default 1024-slot hard capacity");
1540
+ }
1541
+ (assert)["throws"]((() => {
1542
+ return (a)["invoke"]("sqrt-held", [held, saved]);
1543
+ }), ((error) => {
1643
1544
  {
1644
- let caller = (a)["frameGet"](frame, 0);
1645
- return (() => {
1646
- try {
1647
- return exact((a)["readNumber"](caller), -0.0, "sqrt recovery retains the caller frame");
1648
- } finally {
1649
- (a)["release"](caller);
1650
- }
1651
- })();
1545
+ let diag = (error)["eliscriptDiagnostic"];
1546
+ return ((!(diag == null)) && ((diag)["code"] === "ELI-RT0002"));
1547
+ }
1548
+ }));
1549
+ (assert)["equal"](((a)["stats"]())["frameDepth"], 1);
1550
+ exact((a)["readNumber"](saved), -0.0, "sqrt capacity failure preserves the caller value");
1551
+ (fillers)["forEach"](((r) => {
1552
+ return (a)["release"](r);
1553
+ }));
1554
+ ((fillers)["length"] = 0);
1555
+ (a)["collect"]();
1556
+ exact(value(a, "sqrt-held", [held, saved]), -0.0, "sqrt recovers with the same arguments");
1557
+ {
1558
+ let again = (a)["invoke"]("sqrt-method", [mode]);
1559
+ try {
1560
+ assert((a)["keyEqual"](held, again));
1561
+ } finally {
1562
+ (a)["release"](again);
1652
1563
  }
1653
- } finally {
1654
- (fillers)["forEach"](((r) => {
1655
- return (a)["release"](r);
1656
- }));
1657
- (a)["leaveFrame"](frame);
1658
- (a)["release"](held);
1659
- (a)["release"](mode);
1660
- (a)["release"](saved);
1661
1564
  }
1662
- })();
1565
+ {
1566
+ let caller = (a)["frameGet"](frame, 0);
1567
+ try {
1568
+ return exact((a)["readNumber"](caller), -0.0, "sqrt recovery retains the caller frame");
1569
+ } finally {
1570
+ (a)["release"](caller);
1571
+ }
1572
+ }
1573
+ } finally {
1574
+ (fillers)["forEach"](((r) => {
1575
+ return (a)["release"](r);
1576
+ }));
1577
+ (a)["leaveFrame"](frame);
1578
+ (a)["release"](held);
1579
+ (a)["release"](mode);
1580
+ (a)["release"](saved);
1581
+ }
1663
1582
  }
1664
1583
  }
1665
1584
  async function run_cli(mode, arg1, arg2, arg3) {
@@ -1674,14 +1593,12 @@ async function run_cli(mode, arg1, arg2, arg3) {
1674
1593
  return ((trace) => {
1675
1594
  return ((thrown) => {
1676
1595
  return (() => {
1677
- (() => {
1678
- try {
1679
- return (m)["cold_number_key_error"](ctor, trace);
1680
- } catch (error) {
1681
- ((thrown = true));
1682
- return (assert)["strictEqual"](error, false);
1683
- }
1684
- })();
1596
+ try {
1597
+ (m)["cold_number_key_error"](ctor, trace);
1598
+ } catch (error) {
1599
+ ((thrown = true));
1600
+ (assert)["strictEqual"](error, false);
1601
+ }
1685
1602
  assert(thrown);
1686
1603
  (assert)["deepEqual"](trace, ["string"]);
1687
1604
  {
@@ -1724,15 +1641,13 @@ async function run_cli(mode, arg1, arg2, arg3) {
1724
1641
  return (() => {
1725
1642
  (assert)["deepEqual"]((globalThis.WebAssembly.Module)["imports"](new (globalThis.WebAssembly.Module)(bytes)), []);
1726
1643
  {
1727
- let a = instantiateManagedRuntime(bytes, ({"maxSlots": 1024}));
1644
+ let a = instantiateManagedRuntime(bytes, ({"initialBytes": 65536, "maxBytes": 81920}));
1728
1645
  (a)["auto"](1);
1729
- (() => {
1730
- try {
1731
- return check_math_composite(a, reference, frozen_reference, "node-wasm");
1732
- } finally {
1733
- finish(a);
1734
- }
1735
- })();
1646
+ try {
1647
+ check_math_composite(a, reference, frozen_reference, "node-wasm");
1648
+ } finally {
1649
+ finish(a);
1650
+ }
1736
1651
  }
1737
1652
  return check_host_sum_oracle();
1738
1653
  })();
@@ -1752,14 +1667,12 @@ async function run_cli(mode, arg1, arg2, arg3) {
1752
1667
  return check_sqrt_semantics(a, sqrt_reference);
1753
1668
  }), check_sqrt_pressure])["forEach"](((check_fn) => {
1754
1669
  {
1755
- let a = instantiateManagedRuntime(bytes, ({"maxSlots": 1024}));
1756
- return (() => {
1757
- try {
1758
- return check_fn(a);
1759
- } finally {
1760
- finish(a);
1761
- }
1762
- })();
1670
+ let a = instantiateManagedRuntime(bytes, ((check_fn === check_sqrt_pressure) ? ({"initialBytes": 16384, "maxBytes": 65536}) : ({})));
1671
+ try {
1672
+ return check_fn(a);
1673
+ } finally {
1674
+ finish(a);
1675
+ }
1763
1676
  }
1764
1677
  }));
1765
1678
  return ((globalThis.process)["stdout"])["write"](JSON.stringify(({"sqrt": true})));