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
@@ -1,5 +1,9 @@
1
1
  (module eliscript.runtime.testing.map
2
2
  (import "../core/map-internals.mjs" :as map-internals)
3
+ (import "../core/array-map.mjs"
4
+ isPersistentArrayMap
5
+ readArrayMapState
6
+ readTransientArrayMapState)
3
7
  (import "../core/map-internals.mjs"
4
8
  MAP_STATE
5
9
  TRANSIENT_MAP_STATE
@@ -86,51 +90,76 @@
86
90
  (readTransientMapMetrics))
87
91
 
88
92
  (defun inspectTransientMap (map)
89
- (let ((state (transient-state-of map))
90
- (nodes (new globalThis/Set))
91
- (owned-node-count 0))
92
- (collect-nodes (get state :root) nodes)
93
- (js-call nodes :forEach
94
- (lambda (node)
95
- (when (eq (get node :owner) (get state :owner))
96
- (setq owned-node-count (+ owned-node-count 1)))))
97
- (let* ((source (get state :source))
98
- (source-state (if (nil? source) undefined (aref source MAP_STATE))))
99
- (Object/freeze
100
- (js-object
101
- :active (get state :active)
102
- :count (get state :count)
103
- :nodeCount (get nodes :size)
104
- :ownedNodeCount owned-node-count
105
- :sharesSourceRoot (and (not (undefined? source-state))
106
- (eq (get state :root) (get source-state :root))))))))
93
+ (let ((array-state (readTransientArrayMapState map)))
94
+ (if (not (undefined? array-state))
95
+ (if (not (nil? (get array-state :promoted)))
96
+ (inspectTransientMap (get array-state :promoted))
97
+ (Object/freeze
98
+ (js-object
99
+ :active (get array-state :active)
100
+ :count (/ (js-length (get array-state :items)) 2)
101
+ :nodeCount 0
102
+ :ownedNodeCount 0
103
+ :sharesSourceRoot false)))
104
+ (let ((state (transient-state-of map))
105
+ (nodes (new globalThis/Set))
106
+ (owned-node-count 0))
107
+ (collect-nodes (get state :root) nodes)
108
+ (js-call nodes :forEach
109
+ (lambda (node)
110
+ (when (eq (get node :owner) (get state :owner))
111
+ (setq owned-node-count (+ owned-node-count 1)))))
112
+ (let* ((source (get state :source))
113
+ (source-state (if (nil? source) undefined (aref source MAP_STATE))))
114
+ (Object/freeze
115
+ (js-object
116
+ :active (get state :active)
117
+ :count (get state :count)
118
+ :nodeCount (get nodes :size)
119
+ :ownedNodeCount owned-node-count
120
+ :sharesSourceRoot (and (not (undefined? source-state))
121
+ (eq (get state :root) (get source-state :root))))))))))
107
122
 
108
123
  (defun inspectPersistentMap (map)
109
- (let* ((state (state-of map))
110
- (result (js-object
111
- :count (get state :count)
112
- :bitmapNodes 0
113
- :arrayNodes 0
114
- :collisionNodes 0
115
- :entries 0
116
- :nodeCount 0
117
- :maxDepth 0))
118
- (nodes (new globalThis/Set)))
119
- (inspect-item (get state :root) 1 result nodes)
120
- (put result "nodeCount" (get nodes :size))
121
- (Object/freeze result)))
124
+ (if (isPersistentArrayMap map)
125
+ (let ((array-state (readArrayMapState map)))
126
+ (Object/freeze
127
+ (js-object
128
+ :representation "array-map"
129
+ :count (get array-state :count)
130
+ :bitmapNodes 0
131
+ :arrayNodes 0
132
+ :collisionNodes 0
133
+ :entries (get array-state :count)
134
+ :nodeCount 0
135
+ :maxDepth 0)))
136
+ (let* ((state (state-of map))
137
+ (result (js-object
138
+ :count (get state :count)
139
+ :bitmapNodes 0
140
+ :arrayNodes 0
141
+ :collisionNodes 0
142
+ :entries 0
143
+ :nodeCount 0
144
+ :maxDepth 0))
145
+ (nodes (new globalThis/Set)))
146
+ (inspect-item (get state :root) 1 result nodes)
147
+ (put result "nodeCount" (get nodes :size))
148
+ (Object/freeze result))))
122
149
 
123
150
  (defun sharedPersistentMapNodes (left right)
124
- (let ((left-nodes (new globalThis/Set))
125
- (right-nodes (new globalThis/Set))
126
- (shared 0))
127
- (collect-nodes (get (state-of left) :root) left-nodes)
128
- (collect-nodes (get (state-of right) :root) right-nodes)
129
- (js-call left-nodes :forEach
130
- (lambda (node)
131
- (when (js-call right-nodes :has node)
132
- (setq shared (+ shared 1)))))
133
- shared))
151
+ (if (or (isPersistentArrayMap left) (isPersistentArrayMap right))
152
+ 0
153
+ (let ((left-nodes (new globalThis/Set))
154
+ (right-nodes (new globalThis/Set))
155
+ (shared 0))
156
+ (collect-nodes (get (state-of left) :root) left-nodes)
157
+ (collect-nodes (get (state-of right) :root) right-nodes)
158
+ (js-call left-nodes :forEach
159
+ (lambda (node)
160
+ (when (js-call right-nodes :has node)
161
+ (setq shared (+ shared 1)))))
162
+ shared)))
134
163
 
