eliscript 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (417) hide show
  1. package/README.md +61 -0
  2. package/bootstrap/README.md +26 -0
  3. package/bootstrap/backends/README.md +515 -0
  4. package/bootstrap/backends/async.eli +230 -0
  5. package/bootstrap/backends/binary.eli +173 -0
  6. package/bootstrap/backends/capabilities.eli +74 -0
  7. package/bootstrap/backends/elf.eli +246 -0
  8. package/bootstrap/backends/managed.eli +5976 -0
  9. package/bootstrap/backends/memory.eli +100 -0
  10. package/bootstrap/backends/native.eli +2000 -0
  11. package/bootstrap/backends/numeric.eli +1362 -0
  12. package/bootstrap/backends/optimize.eli +79 -0
  13. package/bootstrap/backends/regexp.eli +2263 -0
  14. package/bootstrap/backends/sha256.eli +138 -0
  15. package/bootstrap/backends/wasm.eli +1161 -0
  16. package/bootstrap/compiler/analyzer.eli +165 -77
  17. package/bootstrap/compiler/compiler.eli +43 -19
  18. package/bootstrap/compiler/emitter.eli +780 -170
  19. package/bootstrap/compiler/expander.eli +136 -45
  20. package/bootstrap/compiler/formatter.eli +8 -1
  21. package/bootstrap/compiler/ir.eli +148 -45
  22. package/bootstrap/compiler/lower.eli +29 -2
  23. package/bootstrap/compiler/project.eli +51 -21
  24. package/bootstrap/compiler/reader.eli +128 -36
  25. package/bootstrap/compiler/source-map.eli +46 -4
  26. package/bootstrap/compiler/symbol.eli +2 -1
  27. package/bootstrap/compiler/syntax.eli +47 -12
  28. package/bootstrap/compiler/transient-analysis.eli +40 -4
  29. package/bootstrap/host/check-cli-legacy.mjs +163 -0
  30. package/bootstrap/host/check-cli.mjs +59 -158
  31. package/bootstrap/host/check-cli.mjs.map +1 -0
  32. package/bootstrap/host/compiler-session.eli +1579 -0
  33. package/bootstrap/host/compiler-tools.eli +513 -0
  34. package/bootstrap/host/eliscript-cli.mjs +53 -33
  35. package/bootstrap/host/eliscript-cli.mjs.map +1 -0
  36. package/bootstrap/host/project-cli-legacy.mjs +295 -0
  37. package/bootstrap/host/project-cli.mjs +74 -289
  38. package/bootstrap/host/project-cli.mjs.map +1 -0
  39. package/bootstrap/host/project-legacy.mjs +1080 -0
  40. package/bootstrap/host/project.mjs +210 -1060
  41. package/bootstrap/host/project.mjs.map +1 -0
  42. package/bootstrap/runtime/UNICODE-LICENSE.txt +39 -0
  43. package/bootstrap/runtime/memory.eli +30379 -0
  44. package/browser/host.mjs +732 -11
  45. package/browser/worker.mjs +6 -3
  46. package/compiler/eliscript-analyzer.el +371 -4
  47. package/compiler/eliscript-cli.el +84 -1
  48. package/compiler/eliscript-emitter.el +1189 -256
  49. package/compiler/eliscript-expander.el +147 -10
  50. package/compiler/eliscript-ir-emitter.el +725 -208
  51. package/compiler/eliscript-lower.el +127 -1
  52. package/compiler/eliscript-portable.el +177 -51
  53. package/compiler/eliscript-project.el +20 -2
  54. package/compiler/eliscript-reader.el +141 -57
  55. package/compiler/eliscript-source-map.el +26 -12
  56. package/compiler/eliscript-transient-analysis.el +382 -19
  57. package/dist/backends/async.mjs +561 -0
  58. package/dist/backends/async.mjs.macro-origins.json +1 -0
  59. package/dist/backends/async.mjs.map +1 -0
  60. package/dist/backends/binary.mjs +381 -0
  61. package/dist/backends/binary.mjs.macro-origins.json +1 -0
  62. package/dist/backends/binary.mjs.map +1 -0
  63. package/dist/backends/capabilities.mjs +237 -0
  64. package/dist/backends/capabilities.mjs.macro-origins.json +1 -0
  65. package/dist/backends/capabilities.mjs.map +1 -0
  66. package/dist/backends/elf.mjs +540 -0
  67. package/dist/backends/elf.mjs.macro-origins.json +1 -0
  68. package/dist/backends/elf.mjs.map +1 -0
  69. package/dist/backends/managed.mjs +10616 -0
  70. package/dist/backends/managed.mjs.macro-origins.json +1 -0
  71. package/dist/backends/managed.mjs.map +1 -0
  72. package/dist/backends/memory.mjs +278 -0
  73. package/dist/backends/memory.mjs.macro-origins.json +1 -0
  74. package/dist/backends/memory.mjs.map +1 -0
  75. package/dist/backends/native.mjs +4099 -0
  76. package/dist/backends/native.mjs.macro-origins.json +1 -0
  77. package/dist/backends/native.mjs.map +1 -0
  78. package/dist/backends/numeric.mjs +2458 -0
  79. package/dist/backends/numeric.mjs.macro-origins.json +1 -0
  80. package/dist/backends/numeric.mjs.map +1 -0
  81. package/dist/backends/optimize.mjs +204 -0
  82. package/dist/backends/optimize.mjs.macro-origins.json +1 -0
  83. package/dist/backends/optimize.mjs.map +1 -0
  84. package/dist/backends/regexp.mjs +2033 -0
  85. package/dist/backends/regexp.mjs.macro-origins.json +1 -0
  86. package/dist/backends/regexp.mjs.map +1 -0
  87. package/dist/backends/sha256.mjs +310 -0
  88. package/dist/backends/sha256.mjs.macro-origins.json +1 -0
  89. package/dist/backends/sha256.mjs.map +1 -0
  90. package/dist/backends/wasm.mjs +2258 -0
  91. package/dist/backends/wasm.mjs.macro-origins.json +1 -0
  92. package/dist/backends/wasm.mjs.map +1 -0
  93. package/dist/bootstrap/analyzer.mjs +1908 -776
  94. package/dist/bootstrap/analyzer.mjs.macro-origins.json +1 -0
  95. package/dist/bootstrap/analyzer.mjs.map +1 -1
  96. package/dist/bootstrap/compiler.mjs +450 -142
  97. package/dist/bootstrap/compiler.mjs.macro-origins.json +1 -0
  98. package/dist/bootstrap/compiler.mjs.map +1 -1
  99. package/dist/bootstrap/emitter.mjs +3083 -909
  100. package/dist/bootstrap/emitter.mjs.macro-origins.json +1 -0
  101. package/dist/bootstrap/emitter.mjs.map +1 -1
  102. package/dist/bootstrap/expander.mjs +2887 -1233
  103. package/dist/bootstrap/expander.mjs.macro-origins.json +1 -0
  104. package/dist/bootstrap/expander.mjs.map +1 -1
  105. package/dist/bootstrap/formatter.mjs +582 -218
  106. package/dist/bootstrap/formatter.mjs.macro-origins.json +1 -0
  107. package/dist/bootstrap/formatter.mjs.map +1 -1
  108. package/dist/bootstrap/ir.mjs +670 -116
  109. package/dist/bootstrap/ir.mjs.macro-origins.json +1 -0
  110. package/dist/bootstrap/ir.mjs.map +1 -1
  111. package/dist/bootstrap/lower.mjs +866 -257
  112. package/dist/bootstrap/lower.mjs.macro-origins.json +1 -0
  113. package/dist/bootstrap/lower.mjs.map +1 -1
  114. package/dist/bootstrap/package.json +1 -0
  115. package/dist/bootstrap/project.mjs +1168 -498
  116. package/dist/bootstrap/project.mjs.macro-origins.json +1 -0
  117. package/dist/bootstrap/project.mjs.map +1 -1
  118. package/dist/bootstrap/reader.mjs +674 -175
  119. package/dist/bootstrap/reader.mjs.macro-origins.json +1 -0
  120. package/dist/bootstrap/reader.mjs.map +1 -1
  121. package/dist/bootstrap/runtime/math.mjs +1117 -0
  122. package/dist/bootstrap/runtime/math.mjs.map +1 -0
  123. package/dist/bootstrap/runtime/unicode-case-data.mjs +10125 -0
  124. package/dist/bootstrap/runtime/unicode-case-data.mjs.map +1 -0
  125. package/dist/bootstrap/runtime/unicode-case.mjs +281 -0
  126. package/dist/bootstrap/runtime/unicode-case.mjs.map +1 -0
  127. package/dist/bootstrap/source-map.mjs +430 -119
  128. package/dist/bootstrap/source-map.mjs.macro-origins.json +1 -0
  129. package/dist/bootstrap/source-map.mjs.map +1 -1
  130. package/dist/bootstrap/symbol.mjs +229 -53
  131. package/dist/bootstrap/symbol.mjs.macro-origins.json +1 -0
  132. package/dist/bootstrap/symbol.mjs.map +1 -1
  133. package/dist/bootstrap/syntax.mjs +205 -7
  134. package/dist/bootstrap/syntax.mjs.macro-origins.json +1 -0
  135. package/dist/bootstrap/syntax.mjs.map +1 -1
  136. package/dist/bootstrap/transient-analysis.mjs +1185 -489
  137. package/dist/bootstrap/transient-analysis.mjs.macro-origins.json +1 -0
  138. package/dist/bootstrap/transient-analysis.mjs.map +1 -1
  139. package/dist/browser/compiler.js +199 -6478
  140. package/dist/browser/host.mjs +1078 -0
  141. package/dist/browser/loader.js +1 -0
  142. package/dist/browser/loader.mjs +231 -0
  143. package/dist/browser/worker.mjs +63 -0
  144. package/dist/compiler-artifact.json +1 -0
  145. package/dist/host/compiler-session.mjs +2980 -0
  146. package/dist/host/compiler-session.mjs.macro-origins.json +1 -0
  147. package/dist/host/compiler-session.mjs.map +1 -0
  148. package/dist/host/compiler-tools.mjs +1084 -0
  149. package/dist/host/compiler-tools.mjs.macro-origins.json +1 -0
  150. package/dist/host/compiler-tools.mjs.map +1 -0
  151. package/dist/literal-sources/runtime/core/collection-internals.eli +60 -0
  152. package/dist/literal-sources/runtime/core/collection.eli +639 -0
  153. package/dist/literal-sources/runtime/core/data-text.eli +290 -0
  154. package/dist/literal-sources/runtime/core/data.eli +22 -0
  155. package/dist/literal-sources/runtime/core/identifier.eli +44 -0
  156. package/dist/literal-sources/runtime/core/lazy-sequence.eli +131 -0
  157. package/dist/literal-sources/runtime/core/list.eli +19 -0
  158. package/dist/literal-sources/runtime/core/map.eli +9 -0
  159. package/dist/literal-sources/runtime/core/metadata-internals.eli +6 -0
  160. package/dist/literal-sources/runtime/core/metadata.eli +40 -0
  161. package/dist/literal-sources/runtime/core/object.eli +8 -0
  162. package/dist/literal-sources/runtime/core/order.eli +123 -0
  163. package/dist/literal-sources/runtime/core/persistent-kind.eli +28 -0
  164. package/dist/literal-sources/runtime/core/protocol-error.eli +32 -0
  165. package/dist/literal-sources/runtime/core/protocol.eli +28 -0
  166. package/dist/literal-sources/runtime/core/queue.eli +9 -0
  167. package/dist/literal-sources/runtime/core/record.eli +191 -0
  168. package/dist/literal-sources/runtime/core/regex.eli +158 -0
  169. package/dist/literal-sources/runtime/core/sequence.eli +305 -0
  170. package/dist/literal-sources/runtime/core/set-algebra.eli +28 -0
  171. package/dist/literal-sources/runtime/core/set.eli +9 -0
  172. package/dist/literal-sources/runtime/core/sorted.eli +408 -0
  173. package/dist/literal-sources/runtime/core/text.eli +14 -0
  174. package/dist/literal-sources/runtime/core/transducer.eli +268 -0
  175. package/dist/literal-sources/runtime/core/transient.eli +17 -0
  176. package/dist/literal-sources/runtime/core/truth.eli +4 -0
  177. package/dist/literal-sources/runtime/core/type.eli +232 -0
  178. package/dist/literal-sources/runtime/core/value-internals.eli +13 -0
  179. package/dist/literal-sources/runtime/core/value.eli +19 -0
  180. package/dist/literal-sources/runtime/core/vector.eli +25 -0
  181. package/dist/literal-sources/runtime/literals.eli +23 -0
  182. package/dist/literal-sources/runtime/testing/value.eli +6 -0
  183. package/dist/literal-sources/runtime/wire/http-rpc.eli +362 -0
  184. package/dist/literal-sources/runtime/wire/markdown.eli +275 -0
  185. package/dist/literal-sources/runtime/wire/schema.eli +193 -0
  186. package/dist/literal-sources/stdlib/bit.eli +36 -0
  187. package/dist/literal-sources/stdlib/core/data.eli +306 -0
  188. package/dist/literal-sources/stdlib/core/object.eli +89 -0
  189. package/dist/literal-sources/stdlib/core/protocol.eli +451 -0
  190. package/dist/literal-sources/stdlib/core/set.eli +312 -0
  191. package/dist/literal-sources/stdlib/core/text.eli +103 -0
  192. package/dist/literal-sources/stdlib/managed-literal-protocols.eli +494 -0
  193. package/dist/literal-sources/stdlib/managed-literals.eli +1469 -0
  194. package/dist/literal-sources/stdlib/managed-queue-state.eli +65 -0
  195. package/dist/literal-sources/stdlib/managed-sorted-state.eli +233 -0
  196. package/dist/literal-sources/stdlib/managed-transient-state.eli +348 -0
  197. package/dist/literal-sources/stdlib/managed-value-state.eli +153 -0
  198. package/dist/literal-sources/stdlib/managed-vector-view-state.eli +102 -0
  199. package/dist/literal-sources/stdlib/persistent-list.eli +145 -0
  200. package/dist/literal-sources/stdlib/persistent-map.eli +724 -0
  201. package/dist/literal-sources/stdlib/persistent-set.eli +236 -0
  202. package/dist/literal-sources/stdlib/persistent-vector.eli +359 -0
  203. package/dist/literal-sources/stdlib/value.eli +325 -0
  204. package/dist/package.json +10 -0
  205. package/dist/runtime/math.mjs +1116 -0
  206. package/dist/runtime/math.mjs.macro-origins.json +1 -0
  207. package/dist/runtime/math.mjs.map +1 -0
  208. package/dist/runtime/unicode-case-data.mjs +10124 -0
  209. package/dist/runtime/unicode-case-data.mjs.macro-origins.json +1 -0
  210. package/dist/runtime/unicode-case-data.mjs.map +1 -0
  211. package/dist/runtime/unicode-case.mjs +280 -0
  212. package/dist/runtime/unicode-case.mjs.macro-origins.json +1 -0
  213. package/dist/runtime/unicode-case.mjs.map +1 -0
  214. package/dist/runtime.eli +30379 -0
  215. package/dist/stage3-release.json +1 -0
  216. package/editor/README.md +1 -1
  217. package/editor/eliscript-mode.el +1 -1
  218. package/editor/eliscript-repl.el +1 -1
  219. package/package.json +106 -11
  220. package/platform/http.mjs +20 -0
  221. package/runtime/array-text.mjs +159 -0
  222. package/runtime/core/map-internals.mjs +27 -9
  223. package/runtime/core/object-impl.mjs +26 -17
  224. package/runtime/core/object-impl.mjs.map +1 -1
  225. package/runtime/core/protocol-impl.mjs +682 -255
  226. package/runtime/core/protocol-impl.mjs.map +1 -1
  227. package/runtime/core/protocol.mjs +4 -0
  228. package/runtime/core/record.mjs +23 -2
  229. package/runtime/core/regex.mjs +4 -0
  230. package/runtime/core/sorted.mjs +53 -0
  231. package/runtime/core/text-impl.mjs +167 -48
  232. package/runtime/core/text-impl.mjs.map +1 -1
  233. package/runtime/core/type.mjs +75 -3
  234. package/runtime/core/vector.mjs +6 -0
  235. package/runtime/math.eli +429 -0
  236. package/runtime/math.mjs +1116 -0
  237. package/runtime/math.mjs.map +1 -0
  238. package/runtime/number-radix.mjs +105 -0
  239. package/runtime/unicode-case-data.eli +29 -0
  240. package/runtime/unicode-case-data.mjs +10124 -0
  241. package/runtime/unicode-case-data.mjs.map +1 -0
  242. package/runtime/unicode-case.eli +100 -0
  243. package/runtime/unicode-case.mjs +280 -0
  244. package/runtime/unicode-case.mjs.map +1 -0
  245. package/runtime/wire/http-rpc.mjs +168 -0
  246. package/runtime/wire/markdown.mjs +196 -0
  247. package/runtime/wire/schema.mjs +109 -0
  248. package/stdlib/README.md +54 -0
  249. package/stdlib/core/protocol.eli +81 -17
  250. package/stdlib/core/seq.eli +1 -1
  251. package/stdlib/core/zipper.eli +172 -72
  252. package/stdlib/gepo.eli +12 -0
  253. package/stdlib/interop/js.eli +56 -15
  254. package/stdlib/managed-literal-protocols.eli +494 -0
  255. package/stdlib/managed-literals.eli +1469 -0
  256. package/stdlib/managed-protocol-error.eli +32 -0
  257. package/stdlib/managed-queue-state.eli +65 -0
  258. package/stdlib/managed-runtime-collection-internals.eli +60 -0
  259. package/stdlib/managed-runtime-collection.eli +639 -0
  260. package/stdlib/managed-runtime-data-text.eli +290 -0
  261. package/stdlib/managed-runtime-data.eli +22 -0
  262. package/stdlib/managed-runtime-identifier.eli +44 -0
  263. package/stdlib/managed-runtime-lazy-sequence.eli +131 -0
  264. package/stdlib/managed-runtime-list.eli +19 -0
  265. package/stdlib/managed-runtime-literals.eli +23 -0
  266. package/stdlib/managed-runtime-map.eli +9 -0
  267. package/stdlib/managed-runtime-metadata-internals.eli +6 -0
  268. package/stdlib/managed-runtime-metadata.eli +40 -0
  269. package/stdlib/managed-runtime-object.eli +8 -0
  270. package/stdlib/managed-runtime-order.eli +123 -0
  271. package/stdlib/managed-runtime-persistent-kind.eli +28 -0
  272. package/stdlib/managed-runtime-protocol.eli +28 -0
  273. package/stdlib/managed-runtime-queue.eli +9 -0
  274. package/stdlib/managed-runtime-record.eli +191 -0
  275. package/stdlib/managed-runtime-regex.eli +158 -0
  276. package/stdlib/managed-runtime-sequence.eli +305 -0
  277. package/stdlib/managed-runtime-set-algebra.eli +28 -0
  278. package/stdlib/managed-runtime-set.eli +9 -0
  279. package/stdlib/managed-runtime-sorted.eli +408 -0
  280. package/stdlib/managed-runtime-text.eli +14 -0
  281. package/stdlib/managed-runtime-transducer.eli +268 -0
  282. package/stdlib/managed-runtime-transient.eli +17 -0
  283. package/stdlib/managed-runtime-truth.eli +4 -0
  284. package/stdlib/managed-runtime-type.eli +232 -0
  285. package/stdlib/managed-runtime-value-internals.eli +13 -0
  286. package/stdlib/managed-runtime-value.eli +19 -0
  287. package/stdlib/managed-runtime-vector.eli +25 -0
  288. package/stdlib/managed-sorted-state.eli +233 -0
  289. package/stdlib/managed-testing-value.eli +6 -0
  290. package/stdlib/managed-transient-state.eli +348 -0
  291. package/stdlib/managed-value-state.eli +153 -0
  292. package/stdlib/managed-vector-view-state.eli +102 -0
  293. package/stdlib/managed-wire-http-rpc.eli +362 -0
  294. package/stdlib/managed-wire-markdown.eli +275 -0
  295. package/stdlib/managed-wire-schema.eli +193 -0
  296. package/stdlib/mdp.eli +7 -0
  297. package/stdlib/mds.eli +4 -0
  298. package/stdlib/persistent-vector.eli +23 -6
  299. package/tools/acceptance/check-legacy.mjs +687 -0
  300. package/tools/acceptance/check.eli +431 -0
  301. package/tools/acceptance/compile-evidence.el +49 -0
  302. package/tools/acceptance/finalize-legacy.mjs +498 -0
  303. package/tools/acceptance/finalize.eli +270 -0
  304. package/tools/backends/benchmark.mjs +175 -0
  305. package/tools/backends/build.mjs +135 -0
  306. package/tools/backends/compile.mjs +94 -0
  307. package/tools/backends/compiler-bootstrap.mjs +1001 -0
  308. package/tools/backends/compiler-browser.mjs +361 -0
  309. package/tools/backends/compiler-build.mjs +1628 -0
  310. package/tools/backends/compiler-cli-legacy.mjs +334 -0
  311. package/tools/backends/compiler-cli.mjs +29 -0
  312. package/tools/backends/compiler-corpus-bit.mjs +234 -0
  313. package/tools/backends/compiler-corpus-cli-adapters-legacy.mjs +362 -0
  314. package/tools/backends/compiler-corpus-cli-adapters.mjs +247 -0
  315. package/tools/backends/compiler-corpus-debugging.mjs +221 -0
  316. package/tools/backends/compiler-corpus-emitter.mjs +324 -0
  317. package/tools/backends/compiler-corpus-evaluation-adapters.mjs +65 -0
  318. package/tools/backends/compiler-corpus-execution-legacy.mjs +769 -0
  319. package/tools/backends/compiler-corpus-execution.mjs +3324 -0
  320. package/tools/backends/compiler-corpus-fuzz.mjs +229 -0
  321. package/tools/backends/compiler-corpus-generations.mjs +208 -0
  322. package/tools/backends/compiler-corpus-host-context-legacy.mjs +114 -0
  323. package/tools/backends/compiler-corpus-host-context.mjs +550 -0
  324. package/tools/backends/compiler-corpus-identity-host.mjs +553 -0
  325. package/tools/backends/compiler-corpus-identity-value-adapters-legacy.mjs +298 -0
  326. package/tools/backends/compiler-corpus-identity-value-adapters.mjs +69 -0
  327. package/tools/backends/compiler-corpus-isolated-exports.mjs +21 -0
  328. package/tools/backends/compiler-corpus-legacy.mjs +1155 -0
  329. package/tools/backends/compiler-corpus-literal-provider.mjs +282 -0
  330. package/tools/backends/compiler-corpus-managed-adapters-legacy.mjs +334 -0
  331. package/tools/backends/compiler-corpus-managed-adapters.mjs +937 -0
  332. package/tools/backends/compiler-corpus-managed-cases.mjs +179 -0
  333. package/tools/backends/compiler-corpus-managed-fixtures-legacy.mjs +879 -0
  334. package/tools/backends/compiler-corpus-managed-fixtures.mjs +1287 -0
  335. package/tools/backends/compiler-corpus-matchers.mjs +173 -0
  336. package/tools/backends/compiler-corpus-original-program.mjs +612 -0
  337. package/tools/backends/compiler-corpus-process.mjs +765 -0
  338. package/tools/backends/compiler-corpus-program-driver.mjs +306 -0
  339. package/tools/backends/compiler-corpus-project-adapters-legacy.mjs +497 -0
  340. package/tools/backends/compiler-corpus-project-adapters.mjs +340 -0
  341. package/tools/backends/compiler-corpus-project-entry-host.mjs +511 -0
  342. package/tools/backends/compiler-corpus-project-transport.mjs +151 -0
  343. package/tools/backends/compiler-corpus-raw-fixture-observer.mjs +1438 -0
  344. package/tools/backends/compiler-corpus-raw-language-fixtures.mjs +1456 -0
  345. package/tools/backends/compiler-corpus-raw-math-fixture.mjs +346 -0
  346. package/tools/backends/compiler-corpus-raw-special-fixtures.mjs +523 -0
  347. package/tools/backends/compiler-corpus-reference-legacy.mjs +263 -0
  348. package/tools/backends/compiler-corpus-reference.mjs +241 -0
  349. package/tools/backends/compiler-corpus-runtime-adapters-legacy.mjs +843 -0
  350. package/tools/backends/compiler-corpus-runtime-adapters.mjs +663 -0
  351. package/tools/backends/compiler-corpus-source-archive.mjs +206 -0
  352. package/tools/backends/compiler-corpus-tools-artifact-adapters.mjs +410 -0
  353. package/tools/backends/compiler-corpus-tools-cli.mjs +363 -0
  354. package/tools/backends/compiler-corpus-tools-reference.mjs +264 -0
  355. package/tools/backends/compiler-corpus.mjs +2054 -0
  356. package/tools/backends/compiler-debug.mjs +142 -0
  357. package/tools/backends/compiler-matrix.mjs +1955 -0
  358. package/tools/backends/compiler-metadata.mjs +203 -0
  359. package/tools/backends/compiler-package-browser.mjs +120 -0
  360. package/tools/backends/compiler-package-legacy.mjs +654 -0
  361. package/tools/backends/compiler-package.mjs +464 -0
  362. package/tools/backends/compiler-project.mjs +126 -0
  363. package/tools/backends/compiler-session.mjs +843 -0
  364. package/tools/backends/compiler-sha256.mjs +152 -0
  365. package/tools/backends/compiler-unicode-profile-host.mjs +196 -0
  366. package/tools/backends/compiler-worker.mjs +573 -0
  367. package/tools/backends/dist/bootstrap-js-stages.mjs +919 -0
  368. package/tools/backends/dist/bootstrap-js-stages.mjs.map +1 -0
  369. package/tools/backends/dist/managed-ir-inventory.mjs +488 -0
  370. package/tools/backends/dist/managed-ir-inventory.mjs.map +1 -0
  371. package/tools/backends/dist/record-grid.mjs +1256 -0
  372. package/tools/backends/dist/record-grid.mjs.map +1 -0
  373. package/tools/backends/dist/release-cli.mjs +462 -0
  374. package/tools/backends/dist/release-cli.mjs.map +1 -0
  375. package/tools/backends/dist/run-artifact.mjs +517 -0
  376. package/tools/backends/dist/run-artifact.mjs.map +1 -0
  377. package/tools/backends/eliscript/compiler-corpus-bit.eli +77 -0
  378. package/tools/backends/eliscript/compiler-corpus-debugging.eli +70 -0
  379. package/tools/backends/eliscript/compiler-corpus-project-entry-host.eli +256 -0
  380. package/tools/backends/managed-foreign-binding.mjs +497 -0
  381. package/tools/backends/managed-host-legacy.mjs +1181 -0
  382. package/tools/backends/managed-host-lifecycle.mjs +310 -0
  383. package/tools/backends/managed-host-object-provider.mjs +155 -0
  384. package/tools/backends/managed-host-object-realm.mjs +797 -0
  385. package/tools/backends/managed-host-proxy.mjs +71 -0
  386. package/tools/backends/managed-host-runtime.mjs +5868 -0
  387. package/tools/backends/managed-host.mjs +716 -0
  388. package/tools/backends/managed-module-graph-legacy.mjs +308 -0
  389. package/tools/backends/managed-module-graph.mjs +694 -0
  390. package/tools/backends/managed-runtime-host-legacy.mjs +195 -0
  391. package/tools/backends/managed-runtime.mjs +939 -0
  392. package/tools/backends/managed-source-view-legacy.mjs +332 -0
  393. package/tools/backends/managed-source-view.mjs +959 -0
  394. package/tools/backends/memory-runtime.mjs +100 -0
  395. package/tools/backends/native-benchmark.mjs +88 -0
  396. package/tools/backends/native-managed-runtime.mjs +677 -0
  397. package/tools/backends/native-memory.mjs +768 -0
  398. package/tools/backends/native-node-memory.mjs +142 -0
  399. package/tools/backends/native-node-runner.mjs +99 -0
  400. package/tools/backends/native-node-watchdog.mjs +19 -0
  401. package/tools/backends/native-node-worker.mjs +75 -0
  402. package/tools/backends/stage3-targets.mjs +493 -0
  403. package/tools/bootstrap-command.el +13 -0
  404. package/tools/bootstrap-runtime.el +101 -0
  405. package/tools/bootstrap-seed.el +55 -0
  406. package/tools/project/check-cli.eli +31 -0
  407. package/tools/project/project-cli.eli +42 -0
  408. package/tools/project/project.eli +122 -0
  409. package/tools/runtime/unicode-case-profiles.mjs +13 -0
  410. package/tools/runtime/unicode-case-runtime.el +57 -0
  411. package/tools/testing/source-debugging-corpus-host.eli +16 -0
  412. package/tools/testing/source-debugging.eli +139 -0
  413. package/tools/testing/stdlib-bit-corpus-host.eli +21 -0
  414. package/tools/testing/stdlib-bit-corpus-host.mjs +118 -0
  415. package/tools/testing/stdlib-bit.eli +104 -0
  416. package/tools/testing/stdlib-bit.mjs +255 -0
  417. package/bin/eliscript-bootstrap +0 -15