135
164
  (export
136
165
  resetPersistentMapMetrics
@@ -7,6 +7,7 @@ import { __eliscript_to_number, __eliscript_numeric_decrement, __eliscript_numer
7
7
  const __eliscript_truthy = (value) => value !== false && value != null;
8
8
 
9
9
  import * as map_internals from "../core/map-internals.mjs";
10
+ import {isPersistentArrayMap, readArrayMapState, readTransientArrayMapState} from "../core/array-map.mjs";
10
11
  import {MAP_STATE, TRANSIENT_MAP_STATE, ArrayNode, BitmapIndexedNode, HashCollisionNode, MapEntry, readMapMetrics, readTransientMapMetrics, resetMapMetrics} from "../core/map-internals.mjs";
11
12
  const instance_of_QMARK_ = (value, Constructor) => value instanceof Constructor;
12
13
  __eliscript_tdz_ready_0 = true;
@@ -121,49 +122,71 @@ function transientMapMetrics() {
121
122
  }
122
123
  function inspectTransientMap(map) {
123
124
  {
124
- let state = transient_state_of(map);
125
- let nodes = new (globalThis.Set)();
126
- let owned_node_count = 0;
127
- collect_nodes((state)["root"], nodes);
128
- (nodes)["forEach"](((node) => {
129
- if (((node)["owner"] === (state)["owner"])) {
130
- return ((owned_node_count = (owned_node_count + 1)));
125
+ let array_state = readTransientArrayMapState(map);
126
+ if (!((array_state === undefined))) {
127
+ if (!(((array_state)["promoted"] === null))) {
128
+ return inspectTransientMap((array_state)["promoted"]);
131
129
  } else {
132
- return null;
130
+ return Object.freeze(({"active": (array_state)["active"], "count": __eliscript_numeric_div((((array_state)["items"]) ?? []).length, 2), "nodeCount": 0, "ownedNodeCount": 0, "sharesSourceRoot": false}));
131
+ }
132
+ } else {
133
+ {
134
+ let state = transient_state_of(map);
135
+ let nodes = new (globalThis.Set)();
136
+ let owned_node_count = 0;
137
+ collect_nodes((state)["root"], nodes);
138
+ (nodes)["forEach"](((node) => {
139
+ if (((node)["owner"] === (state)["owner"])) {
140
+ return ((owned_node_count = (owned_node_count + 1)));
141
+ } else {
142
+ return null;
143
+ }
144
+ }));
145
+ {
146
+ let source = (state)["source"];
147
+ let source_state = ((source === null) ? undefined : (source)[MAP_STATE]);
148
+ return Object.freeze(({"active": (state)["active"], "count": (state)["count"], "nodeCount": (nodes)["size"], "ownedNodeCount": owned_node_count, "sharesSourceRoot": ((!(source_state === undefined)) && ((state)["root"] === (source_state)["root"]))}));
149
+ }
133
150
  }
134
- }));
135
- {
136
- let source = (state)["source"];
137
- let source_state = ((source === null) ? undefined : (source)[MAP_STATE]);
138
- return Object.freeze(({"active": (state)["active"], "count": (state)["count"], "nodeCount": (nodes)["size"], "ownedNodeCount": owned_node_count, "sharesSourceRoot": ((!(source_state === undefined)) && ((state)["root"] === (source_state)["root"]))}));
139
151
  }
140
152
  }
141
153
  }
142
154
  function inspectPersistentMap(map) {
143
- {
144
- let state = state_of(map);
145
- let result = ({"count": (state)["count"], "bitmapNodes": 0, "arrayNodes": 0, "collisionNodes": 0, "entries": 0, "nodeCount": 0, "maxDepth": 0});
146
- let nodes = new (globalThis.Set)();
147
- inspect_item((state)["root"], 1, result, nodes);
148
- ((result)["nodeCount"] = (nodes)["size"]);
149
- return Object.freeze(result);
155
+ if (__eliscript_truthy(isPersistentArrayMap(map))) {
156
+ {
157
+ let array_state = readArrayMapState(map);
158
+ return Object.freeze(({"representation": "array-map", "count": (array_state)["count"], "bitmapNodes": 0, "arrayNodes": 0, "collisionNodes": 0, "entries": (array_state)["count"], "nodeCount": 0, "maxDepth": 0}));
159
+ }
160
+ } else {
161
+ {
162
+ let state = state_of(map);
163
+ let result = ({"count": (state)["count"], "bitmapNodes": 0, "arrayNodes": 0, "collisionNodes": 0, "entries": 0, "nodeCount": 0, "maxDepth": 0});
164
+ let nodes = new (globalThis.Set)();
165
+ inspect_item((state)["root"], 1, result, nodes);
166
+ ((result)["nodeCount"] = (nodes)["size"]);
167
+ return Object.freeze(result);
168
+ }
150
169
  }
151
170
  }
152
171
  function sharedPersistentMapNodes(left, right) {
153
- {
154
- let left_nodes = new (globalThis.Set)();
155
- let right_nodes = new (globalThis.Set)();
156
- let shared = 0;
157
- collect_nodes((state_of(left))["root"], left_nodes);
158
- collect_nodes((state_of(right))["root"], right_nodes);
159
- (left_nodes)["forEach"](((node) => {
160
- if (__eliscript_truthy((right_nodes)["has"](node))) {
161
- return ((shared = (shared + 1)));
162
- } else {
163
- return null;
164
- }
165
- }));
166
- return shared;
172
+ if ((__eliscript_truthy(isPersistentArrayMap(left)) || __eliscript_truthy(isPersistentArrayMap(right)))) {
173
+ return 0;
174
+ } else {
175
+ {
176
+ let left_nodes = new (globalThis.Set)();
177
+ let right_nodes = new (globalThis.Set)();
178
+ let shared = 0;
179
+ collect_nodes((state_of(left))["root"], left_nodes);
180
+ collect_nodes((state_of(right))["root"], right_nodes);
181
+ (left_nodes)["forEach"](((node) => {
182
+ if (__eliscript_truthy((right_nodes)["has"](node))) {
183
+ return ((shared = (shared + 1)));
184
+ } else {
185
+ return null;
186
+ }
187
+ }));
188
+ return shared;
189
+ }
167
190
  }
168
191
  }
169
192
  export {resetPersistentMapMetrics, persistentMapMetrics, resetTransientMapMetrics, transientMapMetrics, inspectTransientMap, inspectPersistentMap, sharedPersistentMapNodes};
@@ -1 +1 @@
1
- {"version":3,"file":"map.mjs","sources":["map.eli"],"sourcesContent":["(module eliscript.runtime.testing.map\n (import \"../core/map-internals.mjs\" :as map-internals)\n (import \"../core/map-internals.mjs\"\n MAP_STATE\n TRANSIENT_MAP_STATE\n ArrayNode\n BitmapIndexedNode\n HashCollisionNode\n MapEntry\n readMapMetrics\n readTransientMapMetrics\n resetMapMetrics)\n\n (defconst instance-of? (js* \"(value, Constructor) => value instanceof Constructor\"))\n\n (defun state-of (map)\n (let ((state (if (nil? map) undefined (aref map MAP_STATE))))\n (when (undefined? state)\n (throw (new globalThis/TypeError \"expected an Eliscript persistent hash map\")))\n state))\n\n (defun transient-state-of (map)\n (let ((state (if (nil? map) undefined (aref map TRANSIENT_MAP_STATE))))\n (when (undefined? state)\n (throw (new globalThis/TypeError \"expected an Eliscript transient hash map\")))\n state))\n\n (defun inspect-item (item depth result nodes)\n (cond\n ((funcall instance-of? item MapEntry)\n (put result \"entries\" (+ (get result :entries) 1))\n (put result \"maxDepth\" (Math/max (get result :maxDepth) depth)))\n ((not (js-call nodes :has item))\n (js-call nodes :add item)\n (put result \"maxDepth\" (Math/max (get result :maxDepth) depth))\n (cond\n ((funcall instance-of? item BitmapIndexedNode)\n (put result \"bitmapNodes\" (+ (get result :bitmapNodes) 1))\n (let ((items (get item :items))\n (index 0))\n (while (< index (js-length items))\n (inspect-item (get items index) (+ depth 1) result nodes)\n (setq index (+ index 1)))))\n ((funcall instance-of? item ArrayNode)\n (put result \"arrayNodes\" (+ (get result :arrayNodes) 1))\n (let ((children (get item :children))\n (index 0))\n (while (< index (js-length children))\n (let ((child (get children index)))\n (unless (undefined? child)\n (inspect-item child (+ depth 1) result nodes)))\n (setq index (+ index 1)))))\n ((funcall instance-of? item HashCollisionNode)\n (put result \"collisionNodes\" (+ (get result :collisionNodes) 1))\n (let ((entries (get item :entries))\n (index 0))\n (while (< index (js-length entries))\n (inspect-item (get entries index) (+ depth 1) result nodes)\n (setq index (+ index 1)))))))))\n\n (defun collect-nodes (item nodes)\n (unless (or (funcall instance-of? item MapEntry)\n (js-call nodes :has item))\n (js-call nodes :add item)\n (let ((children (cond\n ((funcall instance-of? item BitmapIndexedNode) (get item :items))\n ((funcall instance-of? item ArrayNode) (get item :children))\n (t (get item :entries))))\n (index 0))\n (while (< index (js-length children))\n (let ((child (get children index)))\n (unless (undefined? child)\n (collect-nodes child nodes)))\n (setq index (+ index 1))))))\n\n (defun resetPersistentMapMetrics ()\n (resetMapMetrics))\n\n (defun persistentMapMetrics ()\n (readMapMetrics))\n\n (defun resetTransientMapMetrics ()\n (map-internals/resetTransientMapMetrics))\n\n (defun transientMapMetrics ()\n (readTransientMapMetrics))\n\n (defun inspectTransientMap (map)\n (let ((state (transient-state-of map))\n (nodes (new globalThis/Set))\n (owned-node-count 0))\n (collect-nodes (get state :root) nodes)\n (js-call nodes :forEach\n (lambda (node)\n (when (eq (get node :owner) (get state :owner))\n (setq owned-node-count (+ owned-node-count 1)))))\n (let* ((source (get state :source))\n (source-state (if (nil? source) undefined (aref source MAP_STATE))))\n (Object/freeze\n (js-object\n :active (get state :active)\n :count (get state :count)\n :nodeCount (get nodes :size)\n :ownedNodeCount owned-node-count\n :sharesSourceRoot (and (not (undefined? source-state))\n (eq (get state :root) (get source-state :root))))))))\n\n (defun inspectPersistentMap (map)\n (let* ((state (state-of map))\n (result (js-object\n :count (get state :count)\n :bitmapNodes 0\n :arrayNodes 0\n :collisionNodes 0\n :entries 0\n :nodeCount 0\n :maxDepth 0))\n (nodes (new globalThis/Set)))\n (inspect-item (get state :root) 1 result nodes)\n (put result \"nodeCount\" (get nodes :size))\n (Object/freeze result)))\n\n (defun sharedPersistentMapNodes (left right)\n (let ((left-nodes (new globalThis/Set))\n (right-nodes (new globalThis/Set))\n (shared 0))\n (collect-nodes (get (state-of left) :root) left-nodes)\n (collect-nodes (get (state-of right) :root) right-nodes)\n (js-call left-nodes :forEach\n (lambda (node)\n (when (js-call right-nodes :has node)\n (setq shared (+ shared 1)))))\n shared))\n\n (export\n resetPersistentMapMetrics\n persistentMapMetrics\n resetTransientMapMetrics\n transientMapMetrics\n inspectTransientMap\n inspectPersistentMap\n sharedPersistentMapNodes))\n"],"names":[],"mappings":";;;;;;;;AACE,YAAwC;AACxC,QACE,WACA,qBACA,WACA,mBACA,mBACA,UACA,gBACA,yBACA;AAEF,2BAAuB;;AAEvB,kBAAiB;EACf;QAAM,QAAO,CAAI,CAAM,gBAAK,YAAU,CAAM,KAAI;IAC9C,IAAM,CAAY;MAChB,0DAAO,KAAK,sBAAqB;;IACnC,OAAA;;;AAEJ,4BAA2B;EACzB;QAAM,QAAO,CAAI,CAAM,gBAAK,YAAU,CAAM,KAAI;IAC9C,IAAM,CAAY;MAChB,0DAAO,KAAK,sBAAqB;;IACnC,OAAA;;;AAEJ,sBAAqB,MAAK,OAAM,QAAO;EAEnC,uBAAU,sGAAa,MAAK;IAC3B,EAAK,QAAO,aAAU,CAAG,CAAK,QAAO,aAAU;IAC/C,OAAA,EAAK,QAAO,cAAY,SAAS,CAAK,QAAO,aAAW;;IACzD,IAAC,qBAAK,CAAS,OAAM,OAAK;MACzB,CAAS,OAAM,OAAK;MACpB,EAAK,QAAO,cAAY,SAAS,CAAK,QAAO,aAAW;MAEtD,uBAAU,sGAAa,MAAK;QAC3B,EAAK,QAAO,iBAAc,CAAG,CAAK,QAAO,iBAAc;QACvD;cAAM,QAAO,CAAK,MAAK;cACjB,QAAO;UACX,OAAO,kCAAG,OAAM,EAAW;YACxB,aAAa,CAAK,OAAM,QAAO,CAAG,QAAM,IAAG,QAAO;YACnD,CAAM,CAAA,QAAM,CAAG,QAAM;;;;;QAC1B,uBAAU,sGAAa,MAAK;UAC3B,EAAK,QAAO,g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OAAM;UACnB,eAAc,CAAI,CAAM,mBAAQ,YAAU,CAAM,QAAO;MAC5D,OAAC,cACC,EACE,UAAQ,CAAK,OAAM,WACnB,SAAO,CAAK,OAAM,UAClB,aAAW,CAAK,OAAM,SACtB,kBAAgB,kBAChB,oBAAkB,CAAK,EAAK,CAAY,gCACjB,CAAI,CAAK,OAAM,YAAO,CAAK,cAAa;;;;AAEzE,8BAA6B;EAC3B;QAAO,QAAQ,SAAS;QACjB,SAAQ,EACE,SAAO,CAAK,OAAM,UAClB,eAAa,GACb,cAAY,GACZ,kBAAgB,GAChB,WAAS,GACT,aAAW,GACX,YAAU;QACpB,QAAO,KAAK;IAChB,aAAa,CAAK,OAAM,SAAO,GAAE,QAAO;IACzC,EAAK,QAAO,eAAY,CAAK,OAAM;IACnC,OAAC,cAAc;;;AAEnB,kCAAiC,MAAK;EACpC;QAAM,aAAY,KAAK;QACjB,cAAa,KAAK;QAClB,SAAQ;IACX,cAAc,CAAM,SAAS,OAAM,SAAO;IAC1C,cAAc,CAAM,SAAS,QAAO,SAAO;IAC5C,CAAS,YAAW,WAClB,EAAS;MACP,uBAAM,CAAS,aAAY,OAAK;QAC9B,OAAA,CAAM,CAAA,SAAO,CAAG,SAAO;;;;;IAC7B,OAAA;;;AAEJ,QACE,2BACA,sBACA,0BACA,qBACA,qBACA,sBACA"}
1
+ {"version":3,"file":"map.mjs","sources":["map.eli"],"sourcesContent":["(module eliscript.runtime.testing.map\n (import \"../core/map-internals.mjs\" :as map-internals)\n (import \"../core/array-map.mjs\"\n isPersistentArrayMap\n readArrayMapState\n readTransientArrayMapState)\n (import \"../core/map-internals.mjs\"\n MAP_STATE\n TRANSIENT_MAP_STATE\n ArrayNode\n BitmapIndexedNode\n HashCollisionNode\n MapEntry\n readMapMetrics\n readTransientMapMetrics\n resetMapMetrics)\n\n (defconst instance-of? (js* \"(value, Constructor) => value instanceof Constructor\"))\n\n (defun state-of (map)\n (let ((state (if (nil? map) undefined (aref map MAP_STATE))))\n (when (undefined? state)\n (throw (new globalThis/TypeError \"expected an Eliscript persistent hash map\")))\n state))\n\n (defun transient-state-of (map)\n (let ((state (if (nil? map) undefined (aref map TRANSIENT_MAP_STATE))))\n (when (undefined? state)\n (throw (new globalThis/TypeError \"expected an Eliscript transient hash map\")))\n state))\n\n (defun inspect-item (item depth result nodes)\n (cond\n ((funcall instance-of? item MapEntry)\n (put result \"entries\" (+ (get result :entries) 1))\n (put result \"maxDepth\" (Math/max (get result :maxDepth) depth)))\n ((not (js-call nodes :has item))\n (js-call nodes :add item)\n (put result \"maxDepth\" (Math/max (get result :maxDepth) depth))\n (cond\n ((funcall instance-of? item BitmapIndexedNode)\n (put result \"bitmapNodes\" (+ (get result :bitmapNodes) 1))\n (let ((items (get item :items))\n (index 0))\n (while (< index (js-length items))\n (inspect-item (get items index) (+ depth 1) result nodes)\n (setq index (+ index 1)))))\n ((funcall instance-of? item ArrayNode)\n (put result \"arrayNodes\" (+ (get result :arrayNodes) 1))\n (let ((children (get item :children))\n (index 0))\n (while (< index (js-length children))\n (let ((child (get children index)))\n (unless (undefined? child)\n (inspect-item child (+ depth 1) result nodes)))\n (setq index (+ index 1)))))\n ((funcall instance-of? item HashCollisionNode)\n (put result \"collisionNodes\" (+ (get result :collisionNodes) 1))\n (let ((entries (get item :entries))\n (index 0))\n (while (< index (js-length entries))\n (inspect-item (get entries index) (+ depth 1) result nodes)\n (setq index (+ index 1)))))))))\n\n (defun collect-nodes (item nodes)\n (unless (or (funcall instance-of? item MapEntry)\n (js-call nodes :has item))\n (js-call nodes :add item)\n (let ((children (cond\n ((funcall instance-of? item BitmapIndexedNode) (get item :items))\n ((funcall instance-of? item ArrayNode) (get item :children))\n (t (get item :entries))))\n (index 0))\n (while (< index (js-length children))\n (let ((child (get children index)))\n (unless (undefined? child)\n (collect-nodes child nodes)))\n (setq index (+ index 1))))))\n\n (defun resetPersistentMapMetrics ()\n (resetMapMetrics))\n\n (defun persistentMapMetrics ()\n (readMapMetrics))\n\n (defun resetTransientMapMetrics ()\n (map-internals/resetTransientMapMetrics))\n\n (defun transientMapMetrics ()\n (readTransientMapMetrics))\n\n (defun inspectTransientMap (map)\n (let ((array-state (readTransientArrayMapState map)))\n (if (not (undefined? array-state))\n (if (not (nil? (get array-state :promoted)))\n (inspectTransientMap (get array-state :promoted))\n (Object/freeze\n (js-object\n :active (get array-state :active)\n :count (/ (js-length (get array-state :items)) 2)\n :nodeCount 0\n :ownedNodeCount 0\n :sharesSourceRoot false)))\n (let ((state (transient-state-of map))\n (nodes (new globalThis/Set))\n (owned-node-count 0))\n (collect-nodes (get state :root) nodes)\n (js-call nodes :forEach\n (lambda (node)\n (when (eq (get node :owner) (get state :owner))\n (setq owned-node-count (+ owned-node-count 1)))))\n (let* ((source (get state :source))\n (source-state (if (nil? source) undefined (aref source MAP_STATE))))\n (Object/freeze\n (js-object\n :active (get state :active)\n :count (get state :count)\n :nodeCount (get nodes :size)\n :ownedNodeCount owned-node-count\n :sharesSourceRoot (and (not (undefined? source-state))\n (eq (get state :root) (get source-state :root))))))))))\n\n (defun inspectPersistentMap (map)\n (if (isPersistentArrayMap map)\n (let ((array-state (readArrayMapState map)))\n (Object/freeze\n (js-object\n :representation \"array-map\"\n :count (get array-state :count)\n :bitmapNodes 0\n :arrayNodes 0\n :collisionNodes 0\n :entries (get array-state :count)\n :nodeCount 0\n :maxDepth 0)))\n (let* ((state (state-of map))\n (result (js-object\n :count (get state :count)\n :bitmapNodes 0\n :arrayNodes 0\n :collisionNodes 0\n :entries 0\n :nodeCount 0\n :maxDepth 0))\n (nodes (new globalThis/Set)))\n (inspect-item (get state :root) 1 result nodes)\n (put result \"nodeCount\" (get nodes :size))\n (Object/freeze result))))\n\n (defun sharedPersistentMapNodes (left right)\n (if (or (isPersistentArrayMap left) (isPersistentArrayMap right))\n 0\n (let ((left-nodes (new globalThis/Set))\n (right-nodes (new globalThis/Set))\n (shared 0))\n (collect-nodes (get (state-of left) :root) left-nodes)\n (collect-nodes (get (state-of right) :root) right-nodes)\n (js-call left-nodes :forEach\n (lambda (node)\n (when (js-call right-nodes :has node)\n (setq shared (+ shared 1)))))\n shared)))\n\n (export\n resetPersistentMapMetrics\n persistentMapMetrics\n resetTransientMapMetrics\n transientMapMetrics\n inspectTransientMap\n inspectPersistentMap\n sharedPersistentMapNodes))\n"],"names":[],"mappings":";;;;;;;;AACE,YAAwC;AACxC,QACE,sBACA,mBACA;AACF,QACE,WACA,qBACA,WACA,mBACA,mBACA,UACA,gBACA,yBACA;AAEF,2BAAuB;;AAEvB,kBAAiB;EACf;QAAM,QAAO,CAAI,CAAM,gBAAK,YAAU,CAAM,KAAI;IAC9C,IAAM,CAAY;MAChB,0DAAO,KAAK,sBAAqB;;IACnC,OAAA;;;AAEJ,4BAA2B;EACzB;QAAM,QAAO,CAAI,CAAM,gBAAK,YAAU,CAAM,KAAI;IAC9C,IAAM,CAAY;MAChB,0DAAO,KAAK,sBAAqB;;IACnC,OAAA;;;AAEJ,sBAAqB,MAAK,OAAM,QAAO;EAEnC,uBAAU,sGAAa,MAAK;IAC3B,EAAK,QAAO,aAAU,CAAG,CAAK,QAAO,aAAU;IAC/C,OAAA,EAAK,QAAO,cAAY,SAAS,CAAK,QAAO,aAAW;;IACzD,IAAC,qBAAK,CAAS,OAAM,OAAK;MACzB,CAAS,OAAM,OAAK;MACpB,EAAK,QAAO,cAAY,SAAS,CAAK,QAAO,aAAW;MAEtD,uBAAU,sGAAa,MAAK;QAC3B,EAAK,QAAO,iBAAc,CAAG,CAAK,QAAO,iBAAc;QACvD;cAAM,QAAO,CAAK,MAAK;cACjB,QAAO;UACX,OAAO,kCAAG,OAAM,EAAW;YACxB,aAAa,CAAK,OAAM,QAAO,CAAG,QAAM,IAAG,QAAO;YACnD,CAAM,CAAA,QAAM,CAAG,QAAM;;;;;QAC1B,uBAAU,sGAAa,MAAK;UAC3B,EAAK,QAAO,gBAAa,CAAG,CAAK,QAAO,gBAAa;UACrD;gBAAM,WAAU,CAAK,MAAK;gBACpB,QA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A,0BACA,qBACA,qBACA,sBACA"}
@@ -99,10 +99,10 @@ function convert_profile(text, upper, rules) {
99
99
  ((first = 962));
100
100
  }
101
101
  ((chunk = (chunk + characters(first))));
102
- if (((__eliscript_value_2, __eliscript_value_3) => (__eliscript_value_2 !== __eliscript_value_3))(second, 0)) {
102
+ if ((second !== 0)) {
103
103
  ((chunk = (chunk + characters(second))));
104
104
  }
105
- if (((__eliscript_value_4, __eliscript_value_5) => (__eliscript_value_4 !== __eliscript_value_5))(third, 0)) {
105
+ if ((third !== 0)) {
106
106
  ((chunk = (chunk + characters(third))));
107
107
  }
108
108
  if (__eliscript_numeric_relation(">=", ((chunk) ?? []).length, 4096)) {
@@ -138,10 +138,10 @@ function profile_method(name, upper, rules, string_constructor, function_prototy
138
138
  Object.defineProperty(target, "length", ({"value": 0, "configurable": true}));
139
139
  return new (globalThis.Proxy)(target, ({"apply": ((ignored, receiver, arguments$) => {
140
140
  if ((receiver == null)) {
141
- ((__eliscript_value_6) => { throw __eliscript_value_6; })(new (type_error)(("String.prototype." + name + " called on null or undefined")));
141
+ ((__eliscript_value_2) => { throw __eliscript_value_2; })(new (type_error)(("String.prototype." + name + " called on null or undefined")));
142
142
  }
143
143
  if ((__eliscript_value_type(receiver) === "symbol")) {
144
- ((__eliscript_value_7) => { throw __eliscript_value_7; })(new (type_error)("Cannot convert a Symbol value to a string"));
144
+ ((__eliscript_value_3) => { throw __eliscript_value_3; })(new (type_error)("Cannot convert a Symbol value to a string"));
145
145
  }
146
146
  {
147
147
  let text = (__eliscript_tdz_ready_1 === true ? apply_native : __eliscript_tdz_error("apply_native"))(string_constructor, undefined, [receiver]);
@@ -156,7 +156,7 @@ function installUnicodeCaseProfile(version, ...arguments$) {
156
156
  let requested_realm = ((((arguments$) ?? []).length === 0) ? undefined : (arguments$)[0]);
157
157
  let realm = ((requested_realm === undefined) ? globalThis.globalThis : requested_realm);
158
158
  if ((!(__eliscript_truthy(realm) && (__eliscript_value_type((realm)["String"]) === "function") && (__eliscript_value_type((realm)["Function"]) === "function") && (__eliscript_value_type((realm)["TypeError"]) === "function")))) {
159
- ((__eliscript_value_8) => { throw __eliscript_value_8; })(new (globalThis.TypeError)("Unicode case profile requires a real String realm"));
159
+ ((__eliscript_value_4) => { throw __eliscript_value_4; })(new (globalThis.TypeError)("Unicode case profile requires a real String realm"));
160
160
  }
161
161
  {
162
162
  let string_constructor = (realm)["String"];
@@ -174,7 +174,7 @@ function installUnicodeCaseProfile(version, ...arguments$) {
174
174
  {
175
175
  let descriptor = Object.getOwnPropertyDescriptor(prototype, (names)[index]);
176
176
  if (__eliscript_truthy((__eliscript_truthy(descriptor) ? (!__eliscript_truthy((descriptor)["configurable"])) : (!__eliscript_truthy(Object.isExtensible(prototype)))))) {
177
- ((__eliscript_value_9) => { throw __eliscript_value_9; })(new (type_error)("Unicode case profile cannot replace a fixed String method"));
177
+ ((__eliscript_value_5) => { throw __eliscript_value_5; })(new (type_error)("Unicode case profile cannot replace a fixed String method"));
178
178
  }
179
179
  }
180
180
  ((index = (index + 1)));
@@ -1 +1 @@
1
- {"version":3,"file":"runtime/unicode-case.mjs","sources":["runtime/unicode-case.eli"],"sourcesContent":["(module eliscript.runtime.unicode-case\n (import \"./unicode-case-data.mjs\" :as data)\n\n ;; Ordinary Eliscript JavaScript uses the same Unicode 17 default as the\n ;; owned runtime. Explicit profile selection remains available below.\n ;; Tables are derived from the one maintained Unicode-3.0 region in memory.eli.\n (defconst installed (new globalThis.WeakMap))\n (defconst apply-native Reflect/apply)\n (defconst intrinsic-array-join (get (get globalThis.Array :prototype) :join))\n (defconst intrinsic-string globalThis.String)\n (defconst intrinsic-code-point (get (get intrinsic-string :prototype) :codePointAt))\n (defconst intrinsic-from-code-point (get intrinsic-string :fromCodePoint))\n (defconst intrinsic-regexp-exec (get (get globalThis.RegExp :prototype) :exec))\n (defconst non-ascii (new globalThis.RegExp \"[^\\\\x00-\\\\x7f]\"))\n (defconst ascii-upper (new globalThis.RegExp \"[A-Z]\"))\n (defconst ascii-lower (new globalThis.RegExp \"[a-z]\"))\n\n (defun case-pattern? (pattern text)\n ;; RegExp.prototype.test would consult a replaceable .exec on every call.\n ;; String casing must not acquire that unrelated observable dependency.\n (not (eq (funcall apply-native intrinsic-regexp-exec pattern (js-array text)) nil)))\n\n (defun point (text index)\n (funcall apply-native intrinsic-code-point text (js-array index)))\n (defun characters (code)\n (funcall apply-native intrinsic-from-code-point intrinsic-string (js-array code)))\n (defun tables (version)\n ;; Static export references keep the table module's namespace out of every\n ;; browser bundle while retaining each profile's exact function identities.\n (cond\n ((= version 15.1)\n (js-object\n :upper (js-array (get data :unicode_case_data_upper_0_151)\n (get data :unicode_case_data_upper_1_151) (get data :unicode_case_data_upper_2_151))\n :lower (js-array (get data :unicode_case_data_lower_0_151)\n (get data :unicode_case_data_lower_1_151) (get data :unicode_case_data_lower_2_151))\n :cased (get data :unicode_case_data_cased_151)\n :ignorable (get data :unicode_case_data_case_ignorable_151)))\n ((= version 16)\n (js-object\n :upper (js-array (get data :unicode_case_data_upper_0_160)\n (get data :unicode_case_data_upper_1_160) (get data :unicode_case_data_upper_2_160))\n :lower (js-array (get data :unicode_case_data_lower_0_160)\n (get data :unicode_case_data_lower_1_160) (get data :unicode_case_data_lower_2_160))\n :cased (get data :unicode_case_data_cased_160)\n :ignorable (get data :unicode_case_data_case_ignorable_160)))\n ((= version 17)\n (js-object\n :upper (js-array (get data :unicode_case_data_upper_0_17)\n (get data :unicode_case_data_upper_1_17) (get data :unicode_case_data_upper_2_17))\n :lower (js-array (get data :unicode_case_data_lower_0_17)\n (get data :unicode_case_data_lower_1_17) (get data :unicode_case_data_lower_2_17))\n :cased (get data :unicode_case_data_cased_17)\n :ignorable (get data :unicode_case_data_case_ignorable_17)))\n (t (throw (new globalThis.TypeError \"Unicode case profile must be 15.1, 16, or 17\")))))\n\n (defun final-sigma (text index before rules)\n (let ((result before) (done false))\n (while (and (= before 1) (not done) (< index (js-length text)))\n (let ((code (point text index)))\n (when (= (funcall (get rules :ignorable) code) 0)\n (setq done t)\n (when (= (funcall (get rules :cased) code) 1) (setq result 0)))\n (setq index (+ index (if (> code 65535) 2 1))))) result))\n\n (defun convert-profile (text upper rules)\n (let* ((mapping (get rules (if upper \"upper\" \"lower\")))\n (first-map (aref mapping 0)) (second-map (aref mapping 1)) (third-map (aref mapping 2))\n (pieces (js-array)) (chunk \"\") (index 0) (before 0))\n (while (< index (js-length text))\n (let* ((code (point text index)) (step (if (> code 65535) 2 1))\n (first (funcall first-map code)) (second (funcall second-map code)) (third (funcall third-map code)))\n (when (and (not upper) (= code 931) (= (final-sigma text (+ index step) before rules) 1))\n (setq first 962))\n (setq chunk (+ chunk (characters first)))\n (when (/= second 0) (setq chunk (+ chunk (characters second))))\n (when (/= third 0) (setq chunk (+ chunk (characters third))))\n (when (>= (js-length chunk) 4096) (js-call pieces :push chunk) (setq chunk \"\"))\n (when (and (not upper) (= (funcall (get rules :ignorable) code) 0))\n (setq before (funcall (get rules :cased) code)))\n (setq index (+ index step))))\n (when (> (js-length chunk) 0) (js-call pieces :push chunk))\n (funcall apply-native intrinsic-array-join pieces (js-array \"\"))))\n\n (defun convert (text upper rules)\n ;; Already-cased ASCII is an identity under every supported profile. Avoid\n ;; three table lookups per character for this common path. Do not delegate\n ;; casing to replaceable host String methods: changed ASCII and every\n ;; non-ASCII code unit still use our exact tables and final-sigma rules.\n (if (or (case-pattern? non-ascii text)\n (case-pattern? (if upper ascii-lower ascii-upper) text))\n (convert-profile text upper rules)\n text))\n\n (defun profile-method (name upper rules string-constructor function-prototype type-error)\n ;; An arrow target is intrinsically nonconstructible. Proxy [[Call]] gives\n ;; Eli the actual method receiver without embedded foreign-language code.\n (let ((target (lambda () undefined)))\n (Object/setPrototypeOf target function-prototype)\n (Object/defineProperty target \"name\" (js-object :value name :configurable t))\n (Object/defineProperty target \"length\" (js-object :value 0 :configurable t))\n (new globalThis.Proxy target (js-object :apply (lambda (ignored receiver arguments)\n (when (nullish? receiver)\n (throw (new type-error (+ \"String.prototype.\" name \" called on null or undefined\"))))\n ;; String(Symbol) has a special exception to abstract ToString; the\n ;; String prototype algorithms do not have that exception.\n (when (= (value-type receiver) \"symbol\")\n (throw (new type-error \"Cannot convert a Symbol value to a string\")))\n (let ((text (funcall apply-native string-constructor undefined (js-array receiver))))\n (convert text upper rules)))))))\n\n (defun installUnicodeCaseProfile (version &rest arguments)\n (let* ((rules (tables version))\n (requested-realm (if (= (js-length arguments) 0) undefined (aref arguments 0)))\n (realm (if (undefined? requested-realm) globalThis.globalThis requested-realm)))\n (unless (and realm (= (value-type (get realm :String)) \"function\")\n (= (value-type (get realm :Function)) \"function\")\n (= (value-type (get realm :TypeError)) \"function\"))\n (throw (new globalThis.TypeError \"Unicode case profile requires a real String realm\")))\n (let* ((string-constructor (get realm :String)) (prototype (get string-constructor :prototype))\n (function-prototype (get (get realm :Function) :prototype)) (type-error (get realm :TypeError))\n (previous (js-call installed :get prototype)))\n (if (and previous (= (get previous :version) version)) previous\n (let ((names (js-array \"toUpperCase\" \"toLowerCase\")) (index 0))\n ;; Check both ordinary intrinsic properties before publishing any\n ;; method, including the deleted-property/nonextensible boundary.\n (while (< index 2)\n (let ((descriptor (Object/getOwnPropertyDescriptor prototype (aref names index))))\n (when (if descriptor (not (get descriptor :configurable)) (not (Object/isExtensible prototype)))\n (throw (new type-error \"Unicode case profile cannot replace a fixed String method\"))))\n (setq index (1+ index)))\n (let* ((upper (profile-method \"toUpperCase\" t rules string-constructor function-prototype type-error))\n (lower (profile-method \"toLowerCase\" false rules string-constructor function-prototype type-error))\n (state (Object/freeze (js-object :version version :upper upper :lower lower))))\n (Object/defineProperty prototype \"toUpperCase\" (js-object :value upper :writable t :enumerable false :configurable t))\n (Object/defineProperty prototype \"toLowerCase\" (js-object :value lower :writable t :enumerable false :configurable t))\n (js-call installed :set prototype state) state))))))\n ;; ESM evaluation installs once, before the importing user module executes.\n ;; A later import is cached, so user getters, replacements and deletion remain.\n (installUnicodeCaseProfile 17)\n (export installUnicod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AU,YAAW,CAAK,oBAAmB;UAC5E,qBAAoB,CAAK,CAAK,OAAM,aAAW;UAAa,aAAY,CAAK,OAAM;UACnF,WAAU,CAAS,qFAAU,OAAK;MACvC,IAAI,oBAAK,aAAS,CAAG,CAAK,UAAS,eAAU;QAAU,OAAA;;QACrD;cAAM,QAAO,CAAU,eAAc;cAAgB,QAAO;UAG1D,OAAO,kCAAG,OAAM;YACd;kBAAM,aAAa,gCAAgC,WAAU,CAAM,OAAM;cACvE,uBAAM,oBAAI,cAAW,qBAAK,CAAK,YAAW,oBAAgB,qBAAM,oBAAoB;gBAClF,0DAAO,KAAK,YAAW;;;YAC3B,CAAM,CAAA,QAAM,CAAI;;UAClB;gBAAO,QAAQ,eAAe,eAAc,MAAE,OAAM,oBAAmB,oBAAmB;gBACnF,QAAQ,eAAe,eAAc,OAAM,OAAM,oBAAmB,oBAAmB;gBACvF,QAAQ,cAAc,EAAW,WAAS,SAAQ,SAAO,OAAM,SAAO;YAC1E,sBAAsB,WAAU,eAAc,EAAW,SAAO,OAAM,YAAU,MAAE,cAAY,OAAM,gBAAc;YAClH,sBAAsB,WAAU,eAAc,EAAW,SAAO,OAAM,YAAU,MAAE,cAAY,OAAM,gBAAc;YACnH,CAAS,qFAAU,OAAK,WAAU;YAAO,OAAA;;;;;;;AAGpD,0BAA0B;AAC3B,QAAQ"}
1
+ {"version":3,"file":"runtime/unicode-case.mjs","sources":["runtime/unicode-case.eli"],"sourcesContent":["(module eliscript.runtime.unicode-case\n (import \"./unicode-case-data.mjs\" :as data)\n\n ;; Ordinary Eliscript JavaScript uses the same Unicode 17 default as the\n ;; owned runtime. Explicit profile selection remains available below.\n ;; Tables are derived from the one maintained Unicode-3.0 region in memory.eli.\n (defconst installed (new globalThis.WeakMap))\n (defconst apply-native Reflect/apply)\n (defconst intrinsic-array-join (get (get globalThis.Array :prototype) :join))\n (defconst intrinsic-string globalThis.String)\n (defconst intrinsic-code-point (get (get intrinsic-string :prototype) :codePointAt))\n (defconst intrinsic-from-code-point (get intrinsic-string :fromCodePoint))\n (defconst intrinsic-regexp-exec (get (get globalThis.RegExp :prototype) :exec))\n (defconst non-ascii (new globalThis.RegExp \"[^\\\\x00-\\\\x7f]\"))\n (defconst ascii-upper (new globalThis.RegExp \"[A-Z]\"))\n (defconst ascii-lower (new globalThis.RegExp \"[a-z]\"))\n\n (defun case-pattern? (pattern text)\n ;; RegExp.prototype.test would consult a replaceable .exec on every call.\n ;; String casing must not acquire that unrelated observable dependency.\n (not (eq (funcall apply-native intrinsic-regexp-exec pattern (js-array text)) nil)))\n\n (defun point (text index)\n (funcall apply-native intrinsic-code-point text (js-array index)))\n (defun characters (code)\n (funcall apply-native intrinsic-from-code-point intrinsic-string (js-array code)))\n (defun tables (version)\n ;; Static export references keep the table module's namespace out of every\n ;; browser bundle while retaining each profile's exact function identities.\n (cond\n ((= version 15.1)\n (js-object\n :upper (js-array (get data :unicode_case_data_upper_0_151)\n (get data :unicode_case_data_upper_1_151) (get data :unicode_case_data_upper_2_151))\n :lower (js-array (get data :unicode_case_data_lower_0_151)\n (get data :unicode_case_data_lower_1_151) (get data :unicode_case_data_lower_2_151))\n :cased (get data :unicode_case_data_cased_151)\n :ignorable (get data :unicode_case_data_case_ignorable_151)))\n ((= version 16)\n (js-object\n :upper (js-array (get data :unicode_case_data_upper_0_160)\n (get data :unicode_case_data_upper_1_160) (get data :unicode_case_data_upper_2_160))\n :lower (js-array (get data :unicode_case_data_lower_0_160)\n (get data :unicode_case_data_lower_1_160) (get data :unicode_case_data_lower_2_160))\n :cased (get data :unicode_case_data_cased_160)\n :ignorable (get data :unicode_case_data_case_ignorable_160)))\n ((= version 17)\n (js-object\n :upper (js-array (get data :unicode_case_data_upper_0_17)\n (get data :unicode_case_data_upper_1_17) (get data :unicode_case_data_upper_2_17))\n :lower (js-array (get data :unicode_case_data_lower_0_17)\n (get data :unicode_case_data_lower_1_17) (get data :unicode_case_data_lower_2_17))\n :cased (get data :unicode_case_data_cased_17)\n :ignorable (get data :unicode_case_data_case_ignorable_17)))\n (t (throw (new globalThis.TypeError \"Unicode case profile must be 15.1, 16, or 17\")))))\n\n (defun final-sigma (text index before rules)\n (let ((result before) (done false))\n (while (and (= before 1) (not done) (< index (js-length text)))\n (let ((code (point text index)))\n (when (= (funcall (get rules :ignorable) code) 0)\n (setq done t)\n (when (= (funcall (get rules :cased) code) 1) (setq result 0)))\n (setq index (+ index (if (> code 65535) 2 1))))) result))\n\n (defun convert-profile (text upper rules)\n (let* ((mapping (get rules (if upper \"upper\" \"lower\")))\n (first-map (aref mapping 0)) (second-map (aref mapping 1)) (third-map (aref mapping 2))\n (pieces (js-array)) (chunk \"\") (index 0) (before 0))\n (while (< index (js-length text))\n (let* ((code (point text index)) (step (if (> code 65535) 2 1))\n (first (funcall first-map code)) (second (funcall second-map code)) (third (funcall third-map code)))\n (when (and (not upper) (= code 931) (= (final-sigma text (+ index step) before rules) 1))\n (setq first 962))\n (setq chunk (+ chunk (characters first)))\n (when (/= second 0) (setq chunk (+ chunk (characters second))))\n (when (/= third 0) (setq chunk (+ chunk (characters third))))\n (when (>= (js-length chunk) 4096) (js-call pieces :push chunk) (setq chunk \"\"))\n (when (and (not upper) (= (funcall (get rules :ignorable) code) 0))\n (setq before (funcall (get rules :cased) code)))\n (setq index (+ index step))))\n (when (> (js-length chunk) 0) (js-call pieces :push chunk))\n (funcall apply-native intrinsic-array-join pieces (js-array \"\"))))\n\n (defun convert (text upper rules)\n ;; Already-cased ASCII is an identity under every supported profile. Avoid\n ;; three table lookups per character for this common path. Do not delegate\n ;; casing to replaceable host String methods: changed ASCII and every\n ;; non-ASCII code unit still use our exact tables and final-sigma rules.\n (if (or (case-pattern? non-ascii text)\n (case-pattern? (if upper ascii-lower ascii-upper) text))\n (convert-profile text upper rules)\n text))\n\n (defun profile-method (name upper rules string-constructor function-prototype type-error)\n ;; An arrow target is intrinsically nonconstructible. Proxy [[Call]] gives\n ;; Eli the actual method receiver without embedded foreign-language code.\n (let ((target (lambda () undefined)))\n (Object/setPrototypeOf target function-prototype)\n (Object/defineProperty target \"name\" (js-object :value name :configurable t))\n (Object/defineProperty target \"length\" (js-object :value 0 :configurable t))\n (new globalThis.Proxy target (js-object :apply (lambda (ignored receiver arguments)\n (when (nullish? receiver)\n (throw (new type-error (+ \"String.prototype.\" name \" called on null or undefined\"))))\n ;; String(Symbol) has a special exception to abstract ToString; the\n ;; String prototype algorithms do not have that exception.\n (when (= (value-type receiver) \"symbol\")\n (throw (new type-error \"Cannot convert a Symbol value to a string\")))\n (let ((text (funcall apply-native string-constructor undefined (js-array receiver))))\n (convert text upper rules)))))))\n\n (defun installUnicodeCaseProfile (version &rest arguments)\n (let* ((rules (tables version))\n (requested-realm (if (= (js-length arguments) 0) undefined (aref arguments 0)))\n (realm (if (undefined? requested-realm) globalThis.globalThis requested-realm)))\n (unless (and realm (= (value-type (get realm :String)) \"function\")\n (= (value-type (get realm :Function)) \"function\")\n (= (value-type (get realm :TypeError)) \"function\"))\n (throw (new globalThis.TypeError \"Unicode case profile requires a real String realm\")))\n (let* ((string-constructor (get realm :String)) (prototype (get string-constructor :prototype))\n (function-prototype (get (get realm :Function) :prototype)) (type-error (get realm :TypeError))\n (previous (js-call installed :get prototype)))\n (if (and previous (= (get previous :version) version)) previous\n (let ((names (js-array \"toUpperCase\" \"toLowerCase\")) (index 0))\n ;; Check both ordinary intrinsic properties before publishing any\n ;; method, including the deleted-property/nonextensible boundary.\n (while (< index 2)\n (let ((descriptor (Object/getOwnPropertyDescriptor prototype (aref names index))))\n (when (if descriptor (not (get descriptor :configurable)) (not (Object/isExtensible prototype)))\n (throw (new type-error \"Unicode case profile cannot replace a fixed String method\"))))\n (setq index (1+ index)))\n (let* ((upper (profile-method \"toUpperCase\" t rules string-constructor function-prototype type-error))\n (lower (profile-method \"toLowerCase\" false rules string-constructor function-prototype type-error))\n (state (Object/freeze (js-object :version version :upper upper :lower lower))))\n (Object/defineProperty prototype \"toUpperCase\" (js-object :value upper :writable t :enumerable false :configurable t))\n (Object/defineProperty prototype \"toLowerCase\" (js-object :value lower :writable t :enumerable false :configurable t))\n (js-call installed :set prototype state) state))))))\n ;; ESM evaluation installs once, before the importing user module executes.\n ;; A later import is cached, so user getters, replacements and deletion remain.\n (installUnicodeCaseProfile 17)\n (export installUnicodeCaseProfile))\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACE,YAAsC;AAKtC,kBAAoB,KAAK;;AACzB,qBAAuB;;AACvB,6BAA+B,CAAK,CAAK,kBAAiB,cAAY;;AACtE,yBAA2B;;AAC3B,6BAA+B,CAAK,CAAK,kBAAiB,cAAY;;AACtE,kCAAoC,CAAK,kBAAiB;;AAC1D,8BAAgC,CAAK,CAAK,mBAAkB,cAAY;;AACxE,kBAAoB,KAAK,mBAAkB;;AAC3C,oBAAsB,KAAK,mBAAkB;;AAC7C,oBAAsB,KAAK,mBAAkB;;AAE7C,6BAAsB,SAAQ;EAG5B,OAAA,EAAK,CAAa,0FAAa,6GAAsB,SAAQ,CAAU,WAAO;;AAEhF,eAAc,MAAK;EACjB,OAAS,0FAAa,2GAAqB,MAAK,CAAU;;AAC5D,oBAAmB;EACjB,OAAS,0FAAa,qHAA0B,mGAAiB,CAAU;;AAC7E,gBAAe;EAIX,IAAC,CAAG,YAAQ;IACV,OAAA,EACE,SAAO,CAAU,CAAK,MAAK,kCACzB,CAAK,MAAK,kCAAgC,CAAK,MAAK,mCACtD,SAAO,CAAU,CAAK,MAAK,kCACzB,CAAK,MAAK,kCAAgC,CAAK,MAAK,mCACtD,SAAO,CAAK,MAAK,gCACjB,aAAW,CAAK,MAAK;;IACzB,IAAC,CAAG,YAAQ;MACV,OAAA,EACE,SAAO,CAAU,CAAK,MAAK,kCACzB,CAAK,MAAK,kCAAgC,CAAK,MAAK,mCACtD,SAAO,CAAU,CAAK,MAAK,kCACzB,CAAK,MAAK,kCAAgC,CAAK,MAAK,mCACtD,SAAO,CAAK,MAAK,gCACjB,aAAW,CAAK,MAAK;;MACzB,IAAC,CAAG,Y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,CAAG,uBAAY,CAAK,OAAM,eAAU,eAC1C,CAAG,uBAAY,CAAK,OAAM,iBAAY,eACtC,CAAG,uBAAY,CAAK,OAAM,kBAAa;MAClD,0DAAO,KAAK,sBAAqB;;IACnC;UAAO,qBAAoB,CAAK,OAAM;UAAU,YAAW,CAAK,oBAAmB;UAC5E,qBAAoB,CAAK,CAAK,OAAM,aAAW;UAAa,aAAY,CAAK,OAAM;UACnF,WAAU,CAAS,qFAAU,OAAK;MACvC,IAAI,oBAAK,aAAS,CAAG,CAAK,UAAS,eAAU;QAAU,OAAA;;QACrD;cAAM,QAAO,CAAU,eAAc;cAAgB,QAAO;UAG1D,OAAO,kCAAG,OAAM;YACd;kBAAM,aAAa,gCAAgC,WAAU,CAAM,OAAM;cACvE,uBAAM,oBAAI,cAAW,qBAAK,CAAK,YAAW,oBAAgB,qBAAM,oBAAoB;gBAClF,0DAAO,KAAK,YAAW;;;YAC3B,CAAM,CAAA,QAAM,CAAI;;UAClB;gBAAO,QAAQ,eAAe,eAAc,MAAE,OAAM,oBAAmB,oBAAmB;gBACnF,QAAQ,eAAe,eAAc,OAAM,OAAM,oBAAmB,oBAAmB;gBACvF,QAAQ,cAAc,EAAW,WAAS,SAAQ,SAAO,OAAM,SAAO;YAC1E,sBAAsB,WAAU,eAAc,EAAW,SAAO,OAAM,YAAU,MAAE,cAAY,OAAM,gBAAc;YAClH,sBAAsB,WAAU,eAAc,EAAW,SAAO,OAAM,YAAU,MAAE,cAAY,OAAM,gBAAc;YACnH,CAAS,qFAAU,OAAK,WAAU;YAAO,OAAA;;;;;;;AAGpD,0BAA0B;AAC3B,QAAQ"}
@@ -341,15 +341,13 @@ function createService(...optional_arguments) {
341
341
  }
342
342
  }
343
343
  function cancel_after_failure(stream, reason) {
344
- (() => {
345
- try {
346
- return (Promise.resolve((stream)["cancel"](reason)))["catch"]((() => {
347
- return undefined;
348
- }));
349
- } catch (_ignored) {
344
+ try {
345
+ (Promise.resolve((stream)["cancel"](reason)))["catch"]((() => {
350
346
  return undefined;
351
- }
352
- })();
347
+ }));
348
+ } catch (_ignored) {
349
+ undefined;
350
+ }
353
351
  return undefined;
354
352
  }
355
353
  function createClient(...optional_arguments) {
@@ -448,17 +446,13 @@ function createClient(...optional_arguments) {
448
446
  cancel_after_failure(reader, error);
449
447
  return ((__eliscript_value_9) => { throw __eliscript_value_9; })(error);
450
448
  } finally {
451
- (() => {
452
- try {
453
- return (reader)["releaseLock"]();
454
- } catch (cleanup_error) {
455
- if ((!__eliscript_truthy(failed))) {
456
- return ((__eliscript_value_10) => { throw __eliscript_value_10; })(cleanup_error);
457
- } else {
458
- return null;
459
- }
449
+ try {
450
+ (reader)["releaseLock"]();
451
+ } catch (cleanup_error) {
452
+ if ((!__eliscript_truthy(failed))) {
453
+ ((__eliscript_value_10) => { throw __eliscript_value_10; })(cleanup_error);
460
454
  }
461
- })();
455
+ }
462
456
  }
463
457
  })());
464
458
  })(((reply)["body"])["getReader"](), false)) : null);