@@ -0,0 +1,797 @@
1
+ // Generated by Eliscript. Do not edit.
2
+ import "eliscript/runtime/unicode-case.mjs";
3
+ import { c as __eliscript_at, d as __eliscript_at_direct } from "data:text/javascript;base64,dmFyIG09UmVmbGVjdC5hcHBseSx0dD1OdW1iZXIucHJvdG90eXBlLnZhbHVlT2Ysaj1OdW1iZXIucHJvdG90eXBlL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LG4sZSk7aWYobiE9PWomJm4hPT1LJiZuIT09eiYmbiE9PU0mJm4hPT1OJiZuIT09cyYmbiE9PUUpcmV0dXJuIG87bGV0IGk9bixmPXkoZSwwKSxiPVgoZSwxKSxwPSguLi51KT0+TChpLGYsU3QoYix1KSk7VChwLHB0LHt2YWx1ZToodSk9PnUgaW5zdGFuY2VvZiBpLGNvbmZpZ3VyYWJsZTohMH0pO2xldCByPXMoRSxwLFt2b2lkIDBdKTt1dChyLGZ0KG8pKTtsZXQgbD1hdChvKTtmb3IobGV0IHU9MDt1PGwubGVuZ3RoO3UrKylUKHIsbFt1XSxsdChvLGxbdV0pKTtyZXR1cm4gcn1yZXR1cm4gcyh0LG4sZSl9fWZ1bmN0aW9uIFJ0KHQsbil7bGV0IGU9dFtuXTtyZXR1cm4oLi4ubyk9PkwoZSx0LG8pfWZ1bmN0aW9uIEF0KHQsbiwuLi5lKXtsZXQgbz10W25dO3JldHVybiBMKG8sdCxlKX1leHBvcnR7UnQgYXMgYyxBdCBhcyBkfTs=";
4
+ const __eliscript_truthy = (value) => value !== false && value != null;
5
+ const __eliscript_number_intrinsic = globalThis.Number;
6
+ const __eliscript_bigint_intrinsic = globalThis.BigInt;
7
+ const __eliscript_numeric_apply = globalThis.Reflect.apply;
8
+ const __eliscript_numeric_symbol = globalThis.Symbol.toPrimitive;
9
+ const __eliscript_numeric_error = globalThis.TypeError;
10
+ const __eliscript_numeric_trim = globalThis.String.prototype.trim;
11
+ const __eliscript_numeric_slice = globalThis.String.prototype.slice;
12
+ const __eliscript_numeric_exec = globalThis.RegExp.prototype.exec;
13
+ const __eliscript_numeric_radix = /^(?:0[xX][0-9a-fA-F]+|0[oO][0-7]+|0[bB][01]+)$/;
14
+ const __eliscript_numeric_object = (value) => value !== null && (typeof value === "object" || typeof value === "function" || (typeof value === "undefined" && value !== void 0));
15
+ const __eliscript_numeric_primitive = (value) => {
16
+ if (!__eliscript_numeric_object(value)) return value;
17
+ const exotic = value[__eliscript_numeric_symbol];
18
+ if (exotic !== void 0 && exotic !== null) {
19
+ const result = __eliscript_numeric_apply(exotic, value, ["number"]);
20
+ if (!__eliscript_numeric_object(result)) return result;
21
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
22
+ }
23
+ for (let index = 0; index < 2; index++) {
24
+ const method = value[index === 0 ? "valueOf" : "toString"];
25
+ if (typeof method === "function" || (typeof method === "undefined" && method !== void 0)) {
26
+ const result = __eliscript_numeric_apply(method, value, []);
27
+ if (!__eliscript_numeric_object(result)) return result;
28
+ }
29
+ }
30
+ throw new __eliscript_numeric_error("Cannot convert object to primitive value");
31
+ };
32
+ const __eliscript_to_number = (value) => {
33
+ const primitive = __eliscript_numeric_primitive(value);
34
+ if (typeof primitive === "string") {
35
+ const text = __eliscript_numeric_apply(__eliscript_numeric_trim, primitive, []);
36
+ if (__eliscript_numeric_apply(__eliscript_numeric_exec, __eliscript_numeric_radix, [text]) !== null) {
37
+ let first = 2;
38
+ while (first < text.length && text[first] === "0") first++;
39
+ if (first === text.length) return 0;
40
+ const prefix = text[1];
41
+ const limit = prefix === "x" || prefix === "X" ? 256 : prefix === "b" || prefix === "B" ? 1024 : 342;
42
+ if (text.length - first > limit) return 1 / 0;
43
+ const token = __eliscript_numeric_apply(__eliscript_numeric_slice, text, [0, 2]) + __eliscript_numeric_apply(__eliscript_numeric_slice, text, [first]);
44
+ return __eliscript_number_intrinsic(__eliscript_bigint_intrinsic(token));
45
+ }
46
+ }
47
+ return __eliscript_number_intrinsic(primitive);
48
+ };
49
+ const __eliscript_numeric = (value) => {
50
+ if (typeof value === "number" || typeof value === "bigint") return value;
51
+ const primitive = __eliscript_numeric_primitive(value);
52
+ if (typeof primitive === "number" || typeof primitive === "bigint") return primitive;
53
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
54
+ };
55
+ const __eliscript_implicit_number = (value) => {
56
+ if (typeof value === "number") return value;
57
+ const primitive = __eliscript_numeric_primitive(value);
58
+ if (typeof primitive === "bigint") throw new __eliscript_numeric_error("Cannot convert a BigInt value to a number");
59
+ return typeof primitive === "string" ? __eliscript_to_number(primitive) : +primitive;
60
+ };
61
+ const __eliscript_numeric_decrement = (value) => __eliscript_implicit_number(value) - 1;
62
+ const __eliscript_numeric_sub = (a, b) => { if (typeof a === "number" && typeof b === "number") return a - b; return __eliscript_numeric(a) - __eliscript_numeric(b); };
63
+ const __eliscript_numeric_mul = (a, b) => { if (typeof a === "number" && typeof b === "number") return a * b; return __eliscript_numeric(a) * __eliscript_numeric(b); };
64
+ const __eliscript_numeric_div = (a, b) => { if (typeof a === "number" && typeof b === "number") return a / b; return __eliscript_numeric(a) / __eliscript_numeric(b); };
65
+ const __eliscript_numeric_rem = (a, b) => { if (typeof a === "number" && typeof b === "number") return a % b; return __eliscript_numeric(a) % __eliscript_numeric(b); };
66
+ const __eliscript_numeric_and = (a, b) => { if (typeof a === "number" && typeof b === "number") return a & b; return __eliscript_numeric(a) & __eliscript_numeric(b); };
67
+ const __eliscript_numeric_or = (a, b) => { if (typeof a === "number" && typeof b === "number") return a | b; return __eliscript_numeric(a) | __eliscript_numeric(b); };
68
+ const __eliscript_numeric_xor = (a, b) => { if (typeof a === "number" && typeof b === "number") return a ^ b; return __eliscript_numeric(a) ^ __eliscript_numeric(b); };
69
+ const __eliscript_numeric_shl = (a, b) => { if (typeof a === "number" && typeof b === "number") return a << b; return __eliscript_numeric(a) << __eliscript_numeric(b); };
70
+ const __eliscript_numeric_shr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >> b; return __eliscript_numeric(a) >> __eliscript_numeric(b); };
71
+ const __eliscript_numeric_ushr = (a, b) => { if (typeof a === "number" && typeof b === "number") return a >>> b; return __eliscript_numeric(a) >>> __eliscript_numeric(b); };
72
+ const __eliscript_numeric_neg = (a) => typeof a === "number" ? -a : -__eliscript_numeric(a);
73
+ const __eliscript_numeric_int32 = (a) => typeof a === "number" ? a | 0 : __eliscript_numeric(a) | 0;
74
+ const __eliscript_numeric_uint32 = (a) => typeof a === "number" ? a >>> 0 : __eliscript_numeric(a) >>> 0;
75
+ const __eliscript_numeric_not = (a) => typeof a === "number" ? ~a : ~__eliscript_numeric(a);
76
+ const __eliscript_numeric_relation = (operator, left, right) => {
77
+ if (typeof left === "number" && typeof right === "number") {
78
+ if (operator === "<") return left < right;
79
+ if (operator === "<=") return left <= right;
80
+ if (operator === ">") return left > right;
81
+ return left >= right;
82
+ }
83
+ let a = __eliscript_numeric_primitive(left);
84
+ let b = __eliscript_numeric_primitive(right);
85
+ const x = typeof a, y = typeof b;
86
+ if (!((x === "string" && y === "string") || (x === "bigint" && y === "string") || (x === "string" && y === "bigint"))) {
87
+ a = __eliscript_numeric(a);
88
+ b = __eliscript_numeric(b);
89
+ }
90
+ if (operator === "<") return a < b;
91
+ if (operator === "<=") return a <= b;
92
+ if (operator === ">") return a > b;
93
+ return a >= b;
94
+ };
95
+
96
+ import {readHostObjectConstructor, readHostObjectPrototype, readHostObjectIntrinsics, hostObjectDescriptorPrototypeClear, readHostArrayConstructor, readHostArrayPrototype, readHostArrayIntrinsics, readHostReflectIntrinsics} from "./managed-host-object-provider.mjs";
97
+ import {failManagedRuntime} from "./managed-host-legacy.mjs";
98
+ function data_function(descriptors, name) {
99
+ {
100
+ const __eliscript_value_1 = (descriptors)[name];
101
+ {
102
+ let entry = __eliscript_value_1;
103
+ if (__eliscript_truthy(((__eliscript_value_2) => (__eliscript_truthy(__eliscript_value_2) ? ((__eliscript_value_3) => (__eliscript_truthy(__eliscript_value_3) ? (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })((entry)["value"]) === "function") : __eliscript_value_3))(Object.hasOwn(entry, "value")) : __eliscript_value_2))(entry))) {
104
+ return (entry)["value"];
105
+ } else {
106
+ return null;
107
+ }
108
+ }
109
+ }
110
+ }
111
+ function function_shape(target, source) {
112
+ Object.defineProperties(target, ({"name": Object.getOwnPropertyDescriptor(source, "name"), "length": Object.getOwnPropertyDescriptor(source, "length")}));
113
+ return target;
114
+ }
115
+ function ordinary_native_object_p(context, heap, value, kind) {
116
+ return (((kind === 13) || (kind === 14)) && ((kind === 14) || ((__eliscript_value_4, __eliscript_value_5) => (__eliscript_value_4 !== __eliscript_value_5))((((context)["memory"])["view"]())["getUint32"](__eliscript_numeric_sub(((context)["checked"])("value-data", heap, value, 13), 12), true), 1)));
117
+ }
118
+ function native_data_definition_p(context, heap, target, key, definition) {
119
+ {
120
+ let checked = (context)["checked"];
121
+ let parent = (((context)["memory"])["view"]())["getUint32"]((checked("value-data", heap, definition, 13) + 4), true);
122
+ let canonical = checked("value-standard-prototype-existing", heap, 0);
123
+ if (__eliscript_truthy(((__eliscript_value_6) => (__eliscript_truthy(__eliscript_value_6) ? ((__eliscript_value_7) => (__eliscript_truthy(__eliscript_value_7) ? (context)["dataDefinition"] : __eliscript_value_7))(((__eliscript_value_8) => (__eliscript_truthy(__eliscript_value_8) ? __eliscript_value_8 : hostObjectDescriptorPrototypeClear()))((parent === 0))) : __eliscript_value_6))(((parent === 0) || (parent === 3) || (__eliscript_numeric_relation(">", canonical, 3) && (parent === canonical)))))) {
124
+ return (checked("value-source-data-definition-p", heap, definition) === 1);
125
+ } else {
126
+ return null;
127
+ }
128
+ }
129
+ }
130
+ function native_constructor_method_p(method) {
131
+ return ((__eliscript_value_9) => (__eliscript_truthy(__eliscript_value_9) ? __eliscript_value_9 : ((__eliscript_value_11) => (__eliscript_truthy(__eliscript_value_11) ? ((method)["constructObject"] === true) : __eliscript_value_11))(Object.hasOwn(method, "constructObject"))))(((__eliscript_value_10) => (__eliscript_truthy(__eliscript_value_10) ? ((method)["constructArray"] === true) : __eliscript_value_10))(Object.hasOwn(method, "constructArray")));
132
+ }
133
+ function native_intrinsic_operation(context, heap, arguments$, count, opcode) {
134
+ if (__eliscript_numeric_relation(">=", count, ((opcode === 9) ? 2 : 3))) {
135
+ {
136
+ let checked = (context)["checked"];
137
+ let tokens = (context)["nativeTokens"];
138
+ let target = checked("value-get", heap, arguments$, 1);
139
+ if (__eliscript_truthy(((__eliscript_value_12) => (__eliscript_truthy(__eliscript_value_12) ? (__eliscript_numeric_relation(">", target, 3) && (checked("value-kind", heap, target) === 35)) : __eliscript_value_12))(tokens))) {
140
+ {
141
+ const __eliscript_value_13 = (tokens)["get"](checked("value-foreign-token", heap, target));
142
+ {
143
+ let method = __eliscript_value_13;
144
+ if (__eliscript_truthy(((__eliscript_value_14) => (__eliscript_truthy(__eliscript_value_14) ? (method)["runtime"] : __eliscript_value_14))(method))) {
145
+ if (((method)["runtime"] === "value-reflect-builtin")) {
146
+ if (((opcode === 8) && __eliscript_numeric_relation(">=", __eliscript_numeric_sub(count, 3), (method)["minimumArity"]))) {
147
+ {
148
+ let value = checked("value-get", heap, arguments$, 3);
149
+ let kind = (__eliscript_numeric_relation(">", value, 3) ? checked("value-kind", heap, value) : 0);
150
+ if (__eliscript_truthy(((__eliscript_value_15) => (__eliscript_truthy(__eliscript_value_15) ? __eliscript_value_15 : ordinary_native_object_p(context, heap, value, kind)))((kind === 18)))) {
151
+ return ({"name": (method)["name"], "arity": __eliscript_numeric_sub(count, 3), "runtime": (method)["runtime"], "operation": (method)["operation"]});
152
+ } else {
153
+ return null;
154
+ }
155
+ }
156
+ } else {
157
+ return null;
158
+ }
159
+ } else {
160
+ if (((method)["runtime"] === "value-builtin-primitive")) {
161
+ if ((opcode === 8)) {
162
+ return ({"name": (method)["name"], "arity": (__eliscript_numeric_relation(">", count, 3) ? 1 : 0), "value": (__eliscript_numeric_relation(">", count, 3) ? checked("value-get", heap, arguments$, 3) : 3), "runtime": (method)["runtime"], "operation": (method)["operation"]});
163
+ } else {
164
+ return null;
165
+ }
166
+ } else {
167
+ if (__eliscript_truthy(native_constructor_method_p(method))) {
168
+ if ((((__eliscript_value_16, __eliscript_value_17) => (__eliscript_value_16 !== __eliscript_value_17))(opcode, 19) || (checked("value-get", heap, arguments$, 2) === target))) {
169
+ {
170
+ let offset = ((opcode === 9) ? 2 : 3);
171
+ let input = (__eliscript_numeric_relation(">", count, offset) ? checked("value-get", heap, arguments$, offset) : 3);
172
+ if (__eliscript_truthy(((__eliscript_value_18) => (__eliscript_truthy(__eliscript_value_18) ? __eliscript_value_18 : ((__eliscript_value_19) => (__eliscript_truthy(__eliscript_value_19) ? __eliscript_value_19 : ((__eliscript_value_20) => (__eliscript_truthy(__eliscript_value_20) ? __eliscript_value_20 : ((__eliscript_value_21) => (__eliscript_truthy(__eliscript_value_21) ? ([13, 14, 15, 16, 17, 18, 21, 23, 24, 26, 35, 36])["includes"](checked("value-kind", heap, input)) : __eliscript_value_21))(__eliscript_numeric_relation(">", input, 3))))((input === 3))))((input === 0))))(((method)["operation"] === 75)))) {
173
+ return ({"name": (method)["name"], "arity": __eliscript_numeric_sub(count, offset), "value": target, "argumentOffset": offset, "nativeConstructor": true, "construct": ((opcode === 8) ? 0 : 1), "runtime": (method)["runtime"], "operation": (method)["operation"]});
174
+ } else {
175
+ return null;
176
+ }
177
+ }
178
+ } else {
179
+ return null;
180
+ }
181
+ } else {
182
+ if ((opcode === 8)) {
183
+ {
184
+ const __eliscript_value_22 = checked("value-get", heap, arguments$, 2);
185
+ {
186
+ let receiver = __eliscript_value_22;
187
+ if ((__eliscript_numeric_relation(">", receiver, 3) && (checked("value-kind", heap, receiver) === (((method)["runtime"] === "value-array-prototype-call") ? 14 : 17)))) {
188
+ return ({"name": (method)["name"], "arity": __eliscript_numeric_sub(count, 3), "value": receiver, "runtime": (method)["runtime"], "operation": (method)["operation"]});
189
+ } else {
190
+ return null;
191
+ }
192
+ }
193
+ }
194
+ } else {
195
+ return null;
196
+ }
197
+ }
198
+ }
199
+ }
200
+ } else {
201
+ return null;
202
+ }
203
+ }
204
+ }
205
+ } else {
206
+ return null;
207
+ }
208
+ }
209
+ } else {
210
+ return null;
211
+ }
212
+ }
213
+ function native_object_operation(context, heap, arguments$, count) {
214
+ {
215
+ let checked = (context)["checked"];
216
+ let tokens = (context)["nativeTokens"];
217
+ let target = (__eliscript_numeric_relation(">=", count, 3) ? checked("value-get", heap, arguments$, 1) : 0);
218
+ if (__eliscript_truthy(((__eliscript_value_23) => (__eliscript_truthy(__eliscript_value_23) ? (__eliscript_numeric_relation(">", target, 3) && (checked("value-kind", heap, target) === 35)) : __eliscript_value_23))(tokens))) {
219
+ {
220
+ const __eliscript_value_24 = (tokens)["get"](checked("value-foreign-token", heap, target));
221
+ {
222
+ let method = __eliscript_value_24;
223
+ if (__eliscript_truthy(((__eliscript_value_25) => (__eliscript_truthy(__eliscript_value_25) ? (!__eliscript_truthy((method)["runtime"])) : __eliscript_value_25))(method))) {
224
+ {
225
+ let name = (method)["name"];
226
+ let arity = (((name === "freeze") || (name === "isFrozen") || (name === "create") || (name === "getPrototypeOf")) ? 1 : (((name === "hasOwn") || (name === "getOwnPropertyDescriptor") || (name === "defineProperties")) ? 2 : 3));
227
+ let value = ((count === (arity + 3)) ? checked("value-get", heap, arguments$, 3) : 0);
228
+ let kind = (__eliscript_numeric_relation(">", value, 3) ? checked("value-kind", heap, value) : 0);
229
+ if (__eliscript_truthy(((__eliscript_value_26) => (__eliscript_truthy(__eliscript_value_26) ? ((name === "create") ? ((__eliscript_value_27) => (__eliscript_truthy(__eliscript_value_27) ? __eliscript_value_27 : ((__eliscript_value_28) => (__eliscript_truthy(__eliscript_value_28) ? ordinary_native_object_p(context, heap, value, kind) : __eliscript_value_28))((kind === 13))))((value === 0)) : ((__eliscript_value_29) => (__eliscript_truthy(__eliscript_value_29) ? __eliscript_value_29 : ((kind === 18) && ((name === "defineProperty") || (name === "defineProperties") || (name === "freeze") || (name === "isFrozen") || (name === "getOwnPropertyDescriptor")))))(ordinary_native_object_p(context, heap, value, kind))) : __eliscript_value_26))((count === (arity + 3))))) {
230
+ {
231
+ let key = (__eliscript_numeric_relation(">", arity, 1) ? checked("value-get", heap, arguments$, 4) : 3);
232
+ let key_kind = (__eliscript_numeric_relation(">", key, 3) ? checked("value-kind", heap, key) : 0);
233
+ let definition = ((arity === 3) ? checked("value-get", heap, arguments$, 5) : 3);
234
+ if (__eliscript_truthy(((__eliscript_value_30) => (__eliscript_truthy(__eliscript_value_30) ? ((__eliscript_value_32) => (__eliscript_truthy(__eliscript_value_32) ? __eliscript_value_32 : ((__eliscript_value_35) => (__eliscript_truthy(__eliscript_value_35) ? ((__eliscript_value_36) => (__eliscript_truthy(__eliscript_value_36) ? ((__eliscript_value_37) => (__eliscript_truthy(__eliscript_value_37) ? native_data_definition_p(context, heap, value, key, definition) : __eliscript_value_37))(ordinary_native_object_p(context, heap, definition, 13)) : __eliscript_value_36))((checked("value-kind", heap, definition) === 13)) : __eliscript_value_35))(__eliscript_numeric_relation(">", definition, 3))))(((__eliscript_value_33, __eliscript_value_34) => (__eliscript_value_33 !== __eliscript_value_34))(arity, 3)) : __eliscript_value_30))(((name === "defineProperties") ? ((__eliscript_value_31) => (__eliscript_truthy(__eliscript_value_31) ? ordinary_native_object_p(context, heap, key, key_kind) : __eliscript_value_31))(__eliscript_numeric_relation(">", key, 3)) : ((arity === 1) || __eliscript_numeric_relation("<=", key, 3) || (key_kind === 4) || (key_kind === 5) || (key_kind === 22) || (key_kind === 34)))))) {
235
+ return ({"name": name, "arity": arity, "value": value});
236
+ } else {
237
+ return null;
238
+ }
239
+ }
240
+ } else {
241
+ return null;
242
+ }
243
+ }
244
+ } else {
245
+ return null;
246
+ }
247
+ }
248
+ }
249
+ } else {
250
+ return null;
251
+ }
252
+ }
253
+ }
254
+ function call_native_object_operation(context, heap, arguments$, operation) {
255
+ {
256
+ const __eliscript_value_38 = (context)["raw"];
257
+ const __eliscript_value_39 = (context)["checked"];
258
+ const __eliscript_value_40 = (operation)["arity"];
259
+ const __eliscript_value_41 = ((v) => {
260
+ if ((v === undefined)) {
261
+ return 3;
262
+ } else {
263
+ return v;
264
+ }
265
+ })((operation)["argumentOffset"]);
266
+ const __eliscript_value_42 = 0;
267
+ const __eliscript_value_43 = 0;
268
+ const __eliscript_value_44 = 0;
269
+ const __eliscript_value_45 = 0;
270
+ {
271
+ let raw = __eliscript_value_38;
272
+ let checked = __eliscript_value_39;
273
+ let arity = __eliscript_value_40;
274
+ let offset = __eliscript_value_41;
275
+ let frame = __eliscript_value_42;
276
+ let result = __eliscript_value_43;
277
+ let status = __eliscript_value_44;
278
+ let source_class = __eliscript_value_45;
279
+ (() => {
280
+ try {
281
+ ((frame = checked("frame-new", heap, 1)));
282
+ {
283
+ const __eliscript_value_46 = checked("value-refs", heap, 7, arity);
284
+ const __eliscript_value_47 = 0;
285
+ {
286
+ let tuple = __eliscript_value_46;
287
+ let index = __eliscript_value_47;
288
+ checked("frame-set", heap, frame, 0, tuple);
289
+ while (__eliscript_numeric_relation("<", index, arity)) {
290
+ checked("value-set", heap, tuple, index, checked("value-get", heap, arguments$, (index + offset)));
291
+ ((index = (index + 1)));
292
+ }
293
+ return ((result = (__eliscript_truthy(((__eliscript_value_48) => (__eliscript_truthy(__eliscript_value_48) ? ((operation)["nativeConstructor"] === true) : __eliscript_value_48))(Object.hasOwn(operation, "nativeConstructor"))) ? raw("value-native-constructor-call", heap, (operation)["value"], tuple, arity, (operation)["operation"], (operation)["construct"]) : (((operation)["runtime"] === "value-builtin-primitive") ? raw("value-builtin-primitive", heap, (operation)["value"], arity, (operation)["operation"]) : (((operation)["runtime"] === "value-reflect-builtin") ? raw("value-reflect-builtin", heap, tuple, arity, (operation)["operation"]) : (__eliscript_truthy((operation)["runtime"]) ? raw((operation)["runtime"], heap, (operation)["value"], tuple, arity, (operation)["operation"]) : (((operation)["name"] === "create") ? raw("value-object-new", heap, (operation)["value"]) : (((operation)["name"] === "getPrototypeOf") ? raw("value-object-reflection", heap, tuple, arity, 0) : (((operation)["name"] === "getOwnPropertyDescriptor") ? raw("value-object-reflection", heap, tuple, arity, 2) : (((operation)["name"] === "freeze") ? raw("value-object-integrity", heap, (operation)["value"], 0) : (((operation)["name"] === "isFrozen") ? raw("value-object-integrity", heap, (operation)["value"], 1) : (((operation)["name"] === "hasOwn") ? raw("value-object-properties", heap, tuple, arity, 1) : (((operation)["name"] === "defineProperties") ? raw("value-object-meta-builtin", heap, tuple, arity, 1) : raw("value-object-meta-builtin", heap, tuple, arity, 0))))))))))))));
294
+ }
295
+ }
296
+ } finally {
297
+ ((status = raw("last-error")), (source_class = raw("value-exception-class", heap)));
298
+ if (((__eliscript_value_49, __eliscript_value_50) => (__eliscript_value_49 !== __eliscript_value_50))(frame, 0)) {
299
+ raw("frame-pop", heap, frame);
300
+ }
301
+ raw("value-exception-class-set", heap, source_class);
302
+ raw("value-error-restore", status);
303
+ }
304
+ })();
305
+ return result;
306
+ }
307
+ }
308
+ }
309
+ function native_runtime_intrinsic_tag(method) {
310
+ {
311
+ const __eliscript_value_51 = (method)["runtime"];
312
+ const __eliscript_value_52 = (method)["operation"];
313
+ {
314
+ let runtime = __eliscript_value_51;
315
+ let operation = __eliscript_value_52;
316
+ if (__eliscript_truthy(((__eliscript_value_53) => (__eliscript_truthy(__eliscript_value_53) ? ((__eliscript_value_54) => (__eliscript_truthy(__eliscript_value_54) ? ((__eliscript_value_55) => (__eliscript_truthy(__eliscript_value_55) ? ((method)["constructObject"] === true) : __eliscript_value_55))(Object.hasOwn(method, "constructObject")) : __eliscript_value_54))((operation === 76)) : __eliscript_value_53))((runtime === "value-native-constructor-call")))) {
317
+ return 76;
318
+ } else {
319
+ if (((runtime === "value-builtin-primitive") && (operation === 5))) {
320
+ return 5;
321
+ } else {
322
+ if (((runtime === "value-reflect-builtin") && __eliscript_numeric_relation(">=", operation, 0) && __eliscript_numeric_relation("<=", operation, 12))) {
323
+ return (operation + 181);
324
+ } else {
325
+ if (((runtime === "value-array-prototype-call") && __eliscript_numeric_relation(">=", operation, 200) && __eliscript_numeric_relation("<=", operation, 227))) {
326
+ return operation;
327
+ } else {
328
+ if (((runtime === "value-collection-prototype-iterator-builtin") && (operation === 328))) {
329
+ return 328;
330
+ } else {
331
+ if ((!__eliscript_truthy(runtime))) {
332
+ {
333
+ const __eliscript_value_56 = (method)["name"];
334
+ {
335
+ let name = __eliscript_value_56;
336
+ if ((name === "freeze")) {
337
+ return 401;
338
+ } else {
339
+ if ((name === "isFrozen")) {
340
+ return 402;
341
+ } else {
342
+ if ((name === "create")) {
343
+ return 403;
344
+ } else {
345
+ if ((name === "getPrototypeOf")) {
346
+ return 404;
347
+ } else {
348
+ if ((name === "getOwnPropertyDescriptor")) {
349
+ return 405;
350
+ } else {
351
+ if ((name === "hasOwn")) {
352
+ return 406;
353
+ } else {
354
+ if ((name === "defineProperties")) {
355
+ return 407;
356
+ } else {
357
+ return 0;
358
+ }
359
+ }
360
+ }
361
+ }
362
+ }
363
+ }
364
+ }
365
+ }
366
+ }
367
+ } else {
368
+ return 0;
369
+ }
370
+ }
371
+ }
372
+ }
373
+ }
374
+ }
375
+ }
376
+ }
377
+ }
378
+ function register_native_object_operations(context, lifecycle) {
379
+ {
380
+ const __eliscript_value_57 = (context)["runtime"];
381
+ const __eliscript_value_58 = (context)["checked"];
382
+ const __eliscript_value_59 = (context)["raw"];
383
+ const __eliscript_value_60 = (context)["owner"];
384
+ const __eliscript_value_61 = [];
385
+ const __eliscript_value_62 = [];
386
+ const __eliscript_value_63 = new (globalThis.Map)();
387
+ const __eliscript_value_64 = false;
388
+ {
389
+ let runtime = __eliscript_value_57;
390
+ let checked = __eliscript_value_58;
391
+ let raw = __eliscript_value_59;
392
+ let owner = __eliscript_value_60;
393
+ let roots = __eliscript_value_61;
394
+ let registered = __eliscript_value_62;
395
+ let tokens = __eliscript_value_63;
396
+ let released = __eliscript_value_64;
397
+ ((context)["nativeTokens"] = tokens);
398
+ {
399
+ const __eliscript_value_65 = (lifecycle)["dispose"];
400
+ {
401
+ let dispose = __eliscript_value_65;
402
+ ((lifecycle)["dispose"] = (() => {
403
+ {
404
+ const __eliscript_value_66 = raw("last-error");
405
+ const __eliscript_value_67 = raw("value-exception-class", owner);
406
+ const __eliscript_value_68 = undefined;
407
+ const __eliscript_value_69 = false;
408
+ {
409
+ let status = __eliscript_value_66;
410
+ let source_class = __eliscript_value_67;
411
+ let failure = __eliscript_value_68;
412
+ let failed = __eliscript_value_69;
413
+ if ((!__eliscript_truthy(released))) {
414
+ ((released = true));
415
+ (registered)["forEach"](((function$) => {
416
+ return (() => {
417
+ try {
418
+ return checked("value-foreign-intrinsic-register", owner, function$, 0);
419
+ } catch (error) {
420
+ if ((!__eliscript_truthy(failed))) {
421
+ return ((failed = true), (failure = error));
422
+ } else {
423
+ return null;
424
+ }
425
+ }
426
+ })();
427
+ }));
428
+ ((registered)["length"] = 0);
429
+ (roots)["forEach"](((root) => {
430
+ return (() => {
431
+ try {
432
+ return (runtime)["release"](root);
433
+ } catch (error) {
434
+ if ((!__eliscript_truthy(failed))) {
435
+ return ((failed = true), (failure = error));
436
+ } else {
437
+ return null;
438
+ }
439
+ }
440
+ })();
441
+ }));
442
+ (tokens)["clear"]();
443
+ }
444
+ raw("value-exception-class-set", owner, source_class);
445
+ raw("value-error-restore", status);
446
+ __eliscript_at(Reflect, "apply")(dispose, lifecycle, []);
447
+ if (__eliscript_truthy(failed)) {
448
+ return ((__eliscript_value_70) => { throw __eliscript_value_70; })(failure);
449
+ } else {
450
+ return null;
451
+ }
452
+ }
453
+ }
454
+ }));
455
+ }
456
+ }
457
+ return (() => {
458
+ try {
459
+ return (((readHostObjectIntrinsics())["concat"](readHostArrayIntrinsics(), readHostReflectIntrinsics()))["filter"](((method) => {
460
+ return ((__eliscript_value_71) => (__eliscript_truthy(__eliscript_value_71) ? __eliscript_value_71 : ((!__eliscript_truthy((method)["runtime"])) ? true : (__eliscript_truthy(native_constructor_method_p(method)) ? (context)["nativeConstructor"] : (((method)["runtime"] === "value-builtin-primitive") ? (context)["primitivePredicate"] : (((method)["runtime"] === "value-reflect-builtin") ? (context)["reflectBuiltin"] : (((method)["runtime"] === "value-array-prototype-call") ? (context)["arraySlice"] : (context)["arrayIterator"])))))))((!__eliscript_truthy(method)));
461
+ })))["forEach"](((method) => {
462
+ if (__eliscript_truthy(method)) {
463
+ {
464
+ const __eliscript_value_72 = (runtime)["frame"](1);
465
+ const __eliscript_value_73 = undefined;
466
+ {
467
+ let frame = __eliscript_value_72;
468
+ let token = __eliscript_value_73;
469
+ return (() => {
470
+ try {
471
+ ((token = (runtime)["fromHostValue"]((method)["method"])));
472
+ (roots)["push"](token);
473
+ (runtime)["frameSet"](frame, 0, token);
474
+ {
475
+ const __eliscript_value_74 = checked("frame-get", owner, checked("frame-current", owner), 0);
476
+ {
477
+ let function$ = __eliscript_value_74;
478
+ if ((!(checked("value-kind", owner, function$) === 35))) {
479
+ failManagedRuntime(3);
480
+ }
481
+ (tokens)["set"](checked("value-foreign-token", owner, function$), method);
482
+ {
483
+ const __eliscript_value_75 = native_runtime_intrinsic_tag(method);
484
+ {
485
+ let operation = __eliscript_value_75;
486
+ if (__eliscript_truthy(((__eliscript_value_76) => (__eliscript_truthy(__eliscript_value_76) ? (context)["foreignIntrinsic"] : __eliscript_value_76))(((__eliscript_value_77, __eliscript_value_78) => (__eliscript_value_77 !== __eliscript_value_78))(operation, 0)))) {
487
+ (registered)["push"](function$);
488
+ return checked("value-foreign-intrinsic-register", owner, function$, operation);
489
+ } else {
490
+ return null;
491
+ }
492
+ }
493
+ }
494
+ }
495
+ }
496
+ } finally {
497
+ (runtime)["leaveFrame"](frame);
498
+ }
499
+ })();
500
+ }
501
+ }
502
+ } else {
503
+ return null;
504
+ }
505
+ }));
506
+ } catch (error) {
507
+ (() => {
508
+ try {
509
+ return ((lifecycle)["dispose"])();
510
+ } catch (ignored) {
511
+ return null;
512
+ }
513
+ })();
514
+ return ((__eliscript_value_79) => { throw __eliscript_value_79; })(error);
515
+ }
516
+ })();
517
+ }
518
+ }
519
+ }
520
+ function dispatch_host_object_identity(context, handler, name, heap, arguments$) {
521
+ if ((!((name === "source-operation") && (heap === (context)["owner"])))) {
522
+ return handler(name, heap, arguments$);
523
+ } else {
524
+ {
525
+ const __eliscript_value_80 = (context)["raw"];
526
+ const __eliscript_value_81 = (context)["checked"];
527
+ {
528
+ let raw = __eliscript_value_80;
529
+ let checked = __eliscript_value_81;
530
+ if (((__eliscript_value_82, __eliscript_value_83) => (__eliscript_value_82 !== __eliscript_value_83))(raw("last-error"), 0)) {
531
+ return 0;
532
+ } else {
533
+ {
534
+ let kind = checked("value-kind", heap, arguments$);
535
+ let count = ((kind === 7) ? checked("value-length", heap, arguments$) : 0);
536
+ let opcode = (__eliscript_numeric_relation(">", count, 0) ? checked("value-get", heap, arguments$, 0) : 0);
537
+ let operation = ((__eliscript_numeric_relation(">", opcode, 3) && (checked("value-kind", heap, opcode) === 4)) ? (((context)["memory"])["view"]())["getFloat64"](checked("value-data", heap, opcode, 4), true) : -1);
538
+ if (((__eliscript_value_84, __eliscript_value_85) => (__eliscript_value_84 !== __eliscript_value_85))(operation, 35)) {
539
+ {
540
+ const __eliscript_value_86 = (((operation === 8) || (operation === 9) || (operation === 19)) ? ((__eliscript_value_87) => (__eliscript_truthy(__eliscript_value_87) ? __eliscript_value_87 : ((operation === 8) ? native_object_operation(context, heap, arguments$, count) : null)))(native_intrinsic_operation(context, heap, arguments$, count, operation)) : null);
541
+ {
542
+ let native = __eliscript_value_86;
543
+ if (__eliscript_truthy(native)) {
544
+ return call_native_object_operation(context, heap, arguments$, native);
545
+ } else {
546
+ return handler(name, heap, arguments$);
547
+ }
548
+ }
549
+ }
550
+ } else {
551
+ if ((!((kind === 7) && (count === 2)))) {
552
+ failManagedRuntime(3);
553
+ }
554
+ {
555
+ let member = checked("value-get", heap, arguments$, 1);
556
+ let runtime = (context)["runtime"];
557
+ let frame = undefined;
558
+ let callee = undefined;
559
+ let result = 0;
560
+ let primary = false;
561
+ let status = 0;
562
+ let source_class = 0;
563
+ let cleanup = undefined;
564
+ let cleanup_failed = false;
565
+ if ((!((!(runtime === undefined)) && ((member === 0) || (member === 1) || (member === 2) || (member === 3))))) {
566
+ failManagedRuntime(3);
567
+ }
568
+ (() => {
569
+ try {
570
+ ((frame = (runtime)["frame"](3)));
571
+ {
572
+ const __eliscript_value_88 = checked("frame-current", heap);
573
+ {
574
+ let frame_id = __eliscript_value_88;
575
+ ((callee = (runtime)["fromHostValue"](((member === 0) ? readHostObjectPrototype : ((member === 1) ? readHostObjectConstructor : ((member === 2) ? readHostArrayPrototype : readHostArrayConstructor))))));
576
+ (runtime)["frameSet"](frame, 0, callee);
577
+ {
578
+ const __eliscript_value_89 = checked("value-refs", heap, 7, 3);
579
+ {
580
+ let tuple = __eliscript_value_89;
581
+ checked("frame-set", heap, frame_id, 1, tuple);
582
+ {
583
+ const __eliscript_value_90 = (runtime)["number"](8);
584
+ {
585
+ let number = __eliscript_value_90;
586
+ (() => {
587
+ try {
588
+ (runtime)["frameSet"](frame, 2, number);
589
+ return checked("value-set", heap, tuple, 0, checked("frame-get", heap, frame_id, 2));
590
+ } finally {
591
+ (runtime)["release"](number);
592
+ }
593
+ })();
594
+ }
595
+ }
596
+ checked("value-set", heap, tuple, 1, checked("frame-get", heap, frame_id, 0));
597
+ checked("value-set", heap, tuple, 2, 3);
598
+ return ((result = handler(name, heap, tuple)));
599
+ }
600
+ }
601
+ }
602
+ }
603
+ } catch (error) {
604
+ ((primary = true));
605
+ return ((__eliscript_value_91) => { throw __eliscript_value_91; })(error);
606
+ } finally {
607
+ ((status = raw("last-error")), (source_class = (((__eliscript_value_92, __eliscript_value_93) => (__eliscript_value_92 !== __eliscript_value_93))(status, 0) ? raw("value-exception-class", heap) : 0)));
608
+ ([(() => {
609
+ if ((!(callee === undefined))) {
610
+ return (runtime)["release"](callee);
611
+ } else {
612
+ return null;
613
+ }
614
+ }), (() => {
615
+ if ((!(frame === undefined))) {
616
+ return (runtime)["leaveFrame"](frame);
617
+ } else {
618
+ return null;
619
+ }
620
+ })])["forEach"](((action) => {
621
+ return (() => {
622
+ try {
623
+ return action();
624
+ } catch (error) {
625
+ if ((!__eliscript_truthy(cleanup_failed))) {
626
+ return ((cleanup_failed = true), (cleanup = error));
627
+ } else {
628
+ return null;
629
+ }
630
+ }
631
+ })();
632
+ }));
633
+ raw("value-exception-class-set", heap, source_class);
634
+ raw("value-error-restore", status);
635
+ if (__eliscript_truthy(((__eliscript_value_94) => (__eliscript_truthy(__eliscript_value_94) ? ((!__eliscript_truthy(primary)) && (status === 0)) : __eliscript_value_94))(cleanup_failed))) {
636
+ ((__eliscript_value_95) => { throw __eliscript_value_95; })(cleanup);
637
+ }
638
+ }
639
+ })();
640
+ return result;
641
+ }
642
+ }
643
+ }
644
+ }
645
+ }
646
+ }
647
+ }
648
+ }
649
+ function createManagedHostObjectRealmRuntime(creator, exports, descriptor, memory, tail, completions) {
650
+ {
651
+ let descriptors = Object.getOwnPropertyDescriptors(exports);
652
+ let enabled = data_function(descriptors, "host-object-identity-enabled");
653
+ let required = ["heap-new", "last-error", "value-error-restore", "value-exception-class", "value-exception-class-set", "value-kind", "value-get", "value-length", "value-data", "value-refs", "value-set", "frame-current", "frame-get", "frame-set"];
654
+ let options = (__eliscript_numeric_relation(">", ((tail) ?? []).length, 0) ? (tail)[0] : undefined);
655
+ let lifecycle = (__eliscript_numeric_relation(">", ((tail) ?? []).length, 1) ? (tail)[1] : undefined);
656
+ let locals = (__eliscript_truthy(((__eliscript_value_96) => (__eliscript_truthy(__eliscript_value_96) ? (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(lifecycle) === "object") : __eliscript_value_96))(lifecycle)) ? Object.getOwnPropertyDescriptors(lifecycle) : null);
657
+ let bridge_entry = (__eliscript_truthy(locals) ? (locals)["capabilityBridge"] : null);
658
+ let bridge = (__eliscript_truthy(((__eliscript_value_97) => (__eliscript_truthy(__eliscript_value_97) ? Object.hasOwn(bridge_entry, "value") : __eliscript_value_97))(bridge_entry)) ? (bridge_entry)["value"] : null);
659
+ let bridge_descriptors = (__eliscript_truthy(bridge) ? Object.getOwnPropertyDescriptors(bridge) : null);
660
+ let attach = (__eliscript_truthy(bridge_descriptors) ? data_function(bridge_descriptors, "attach") : null);
661
+ if ((!__eliscript_truthy(((__eliscript_value_98) => (__eliscript_truthy(__eliscript_value_98) ? ((__eliscript_value_99) => (__eliscript_truthy(__eliscript_value_99) ? ((__eliscript_value_100) => (__eliscript_truthy(__eliscript_value_100) ? ((__eliscript_value_101) => (__eliscript_truthy(__eliscript_value_101) ? ((__eliscript_value_102) => (__eliscript_truthy(__eliscript_value_102) ? ((__eliscript_value_103) => (__eliscript_truthy(__eliscript_value_103) ? ((__eliscript_value_104) => (__eliscript_truthy(__eliscript_value_104) ? (required)["every"](((name) => {
662
+ return data_function(descriptors, name);
663
+ })) : __eliscript_value_104))(((descriptor)["hostCapabilities"])["some"](((item) => {
664
+ return (((item)["module"] === "eliscript.host") && ((item)["name"] === "source-operation") && ((item)["arity"] === 2) && ((item)["abi"] === "managed-host-call-v1"));
665
+ }))) : __eliscript_value_103))(Array.isArray((descriptor)["hostCapabilities"])) : __eliscript_value_102))(descriptor) : __eliscript_value_101))((!(options === null))) : __eliscript_value_100))(attach) : __eliscript_value_99))((enabled() === 1)) : __eliscript_value_98))(enabled)))) {
666
+ return __eliscript_at(Reflect, "apply")(creator, undefined, ([exports, descriptor, memory])["concat"](tail));
667
+ } else {
668
+ {
669
+ let forwarded = Array.from(tail);
670
+ let original_options = ((options === undefined) ? ({}) : globalThis.Object(options));
671
+ let receiver = ((options === undefined) ? original_options : options);
672
+ let option_descriptors = Object.getOwnPropertyDescriptors(original_options);
673
+ let initialize = true;
674
+ let runtime = undefined;
675
+ let functions = ((table) => {
676
+ (Object.keys(descriptors))["forEach"](((name) => {
677
+ {
678
+ const __eliscript_value_105 = data_function(descriptors, name);
679
+ {
680
+ let fn = __eliscript_value_105;
681
+ if (__eliscript_truthy(fn)) {
682
+ return ((table)[name] = fn);
683
+ } else {
684
+ return null;
685
+ }
686
+ }
687
+ }
688
+ }));
689
+ return table;
690
+ })(Object.create(null));
691
+ let last_error_fn = (functions)["last-error"];
692
+ let exception_class_fn = (functions)["value-exception-class"];
693
+ let context = ({"owner": 0, "runtime": undefined, "memory": memory, "dataDefinition": (functions)["value-source-data-definition-p"], "foreignIntrinsic": (functions)["value-foreign-intrinsic-register"], "nativeConstructor": (functions)["value-native-constructor-call"], "primitivePredicate": (functions)["value-builtin-primitive"], "reflectBuiltin": (functions)["value-reflect-builtin"], "arraySlice": (functions)["value-array-prototype-call"], "arrayIterator": (functions)["value-collection-prototype-iterator-builtin"]});
694
+ let raw = ((name, ...arguments$) => {
695
+ return __eliscript_numeric_ushr(__eliscript_at(Reflect, "apply")((functions)[name], exports, arguments$), 0);
696
+ });
697
+ let checked = ((name, ...arguments$) => {
698
+ {
699
+ let value = __eliscript_numeric_ushr(__eliscript_at(Reflect, "apply")((functions)[name], exports, arguments$), 0);
700
+ let code = __eliscript_numeric_ushr(last_error_fn(), 0);
701
+ if (((__eliscript_value_106, __eliscript_value_107) => (__eliscript_value_106 !== __eliscript_value_107))(code, 0)) {
702
+ failManagedRuntime(code, __eliscript_numeric_ushr(exception_class_fn((context)["owner"]), 0));
703
+ }
704
+ return value;
705
+ }
706
+ });
707
+ let new_heap = (functions)["heap-new"];
708
+ ((context)["raw"] = raw);
709
+ ((context)["checked"] = checked);
710
+ (Reflect.ownKeys(option_descriptors))["forEach"](((key) => {
711
+ {
712
+ const __eliscript_value_108 = (option_descriptors)[key];
713
+ {
714
+ let entry = __eliscript_value_108;
715
+ if ((!__eliscript_truthy(Object.hasOwn(entry, "value")))) {
716
+ {
717
+ const __eliscript_value_109 = (entry)["get"];
718
+ const __eliscript_value_110 = (entry)["set"];
719
+ {
720
+ let getter = __eliscript_value_109;
721
+ let setter = __eliscript_value_110;
722
+ if (__eliscript_truthy(getter)) {
723
+ ((entry)["get"] = (() => {
724
+ return __eliscript_at(Reflect, "apply")(getter, receiver, []);
725
+ }));
726
+ }
727
+ if (__eliscript_truthy(setter)) {
728
+ return ((entry)["set"] = ((value) => {
729
+ return __eliscript_at(Reflect, "apply")(setter, receiver, [value]);
730
+ }));
731
+ } else {
732
+ return null;
733
+ }
734
+ }
735
+ }
736
+ } else {
737
+ return null;
738
+ }
739
+ }
740
+ }
741
+ }));
742
+ ((option_descriptors)["initializeModule"] = ({"configurable": true, "enumerable": true, "get": (() => {
743
+ {
744
+ const __eliscript_value_111 = Reflect.get(original_options, "initializeModule", receiver);
745
+ {
746
+ let value = __eliscript_value_111;
747
+ ((initialize = ((value === undefined) ? true : value)));
748
+ if (((value === undefined) || (((__eliscript_value) => { if (__eliscript_value === null) return "null"; const __eliscript_host_type = typeof __eliscript_value; if (__eliscript_host_type !== "object" && __eliscript_host_type !== "function") return __eliscript_host_type; try { const __eliscript_type = Object.getOwnPropertyDescriptor(__eliscript_value, Symbol.for("eliscript.value.type")); if (__eliscript_type && Object.prototype.hasOwnProperty.call(__eliscript_type, "value") && (__eliscript_type.value === "keyword" || __eliscript_type.value === "symbol")) return __eliscript_type.value; const __eliscript_kind = Object.getOwnPropertyDescriptor(__eliscript_value, "kind"); if (__eliscript_kind && Object.prototype.hasOwnProperty.call(__eliscript_kind, "value")) { if (__eliscript_kind.value === "eliscript/keyword") return "keyword"; if (__eliscript_kind.value === "eliscript/symbol") return "symbol"; } return __eliscript_host_type; } catch { return __eliscript_host_type; } })(value) === "boolean"))) {
749
+ return false;
750
+ } else {
751
+ return value;
752
+ }
753
+ }
754
+ }
755
+ })}));
756
+ ((forwarded)[0] = Object.create(Object.getPrototypeOf(original_options), option_descriptors));
757
+ (((bridge_descriptors)["attach"])["value"] = function_shape(((handler) => {
758
+ return __eliscript_at(Reflect, "apply")(attach, bridge, [((name, heap, arguments$) => {
759
+ return dispatch_host_object_identity(context, handler, name, heap, arguments$);
760
+ })]);
761
+ }), attach));
762
+ ((bridge_entry)["value"] = Object.create(Object.getPrototypeOf(bridge), bridge_descriptors));
763
+ ((locals)["dispose"] = ({"configurable": true, "enumerable": true, "get": (() => {
764
+ return (lifecycle)["dispose"];
765
+ }), "set": ((value) => {
766
+ return ((lifecycle)["dispose"] = value);
767
+ })}));
768
+ ((forwarded)[1] = Object.create(Object.getPrototypeOf(lifecycle), locals));
769
+ (((descriptors)["heap-new"])["value"] = function_shape(((slots, initial, maximum) => {
770
+ {
771
+ const __eliscript_value_112 = __eliscript_at(Reflect, "apply")(new_heap, exports, [slots, initial, maximum]);
772
+ {
773
+ let owner = __eliscript_value_112;
774
+ ((context)["owner"] = owner);
775
+ return owner;
776
+ }
777
+ }
778
+ }), new_heap));
779
+ ((runtime = __eliscript_at(Reflect, "apply")(creator, undefined, ([Object.create(Object.getPrototypeOf(exports), descriptors), descriptor, memory])["concat"](forwarded))));
780
+ ((context)["runtime"] = runtime);
781
+ if (__eliscript_truthy((["value-foreign-token", "value-object-new", "value-object-properties", "value-object-integrity", "value-object-meta-builtin", "value-object-reflection", "frame-new", "frame-pop", "value-string", "value-unit-set", "value-seal", "value-object-has", "value-source-own-descriptor", "value-source-extensible", "value-standard-prototype-existing"])["every"](((name) => {
782
+ return data_function(descriptors, name);
783
+ })))) {
784
+ register_native_object_operations(context, lifecycle);
785
+ }
786
+ if ((((descriptor)["abi"] === "managed-module-v1") && (initialize === true))) {
787
+ (completions)["push"]((() => {
788
+ return (runtime)["initializeModule"]();
789
+ }));
790
+ }
791
+ return runtime;
792
+ }
793
+ }
794
+ }
795
+ }
796
+ export {createManagedHostObjectRealmRuntime};
797
+ //# sourceMappingURL=managed-host-object-realm.mjs.map