@scriptc/compiler 0.0.34 → 0.0.36

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 (424) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +7 -6
  2. package/dist/backend/build-cache.d.ts +44 -0
  3. package/dist/backend/build-cache.js +241 -0
  4. package/dist/backend/build-cache.js.map +1 -0
  5. package/dist/backend/{emission/emit-async.d.ts → c/async.d.ts} +21 -30
  6. package/dist/backend/{emission/emit-async.js → c/async.js} +270 -286
  7. package/dist/backend/c/async.js.map +1 -0
  8. package/dist/backend/{emission/emitter.d.ts → c/c-emitter.d.ts} +6 -23
  9. package/dist/backend/{emission/emitter.js → c/c-emitter.js} +53 -107
  10. package/dist/backend/c/c-emitter.js.map +1 -0
  11. package/dist/backend/c/exprs.d.ts +8 -0
  12. package/dist/backend/c/exprs.js +7913 -0
  13. package/dist/backend/c/exprs.js.map +1 -0
  14. package/dist/backend/{emission/emit-island.d.ts → c/island.d.ts} +5 -5
  15. package/dist/backend/{emission/emit-island.js → c/island.js} +24 -22
  16. package/dist/backend/c/island.js.map +1 -0
  17. package/dist/backend/{emission → c}/may-throw.d.ts +1 -1
  18. package/dist/backend/{emission → c}/may-throw.js +1 -1
  19. package/dist/backend/c/may-throw.js.map +1 -0
  20. package/dist/backend/{emission/emit-shapes.d.ts → c/shapes.d.ts} +19 -19
  21. package/dist/backend/{emission/emit-shapes.js → c/shapes.js} +78 -87
  22. package/dist/backend/c/shapes.js.map +1 -0
  23. package/dist/backend/{emission/emit-stmts.d.ts → c/stmts.d.ts} +12 -12
  24. package/dist/backend/{emission/emit-stmts.js → c/stmts.js} +377 -343
  25. package/dist/backend/c/stmts.js.map +1 -0
  26. package/dist/backend/{emission/emit-types.d.ts → c/types.d.ts} +1 -1
  27. package/dist/backend/{emission/emit-types.js → c/types.js} +42 -286
  28. package/dist/backend/c/types.js.map +1 -0
  29. package/dist/backend/c/types.test.js +25 -0
  30. package/dist/backend/c/types.test.js.map +1 -0
  31. package/dist/backend/{emission/emit-walkers.d.ts → c/walkers.d.ts} +19 -41
  32. package/dist/backend/{emission/emit-walkers.js → c/walkers.js} +238 -298
  33. package/dist/backend/c/walkers.js.map +1 -0
  34. package/dist/backend/ffi-callbacks.d.ts +1 -1
  35. package/dist/backend/ffi-callbacks.js +4 -3
  36. package/dist/backend/ffi-callbacks.js.map +1 -1
  37. package/dist/backend/{library-identity.d.ts → library-identity-markers.d.ts} +0 -4
  38. package/dist/backend/{library-identity.js → library-identity-markers.js} +10 -9
  39. package/dist/backend/library-identity-markers.js.map +1 -0
  40. package/dist/backend/llvm/blocks.d.ts +4 -0
  41. package/dist/backend/llvm/blocks.js +29 -0
  42. package/dist/backend/llvm/blocks.js.map +1 -1
  43. package/dist/backend/llvm/classes.d.ts +2 -19
  44. package/dist/backend/llvm/classes.js +20 -52
  45. package/dist/backend/llvm/classes.js.map +1 -1
  46. package/dist/backend/llvm/common.d.ts +4 -0
  47. package/dist/backend/llvm/common.js +27 -0
  48. package/dist/backend/llvm/common.js.map +1 -0
  49. package/dist/backend/llvm/dyn.d.ts +3 -8
  50. package/dist/backend/llvm/dyn.js +152 -224
  51. package/dist/backend/llvm/dyn.js.map +1 -1
  52. package/dist/backend/llvm/emitter.d.ts +4 -1
  53. package/dist/backend/llvm/emitter.js +514 -9981
  54. package/dist/backend/llvm/emitter.js.map +1 -1
  55. package/dist/backend/llvm/expr-async.d.ts +4 -0
  56. package/dist/backend/llvm/expr-async.js +726 -0
  57. package/dist/backend/llvm/expr-async.js.map +1 -0
  58. package/dist/backend/llvm/expr-bytes.d.ts +13 -0
  59. package/dist/backend/llvm/expr-bytes.js +456 -0
  60. package/dist/backend/llvm/expr-bytes.js.map +1 -0
  61. package/dist/backend/llvm/expr-callbacks.d.ts +22 -0
  62. package/dist/backend/llvm/expr-callbacks.js +520 -0
  63. package/dist/backend/llvm/expr-callbacks.js.map +1 -0
  64. package/dist/backend/llvm/expr-calls.d.ts +2 -0
  65. package/dist/backend/llvm/expr-calls.js +618 -0
  66. package/dist/backend/llvm/expr-calls.js.map +1 -0
  67. package/dist/backend/llvm/expr-containers.d.ts +25 -0
  68. package/dist/backend/llvm/expr-containers.js +623 -0
  69. package/dist/backend/llvm/expr-containers.js.map +1 -0
  70. package/dist/backend/llvm/expr-context.d.ts +255 -0
  71. package/dist/backend/llvm/expr-context.js +2 -0
  72. package/dist/backend/llvm/expr-context.js.map +1 -0
  73. package/dist/backend/llvm/expr-control.d.ts +2 -0
  74. package/dist/backend/llvm/expr-control.js +473 -0
  75. package/dist/backend/llvm/expr-control.js.map +1 -0
  76. package/dist/backend/llvm/expr-dispatch.d.ts +4 -0
  77. package/dist/backend/llvm/expr-dispatch.js +151 -0
  78. package/dist/backend/llvm/expr-dispatch.js.map +1 -0
  79. package/dist/backend/llvm/expr-dynamic.d.ts +2 -0
  80. package/dist/backend/llvm/expr-dynamic.js +810 -0
  81. package/dist/backend/llvm/expr-dynamic.js.map +1 -0
  82. package/dist/backend/llvm/expr-island.d.ts +15 -0
  83. package/dist/backend/llvm/expr-island.js +690 -0
  84. package/dist/backend/llvm/expr-island.js.map +1 -0
  85. package/dist/backend/llvm/expr-primitives.d.ts +6 -0
  86. package/dist/backend/llvm/expr-primitives.js +622 -0
  87. package/dist/backend/llvm/expr-primitives.js.map +1 -0
  88. package/dist/backend/llvm/expr-records.d.ts +9 -0
  89. package/dist/backend/llvm/expr-records.js +299 -0
  90. package/dist/backend/llvm/expr-records.js.map +1 -0
  91. package/dist/backend/llvm/expr-stream-bridges.d.ts +13 -0
  92. package/dist/backend/llvm/expr-stream-bridges.js +396 -0
  93. package/dist/backend/llvm/expr-stream-bridges.js.map +1 -0
  94. package/dist/backend/llvm/expr-stream-callbacks.d.ts +12 -0
  95. package/dist/backend/llvm/expr-stream-callbacks.js +360 -0
  96. package/dist/backend/llvm/expr-stream-callbacks.js.map +1 -0
  97. package/dist/backend/llvm/lib-dispatch.d.ts +5 -0
  98. package/dist/backend/llvm/lib-dispatch.js +267 -0
  99. package/dist/backend/llvm/lib-dispatch.js.map +1 -0
  100. package/dist/backend/llvm/lib-filesystem.d.ts +6 -0
  101. package/dist/backend/llvm/lib-filesystem.js +594 -0
  102. package/dist/backend/llvm/lib-filesystem.js.map +1 -0
  103. package/dist/backend/llvm/lib-network.d.ts +2 -0
  104. package/dist/backend/llvm/lib-network.js +429 -0
  105. package/dist/backend/llvm/lib-network.js.map +1 -0
  106. package/dist/backend/llvm/lib-process.d.ts +5 -0
  107. package/dist/backend/llvm/lib-process.js +585 -0
  108. package/dist/backend/llvm/lib-process.js.map +1 -0
  109. package/dist/backend/llvm/lib-shared.d.ts +6 -0
  110. package/dist/backend/llvm/lib-shared.js +687 -0
  111. package/dist/backend/llvm/lib-shared.js.map +1 -0
  112. package/dist/backend/llvm/lib-stream.d.ts +2 -0
  113. package/dist/backend/llvm/lib-stream.js +470 -0
  114. package/dist/backend/llvm/lib-stream.js.map +1 -0
  115. package/dist/backend/llvm/shapes.d.ts +12 -2
  116. package/dist/backend/llvm/shapes.js +66 -307
  117. package/dist/backend/llvm/shapes.js.map +1 -1
  118. package/dist/backend/llvm/shapes.test.js +52 -0
  119. package/dist/backend/llvm/shapes.test.js.map +1 -0
  120. package/dist/backend/llvm/split.d.ts +43 -0
  121. package/dist/backend/llvm/split.js +227 -0
  122. package/dist/backend/llvm/split.js.map +1 -0
  123. package/dist/backend/llvm/split.test.d.ts +1 -0
  124. package/dist/backend/llvm/split.test.js +102 -0
  125. package/dist/backend/llvm/split.test.js.map +1 -0
  126. package/dist/backend/llvm/unsupported.d.ts +1 -1
  127. package/dist/backend/llvm/walkers.d.ts +2 -3
  128. package/dist/backend/llvm/walkers.js +164 -218
  129. package/dist/backend/llvm/walkers.js.map +1 -1
  130. package/dist/backend/native-codegen.d.ts +38 -0
  131. package/dist/backend/native-codegen.js +261 -0
  132. package/dist/backend/native-codegen.js.map +1 -0
  133. package/dist/backend/native-codegen.test.d.ts +1 -0
  134. package/dist/backend/native-codegen.test.js +188 -0
  135. package/dist/backend/native-codegen.test.js.map +1 -0
  136. package/dist/backend/native-link-info.d.ts +96 -0
  137. package/dist/backend/native-link-info.js +219 -0
  138. package/dist/backend/native-link-info.js.map +1 -0
  139. package/dist/backend/native-link-info.test.d.ts +1 -0
  140. package/dist/backend/native-link-info.test.js +134 -0
  141. package/dist/backend/native-link-info.test.js.map +1 -0
  142. package/dist/backend/{cc.d.ts → native-toolchain.d.ts} +139 -47
  143. package/dist/backend/{cc.js → native-toolchain.js} +1008 -910
  144. package/dist/backend/native-toolchain.js.map +1 -0
  145. package/dist/backend/native-toolchain.test.d.ts +1 -0
  146. package/dist/backend/{cc-cache.test.js → native-toolchain.test.js} +1297 -127
  147. package/dist/backend/native-toolchain.test.js.map +1 -0
  148. package/dist/backend/object-localize.js +1 -1
  149. package/dist/backend/object-localize.test.js +20 -0
  150. package/dist/backend/object-localize.test.js.map +1 -1
  151. package/dist/backend/runtime-abi.d.ts +10 -0
  152. package/dist/backend/runtime-abi.js +11 -0
  153. package/dist/backend/runtime-abi.js.map +1 -0
  154. package/dist/backend/runtime-pack.d.ts +137 -0
  155. package/dist/backend/runtime-pack.js +400 -0
  156. package/dist/backend/runtime-pack.js.map +1 -0
  157. package/dist/backend/runtime-pack.test.d.ts +1 -0
  158. package/dist/backend/runtime-pack.test.js +438 -0
  159. package/dist/backend/runtime-pack.test.js.map +1 -0
  160. package/dist/backend/targets.d.ts +30 -0
  161. package/dist/backend/targets.js +46 -0
  162. package/dist/backend/targets.js.map +1 -0
  163. package/dist/backend/targets.test.d.ts +1 -0
  164. package/dist/backend/targets.test.js +19 -0
  165. package/dist/backend/targets.test.js.map +1 -0
  166. package/dist/backend/vendor-archives.d.ts +41 -0
  167. package/dist/backend/vendor-archives.js +462 -0
  168. package/dist/backend/vendor-archives.js.map +1 -0
  169. package/dist/compat/fetch-profile.d.ts +0 -1
  170. package/dist/compat/fetch-profile.js +0 -1
  171. package/dist/compat/fetch-profile.js.map +1 -1
  172. package/dist/coverage/report.js +3 -3
  173. package/dist/coverage/report.js.map +1 -1
  174. package/dist/coverage/surface-manifest.js +25 -32
  175. package/dist/coverage/surface-manifest.js.map +1 -1
  176. package/dist/diagnostics/diagnostic.d.ts +11 -12
  177. package/dist/diagnostics/diagnostic.js +19 -17
  178. package/dist/diagnostics/diagnostic.js.map +1 -1
  179. package/dist/diagnostics/render.d.ts +1 -1
  180. package/dist/diagnostics/render.js +1 -1
  181. package/dist/diagnostics/render.js.map +1 -1
  182. package/dist/errors.d.ts +5 -0
  183. package/dist/errors.js +9 -0
  184. package/dist/errors.js.map +1 -0
  185. package/dist/executable/executable-cache.d.ts +86 -0
  186. package/dist/executable/executable-cache.js +398 -0
  187. package/dist/executable/executable-cache.js.map +1 -0
  188. package/dist/executable/executable-cache.test.d.ts +1 -0
  189. package/dist/executable/executable-cache.test.js +300 -0
  190. package/dist/executable/executable-cache.test.js.map +1 -0
  191. package/dist/ffi/{profile.d.ts → ffi-manifest.d.ts} +7 -2
  192. package/dist/ffi/{profile.js → ffi-manifest.js} +2 -1
  193. package/dist/ffi/ffi-manifest.js.map +1 -0
  194. package/dist/frontend/builtin-modules.d.ts +21 -0
  195. package/dist/frontend/builtin-modules.js +82 -0
  196. package/dist/frontend/builtin-modules.js.map +1 -0
  197. package/dist/frontend/cjs-lexer.d.ts +7 -0
  198. package/dist/frontend/cjs-lexer.js +15 -17
  199. package/dist/frontend/cjs-lexer.js.map +1 -1
  200. package/dist/frontend/dts-paths.d.ts +26 -0
  201. package/dist/frontend/dts-paths.js +41 -0
  202. package/dist/frontend/dts-paths.js.map +1 -0
  203. package/dist/frontend/input-tracker.d.ts +0 -2
  204. package/dist/frontend/input-tracker.js +1 -4
  205. package/dist/frontend/input-tracker.js.map +1 -1
  206. package/dist/frontend/lib-contract.d.ts +1 -5
  207. package/dist/frontend/lib-contract.js +1 -1
  208. package/dist/frontend/lib-contract.js.map +1 -1
  209. package/dist/frontend/lib-exports.d.ts +1 -1
  210. package/dist/frontend/lowering/call-position.d.ts +4 -0
  211. package/dist/frontend/lowering/call-position.js +7 -0
  212. package/dist/frontend/lowering/call-position.js.map +1 -0
  213. package/dist/frontend/lowering/callback-arg.d.ts +20 -0
  214. package/dist/frontend/lowering/callback-arg.js +44 -0
  215. package/dist/frontend/lowering/callback-arg.js.map +1 -0
  216. package/dist/frontend/lowering/lib-boundary.d.ts +1 -1
  217. package/dist/frontend/lowering/lib-boundary.js +34 -34
  218. package/dist/frontend/lowering/lib-boundary.js.map +1 -1
  219. package/dist/frontend/lowering/lower-assert.d.ts +3 -3
  220. package/dist/frontend/lowering/lower-assert.js +214 -241
  221. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  222. package/dist/frontend/lowering/lower-builtins.d.ts +74 -146
  223. package/dist/frontend/lowering/lower-builtins.js +1126 -1234
  224. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  225. package/dist/frontend/lowering/lower-calls.d.ts +56 -188
  226. package/dist/frontend/lowering/lower-calls.js +1409 -1494
  227. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  228. package/dist/frontend/lowering/lower-classes.d.ts +62 -125
  229. package/dist/frontend/lowering/lower-classes.js +832 -866
  230. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  231. package/dist/frontend/lowering/lower-comptime.d.ts +5 -12
  232. package/dist/frontend/lowering/lower-comptime.js +32 -31
  233. package/dist/frontend/lowering/lower-comptime.js.map +1 -1
  234. package/dist/frontend/lowering/lower-containers.d.ts +35 -135
  235. package/dist/frontend/lowering/lower-containers.js +1394 -1715
  236. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  237. package/dist/frontend/lowering/lower-dgram.d.ts +3 -7
  238. package/dist/frontend/lowering/lower-dgram.js +97 -111
  239. package/dist/frontend/lowering/lower-dgram.js.map +1 -1
  240. package/dist/frontend/lowering/lower-enums.d.ts +4 -4
  241. package/dist/frontend/lowering/lower-enums.js +30 -30
  242. package/dist/frontend/lowering/lower-enums.js.map +1 -1
  243. package/dist/frontend/lowering/{lower-emitter.d.ts → lower-event-emitter.d.ts} +7 -18
  244. package/dist/frontend/lowering/{lower-emitter.js → lower-event-emitter.js} +172 -174
  245. package/dist/frontend/lowering/lower-event-emitter.js.map +1 -0
  246. package/dist/frontend/lowering/lower-expando.d.ts +5 -5
  247. package/dist/frontend/lowering/lower-expando.js +40 -40
  248. package/dist/frontend/lowering/lower-expando.js.map +1 -1
  249. package/dist/frontend/lowering/lower-exprs.d.ts +56 -264
  250. package/dist/frontend/lowering/lower-exprs.js +1644 -1704
  251. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  252. package/dist/frontend/lowering/lower-generators.d.ts +6 -6
  253. package/dist/frontend/lowering/lower-generators.js +73 -72
  254. package/dist/frontend/lowering/lower-generators.js.map +1 -1
  255. package/dist/frontend/lowering/lower-inspect.d.ts +5 -17
  256. package/dist/frontend/lowering/lower-inspect.js +236 -238
  257. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  258. package/dist/frontend/lowering/lower-island.d.ts +34 -45
  259. package/dist/frontend/lowering/lower-island.js +440 -511
  260. package/dist/frontend/lowering/lower-island.js.map +1 -1
  261. package/dist/frontend/lowering/lower-mixins.d.ts +7 -10
  262. package/dist/frontend/lowering/lower-mixins.js +86 -86
  263. package/dist/frontend/lowering/lower-mixins.js.map +1 -1
  264. package/dist/frontend/lowering/lower-modules.d.ts +12 -18
  265. package/dist/frontend/lowering/lower-modules.js +284 -283
  266. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  267. package/dist/frontend/lowering/lower-namespaces.d.ts +23 -49
  268. package/dist/frontend/lowering/lower-namespaces.js +123 -115
  269. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  270. package/dist/frontend/lowering/lower-server.d.ts +18 -25
  271. package/dist/frontend/lowering/lower-server.js +899 -899
  272. package/dist/frontend/lowering/lower-server.js.map +1 -1
  273. package/dist/frontend/lowering/lower-stmts.d.ts +30 -149
  274. package/dist/frontend/lowering/lower-stmts.js +1176 -1229
  275. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  276. package/dist/frontend/lowering/lower-stream.d.ts +12 -12
  277. package/dist/frontend/lowering/lower-stream.js +300 -301
  278. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  279. package/dist/frontend/lowering/lower-test.d.ts +5 -5
  280. package/dist/frontend/lowering/lower-test.js +82 -82
  281. package/dist/frontend/lowering/lower-test.js.map +1 -1
  282. package/dist/frontend/lowering/lowerer.d.ts +66 -20
  283. package/dist/frontend/lowering/lowerer.js +421 -198
  284. package/dist/frontend/lowering/lowerer.js.map +1 -1
  285. package/dist/frontend/lowering/pairs-snapshot.d.ts +11 -0
  286. package/dist/frontend/lowering/pairs-snapshot.js +85 -0
  287. package/dist/frontend/lowering/pairs-snapshot.js.map +1 -0
  288. package/dist/frontend/lowering/static-this.d.ts +6 -0
  289. package/dist/frontend/lowering/static-this.js +24 -0
  290. package/dist/frontend/lowering/static-this.js.map +1 -0
  291. package/dist/frontend/lowering/surfaces.d.ts +14 -33
  292. package/dist/frontend/lowering/surfaces.js +64 -64
  293. package/dist/frontend/lowering/surfaces.js.map +1 -1
  294. package/dist/frontend/npm-static-rewrite.js +6 -28
  295. package/dist/frontend/npm-static-rewrite.js.map +1 -1
  296. package/dist/frontend/npm-static.d.ts +0 -10
  297. package/dist/frontend/npm-static.js +4 -7
  298. package/dist/frontend/npm-static.js.map +1 -1
  299. package/dist/frontend/npm.d.ts +0 -24
  300. package/dist/frontend/npm.js +11 -85
  301. package/dist/frontend/npm.js.map +1 -1
  302. package/dist/frontend/program.d.ts +3 -1
  303. package/dist/frontend/program.js +51 -17
  304. package/dist/frontend/program.js.map +1 -1
  305. package/dist/frontend/provenance-registry.d.ts +0 -2
  306. package/dist/frontend/provenance-registry.js +0 -10
  307. package/dist/frontend/provenance-registry.js.map +1 -1
  308. package/dist/frontend/provenance.js +4 -7
  309. package/dist/frontend/provenance.js.map +1 -1
  310. package/dist/frontend/resolve.d.ts +7 -2
  311. package/dist/frontend/resolve.js +12 -17
  312. package/dist/frontend/resolve.js.map +1 -1
  313. package/dist/frontend/resolve.test.d.ts +1 -0
  314. package/dist/frontend/resolve.test.js +29 -0
  315. package/dist/frontend/resolve.test.js.map +1 -0
  316. package/dist/frontend/ts7/adapter.d.ts +2 -2
  317. package/dist/frontend/ts7/adapter.js +1 -1
  318. package/dist/frontend/ts7/adapter.js.map +1 -1
  319. package/dist/frontend/ts7/checker.d.ts +40 -2
  320. package/dist/frontend/ts7/checker.js +182 -54
  321. package/dist/frontend/ts7/checker.js.map +1 -1
  322. package/dist/frontend/ts7/enums.js +2 -1
  323. package/dist/frontend/ts7/enums.js.map +1 -1
  324. package/dist/frontend/ts7/{program.js → program-adapter.js} +7 -6
  325. package/dist/frontend/ts7/program-adapter.js.map +1 -0
  326. package/dist/frontend/ts7/world-check.d.ts +1 -3
  327. package/dist/frontend/ts7/world-check.js +3 -1
  328. package/dist/frontend/ts7/world-check.js.map +1 -1
  329. package/dist/frontend/tsc-codes.d.ts +8 -0
  330. package/dist/frontend/tsc-codes.js +109 -0
  331. package/dist/frontend/tsc-codes.js.map +1 -0
  332. package/dist/frontend/{types.d.ts → type-mapper.d.ts} +2 -25
  333. package/dist/frontend/{types.js → type-mapper.js} +31 -52
  334. package/dist/frontend/type-mapper.js.map +1 -0
  335. package/dist/frontend/workspace-registry.d.ts +26 -0
  336. package/dist/frontend/workspace-registry.js +71 -0
  337. package/dist/frontend/workspace-registry.js.map +1 -0
  338. package/dist/index.d.ts +115 -30
  339. package/dist/index.js +650 -146
  340. package/dist/index.js.map +1 -1
  341. package/dist/ir/analysis.d.ts +37 -0
  342. package/dist/ir/analysis.js +118 -0
  343. package/dist/ir/analysis.js.map +1 -0
  344. package/dist/ir/analysis.test.d.ts +1 -0
  345. package/dist/ir/analysis.test.js +21 -0
  346. package/dist/ir/analysis.test.js.map +1 -0
  347. package/dist/ir/build.d.ts +9 -0
  348. package/dist/ir/build.js +33 -0
  349. package/dist/ir/build.js.map +1 -0
  350. package/dist/ir/integer-loops.d.ts +1 -1
  351. package/dist/ir/{nodes.d.ts → ir.d.ts} +60 -26
  352. package/dist/ir/{nodes.js → ir.js} +173 -141
  353. package/dist/ir/ir.js.map +1 -0
  354. package/dist/ir/ir.test.d.ts +1 -0
  355. package/dist/ir/ir.test.js +17 -0
  356. package/dist/ir/ir.test.js.map +1 -0
  357. package/dist/ir/serialize.d.ts +1 -1
  358. package/dist/ir/serialize.js +2 -1
  359. package/dist/ir/serialize.js.map +1 -1
  360. package/dist/ir/validate.d.ts +1 -1
  361. package/dist/ir/validate.js +16 -5
  362. package/dist/ir/validate.js.map +1 -1
  363. package/dist/library/cache-primitives.d.ts +24 -0
  364. package/dist/library/cache-primitives.js +83 -0
  365. package/dist/library/cache-primitives.js.map +1 -0
  366. package/dist/library/cache-reset.test.d.ts +1 -0
  367. package/dist/library/cache-reset.test.js +47 -0
  368. package/dist/library/cache-reset.test.js.map +1 -0
  369. package/dist/library/compiler-self-identity.d.ts +23 -0
  370. package/dist/library/compiler-self-identity.js +84 -0
  371. package/dist/library/compiler-self-identity.js.map +1 -0
  372. package/dist/library/fence-eval.d.ts +3 -1
  373. package/dist/library/fence-eval.js +5 -1
  374. package/dist/library/fence-eval.js.map +1 -1
  375. package/dist/library/int-infer.d.ts +1 -36
  376. package/dist/library/int-infer.js +17 -17
  377. package/dist/library/int-infer.js.map +1 -1
  378. package/dist/library/{early-cache.d.ts → library-cache.d.ts} +1 -1
  379. package/dist/library/{early-cache.js → library-cache.js} +37 -111
  380. package/dist/library/library-cache.js.map +1 -0
  381. package/dist/library/library-cache.test.d.ts +1 -0
  382. package/dist/library/{early-cache.test.js → library-cache.test.js} +2 -2
  383. package/dist/library/library-cache.test.js.map +1 -0
  384. package/dist/library/{profile.d.ts → library-profile.d.ts} +4 -7
  385. package/dist/library/{profile.js → library-profile.js} +18 -11
  386. package/dist/library/library-profile.js.map +1 -0
  387. package/dist/library/semantic-source.js +2 -1
  388. package/dist/library/semantic-source.js.map +1 -1
  389. package/dist/library/sidecar.d.ts +5 -2
  390. package/dist/library/sidecar.js +11 -5
  391. package/dist/library/sidecar.js.map +1 -1
  392. package/dist/startup-cache.d.ts +6 -0
  393. package/dist/startup-cache.js +6 -0
  394. package/dist/startup-cache.js.map +1 -0
  395. package/package.json +7 -2
  396. package/surface-manifest.json +1 -1
  397. package/dist/backend/cc-cache.test.js.map +0 -1
  398. package/dist/backend/cc.js.map +0 -1
  399. package/dist/backend/emission/emit-async.js.map +0 -1
  400. package/dist/backend/emission/emit-exprs.d.ts +0 -13
  401. package/dist/backend/emission/emit-exprs.js +0 -7407
  402. package/dist/backend/emission/emit-exprs.js.map +0 -1
  403. package/dist/backend/emission/emit-island.js.map +0 -1
  404. package/dist/backend/emission/emit-shapes.js.map +0 -1
  405. package/dist/backend/emission/emit-stmts.js.map +0 -1
  406. package/dist/backend/emission/emit-types.js.map +0 -1
  407. package/dist/backend/emission/emit-walkers.js.map +0 -1
  408. package/dist/backend/emission/emitter.js.map +0 -1
  409. package/dist/backend/emission/may-throw.js.map +0 -1
  410. package/dist/backend/library-identity.js.map +0 -1
  411. package/dist/ffi/profile.js.map +0 -1
  412. package/dist/frontend/lowering/lower-emitter.js.map +0 -1
  413. package/dist/frontend/shared.d.ts +0 -82
  414. package/dist/frontend/shared.js +0 -308
  415. package/dist/frontend/shared.js.map +0 -1
  416. package/dist/frontend/ts7/program.js.map +0 -1
  417. package/dist/frontend/types.js.map +0 -1
  418. package/dist/ir/nodes.js.map +0 -1
  419. package/dist/library/early-cache.js.map +0 -1
  420. package/dist/library/early-cache.test.js.map +0 -1
  421. package/dist/library/profile.js.map +0 -1
  422. /package/dist/backend/{cc-cache.test.d.ts → c/types.test.d.ts} +0 -0
  423. /package/dist/{library/early-cache.test.d.ts → backend/llvm/shapes.test.d.ts} +0 -0
  424. /package/dist/frontend/ts7/{program.d.ts → program-adapter.d.ts} +0 -0
@@ -800,7 +800,7 @@ declare module "timers/promises" {
800
800
  * the AsyncLocalStorage integration (dc.chan* libCalls).
801
801
  *
802
802
  * TracingChannel (tracingChannel) is the five-event-channel collection:
803
- * an f64 handle into the runtime's tracing registry (types.ts maps the
803
+ * an f64 handle into the runtime's tracing registry (type-mapper.ts maps the
804
804
  * name like Channel). subscribe/unsubscribe walk a handlers object;
805
805
  * traceSync/traceCallback run Node's publish choreography in the runtime
806
806
  * (context defaults to a fresh {}); tracePromise is declared (the member
@@ -992,7 +992,7 @@ declare module "node:fs" {
992
992
  export function readdirSync(path: string): string[];
993
993
  /* The withFileTypes form: Dirent rows (name + parentPath + the type
994
994
  * probes — the honest subset of Node's Dirent surface). The type is
995
- * interned explicitly in types.ts (the record's hidden %dtype field
995
+ * interned explicitly in type-mapper.ts (the record's hidden %dtype field
996
996
  * carries the entry kind; isFile/isDirectory/isSymbolicLink lower as
997
997
  * reads of it in lower-builtins.ts). */
998
998
  export interface Dirent {
@@ -1239,7 +1239,7 @@ declare module "os" {
1239
1239
  /* The passwd-entry snapshot (uv_os_get_passwd): shell is `string |
1240
1240
  * null` to match @types/node (POSIX always answers the string arm);
1241
1241
  * homedir is pw_dir — NOT os.homedir()'s $HOME-first cascade. The type
1242
- * is interned explicitly in types.ts (the AddressInfo pattern — this
1242
+ * is interned explicitly in type-mapper.ts (the AddressInfo pattern — this
1243
1243
  * concrete form and @types/node's UserInfo<string> both), and the call
1244
1244
  * assembles field-by-field in lowerOsUserInfoCall. */
1245
1245
  export interface UserInfo {
@@ -1570,7 +1570,7 @@ declare module "child_process" {
1570
1570
  /* The named options interface for the string-encoding exec form —
1571
1571
  * @types/node's ExecFileSyncOptionsWithStringEncoding, narrowed to the
1572
1572
  * honestly-implemented members. VALUES of this type are a real record
1573
- * (types.ts interns the shape), so a typed const or a runner function's
1573
+ * (type-mapper.ts interns the shape), so a typed const or a runner function's
1574
1574
  * options parameter flows to execFileSync at runtime — the windows-ca
1575
1575
  * command-runner idiom. */
1576
1576
  export interface ExecFileSyncOptionsWithStringEncoding {
@@ -2036,8 +2036,9 @@ declare module "net" {
2036
2036
  * spelling). */
2037
2037
  listen(port: number, host: string, callback?: () => void): Server;
2038
2038
  /* The explicit-interface bind: host is an IP literal (absent = the
2039
- * host-less dual-stack any); ipv6Only sets IPV6_V6ONLY. */
2040
- listen(options: { port: number; host?: string; ipv6Only?: boolean }, callback?: () => void): Server;
2039
+ * host-less dual-stack any); ipv6Only sets IPV6_V6ONLY and reusePort
2040
+ * requests kernel connection distribution where Node supports it. */
2041
+ listen(options: { port: number; host?: string; ipv6Only?: boolean; reusePort?: boolean }, callback?: () => void): Server;
2041
2042
  close(callback?: () => void): void;
2042
2043
  /* The bound AddressInfo (Node answers null before listen — this
2043
2044
  * surface answers the record with port 0 there, the serverPort
@@ -0,0 +1,44 @@
1
+ export declare function fileExists(path: string): Promise<boolean>;
2
+ export declare function protectCachedArtifact(paths: Set<string> | undefined, path: string): void;
3
+ export declare function privateSiblingPath(destination: string, label: string): string;
4
+ /** Copy an artifact through a private sibling name, then atomically install it.
5
+ * The source can live on another filesystem (cache/temp roots commonly do), so
6
+ * a direct rename is not portable. */
7
+ export declare function installArtifact(source: string, destination: string, mode?: number): Promise<void>;
8
+ /** Resolve the build cache without touching the filesystem. Exported from this
9
+ * internal module so its platform and override behavior can be pinned directly. */
10
+ export declare function resolveBuildCacheRoot(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, userHome?: string): string | null;
11
+ /** Shared persistent-cache root for compiler-level tiers. The early library
12
+ * cache deliberately follows the native cache's activation and hard-disable
13
+ * contract, while native compilation retains ownership of toolchain safety. */
14
+ export declare function buildCacheRoot(): string | null;
15
+ /** Harden/create a compiler-level cache root using the same privacy policy as
16
+ * the artifact caches. Failure disables only the optional caller's tier. */
17
+ export declare function prepareBuildCacheRoot(root: string | null): Promise<string | null>;
18
+ /** Register a successful compiler-level cache write with the shared bounded
19
+ * LRU policy. */
20
+ export declare function pruneBuildCache(root: string | null): Promise<void>;
21
+ export declare function cacheRootDir(): string | null;
22
+ /** The production cache can contain complete user executables/archives with
23
+ * embedded source literals or comptime values. Its root is therefore private
24
+ * regardless of the caller's ordinary output umask. Windows inherits the
25
+ * per-user LOCALAPPDATA ACL. POSIX platform-default roots are hardened for
26
+ * upgrades; an arbitrary existing SCRIPTC_CACHE_DIR override is never chmod'd
27
+ * and participates only when its caller-provided mode is already private. */
28
+ export declare function ensurePrivateCacheRoot(root: string, hardenExisting: boolean): Promise<void>;
29
+ export declare function cacheDigestPath(path: string): string;
30
+ export declare function fileDigest(path: string): Promise<string>;
31
+ /** Cache entries are disposable data, not trusted compiler output. Atomic
32
+ * rename prevents ordinary partial writes, while the adjacent digest catches
33
+ * disk damage, manual truncation, and entries left by an interrupted/older
34
+ * publisher before they reach clang, the linker, or `ar`. */
35
+ export declare function validCachedFile(object: string): Promise<boolean>;
36
+ /** Copy a cache entry and verify the private copy before it can become a
37
+ * caller-visible artifact. Verifying after the copy closes the gap between a
38
+ * source-side digest check and a concurrent replacement/truncation. */
39
+ export declare function copyValidCachedFile(source: string, destination: string): Promise<boolean>;
40
+ /** Publish a complete executable/archive and its digest through private names.
41
+ * Data is installed before its verifier, so a racing reader can only observe
42
+ * an invalid/missing digest and take the fresh-build path. */
43
+ export declare function publishCachedFile(source: string, destination: string): Promise<void>;
44
+ export declare function pruneCache(root: string, protectedPaths?: ReadonlySet<string>): Promise<void>;
@@ -0,0 +1,241 @@
1
+ import { createHash } from "node:crypto";
2
+ import { chmod, copyFile, mkdir, readdir, readFile, rename, rm, stat, unlink, utimes, writeFile } from "node:fs/promises";
3
+ import { homedir } from "node:os";
4
+ import { basename, dirname, join, resolve } from "node:path";
5
+ export async function fileExists(path) {
6
+ return stat(path).then((s) => s.isFile(), () => false);
7
+ }
8
+ export function protectCachedArtifact(paths, path) {
9
+ paths?.add(path);
10
+ paths?.add(cacheDigestPath(path));
11
+ }
12
+ export function privateSiblingPath(destination, label) {
13
+ // Keep the temporary component independent of the caller's basename. A
14
+ // destination can validly consume the filesystem's entire NAME_MAX budget;
15
+ // appending or prepending that basename would make the atomic install fail.
16
+ return join(dirname(destination), `.scriptc-${label}-${process.pid}-${Math.random().toString(36).slice(2)}`);
17
+ }
18
+ /** Copy an artifact through a private sibling name, then atomically install it.
19
+ * The source can live on another filesystem (cache/temp roots commonly do), so
20
+ * a direct rename is not portable. */
21
+ export async function installArtifact(source, destination, mode) {
22
+ await mkdir(dirname(destination), { recursive: true });
23
+ const tmp = privateSiblingPath(destination, "install");
24
+ try {
25
+ await copyFile(source, tmp);
26
+ if (mode !== undefined)
27
+ await chmod(tmp, mode);
28
+ await rename(tmp, destination);
29
+ }
30
+ finally {
31
+ await rm(tmp, { force: true }).catch(() => undefined);
32
+ }
33
+ }
34
+ /** Resolve the build cache without touching the filesystem. Exported from this
35
+ * internal module so its platform and override behavior can be pinned directly. */
36
+ export function resolveBuildCacheRoot(env = process.env, platform = process.platform, userHome = homedir()) {
37
+ if (env["SCRIPTC_NO_CACHE"] === "1")
38
+ return null;
39
+ const configured = env["SCRIPTC_CACHE_DIR"];
40
+ if (configured !== undefined)
41
+ return configured === "" ? null : resolve(configured);
42
+ const xdg = env["XDG_CACHE_HOME"];
43
+ if (xdg !== undefined && xdg !== "")
44
+ return resolve(xdg, "scriptc", "build");
45
+ if (platform === "win32") {
46
+ const local = env["LOCALAPPDATA"];
47
+ if (local !== undefined && local !== "")
48
+ return resolve(local, "scriptc", "cache", "build");
49
+ }
50
+ return platform === "darwin"
51
+ ? resolve(userHome, "Library", "Caches", "scriptc", "build")
52
+ : resolve(userHome, ".cache", "scriptc", "build");
53
+ }
54
+ /** Shared persistent-cache root for compiler-level tiers. The early library
55
+ * cache deliberately follows the native cache's activation and hard-disable
56
+ * contract, while native compilation retains ownership of toolchain safety. */
57
+ export function buildCacheRoot() {
58
+ return resolveBuildCacheRoot();
59
+ }
60
+ /** Harden/create a compiler-level cache root using the same privacy policy as
61
+ * the artifact caches. Failure disables only the optional caller's tier. */
62
+ export async function prepareBuildCacheRoot(root) {
63
+ if (root === null)
64
+ return null;
65
+ try {
66
+ await ensurePrivateCacheRoot(root, process.env["SCRIPTC_CACHE_DIR"] === undefined);
67
+ return root;
68
+ }
69
+ catch {
70
+ return null;
71
+ }
72
+ }
73
+ /** Register a successful compiler-level cache write with the shared bounded
74
+ * LRU policy. */
75
+ export async function pruneBuildCache(root) {
76
+ if (root !== null)
77
+ await pruneCache(root).catch(() => undefined);
78
+ }
79
+ export function cacheRootDir() {
80
+ return resolveBuildCacheRoot();
81
+ }
82
+ /** The production cache can contain complete user executables/archives with
83
+ * embedded source literals or comptime values. Its root is therefore private
84
+ * regardless of the caller's ordinary output umask. Windows inherits the
85
+ * per-user LOCALAPPDATA ACL. POSIX platform-default roots are hardened for
86
+ * upgrades; an arbitrary existing SCRIPTC_CACHE_DIR override is never chmod'd
87
+ * and participates only when its caller-provided mode is already private. */
88
+ export async function ensurePrivateCacheRoot(root, hardenExisting) {
89
+ const existing = await stat(root).then((info) => info, (error) => {
90
+ if (error.code === "ENOENT")
91
+ return null;
92
+ throw error;
93
+ });
94
+ if (existing !== null && !existing.isDirectory()) {
95
+ throw new Error("native cache root is not a directory");
96
+ }
97
+ if (process.platform !== "win32" &&
98
+ existing !== null &&
99
+ !hardenExisting &&
100
+ (existing.mode & 0o077) !== 0) {
101
+ throw new Error("existing native cache override is not private");
102
+ }
103
+ await mkdir(root, { recursive: true, mode: 0o700 });
104
+ if (process.platform !== "win32" && (existing === null || hardenExisting)) {
105
+ await chmod(root, 0o700);
106
+ }
107
+ }
108
+ export function cacheDigestPath(path) {
109
+ return `${path}.sha256`;
110
+ }
111
+ export async function fileDigest(path) {
112
+ return createHash("sha256").update(await readFile(path)).digest("hex");
113
+ }
114
+ /** Cache entries are disposable data, not trusted compiler output. Atomic
115
+ * rename prevents ordinary partial writes, while the adjacent digest catches
116
+ * disk damage, manual truncation, and entries left by an interrupted/older
117
+ * publisher before they reach clang, the linker, or `ar`. */
118
+ export async function validCachedFile(object) {
119
+ try {
120
+ const digestPath = cacheDigestPath(object);
121
+ const expected = (await readFile(digestPath, "utf8")).trim();
122
+ const valid = /^[0-9a-f]{64}$/.test(expected) && (await fileDigest(object)) === expected;
123
+ if (valid) {
124
+ const now = new Date();
125
+ await Promise.all([
126
+ utimes(object, now, now).catch(() => undefined),
127
+ utimes(digestPath, now, now).catch(() => undefined),
128
+ ]);
129
+ }
130
+ return valid;
131
+ }
132
+ catch {
133
+ return false;
134
+ }
135
+ }
136
+ /** Copy a cache entry and verify the private copy before it can become a
137
+ * caller-visible artifact. Verifying after the copy closes the gap between a
138
+ * source-side digest check and a concurrent replacement/truncation. */
139
+ export async function copyValidCachedFile(source, destination) {
140
+ try {
141
+ const digestPath = cacheDigestPath(source);
142
+ const expected = (await readFile(digestPath, "utf8")).trim();
143
+ if (!/^[0-9a-f]{64}$/.test(expected))
144
+ return false;
145
+ await copyFile(source, destination);
146
+ if ((await fileDigest(destination)) !== expected) {
147
+ await rm(destination, { force: true }).catch(() => undefined);
148
+ return false;
149
+ }
150
+ const now = new Date();
151
+ await Promise.all([
152
+ utimes(source, now, now).catch(() => undefined),
153
+ utimes(digestPath, now, now).catch(() => undefined),
154
+ ]);
155
+ return true;
156
+ }
157
+ catch {
158
+ await rm(destination, { force: true }).catch(() => undefined);
159
+ return false;
160
+ }
161
+ }
162
+ /** Publish a complete executable/archive and its digest through private names.
163
+ * Data is installed before its verifier, so a racing reader can only observe
164
+ * an invalid/missing digest and take the fresh-build path. */
165
+ export async function publishCachedFile(source, destination) {
166
+ const directory = dirname(destination);
167
+ await mkdir(directory, { recursive: true });
168
+ const nonce = `${process.pid}-${Math.random().toString(36).slice(2)}`;
169
+ const tmp = join(directory, `.tmp-${basename(destination).slice(0, 8)}-${nonce}`);
170
+ const tmpDigest = `${tmp}.sha256`;
171
+ try {
172
+ await copyFile(source, tmp);
173
+ await chmod(tmp, 0o600);
174
+ await writeFile(tmpDigest, `${await fileDigest(tmp)}\n`, { mode: 0o600 });
175
+ await rename(tmp, destination);
176
+ await rename(tmpDigest, cacheDigestPath(destination));
177
+ }
178
+ finally {
179
+ await Promise.all([
180
+ rm(tmp, { force: true }).catch(() => undefined),
181
+ rm(tmpDigest, { force: true }).catch(() => undefined),
182
+ ]);
183
+ }
184
+ }
185
+ /** Size-capped LRU sweep of the whole cache root. A caller-configured cap is
186
+ * enforced after every successful cache write. The 4 GiB default is checked on
187
+ * the first and every 64th write in a long-lived process: a full tree walk per
188
+ * corpus program would otherwise become quadratic as the cache grows. Oldest-
189
+ * mtime files go first until the tree is back under 75% of the cap; reads bump
190
+ * mtimes. Active links use private staged names/hard links, so cache names can
191
+ * be unlinked safely. */
192
+ const rootWriteCounts = new Map();
193
+ export async function pruneCache(root, protectedPaths) {
194
+ const configuredCap = process.env["SCRIPTC_CACHE_MAX_MB"];
195
+ const writes = (rootWriteCounts.get(root) ?? 0) + 1;
196
+ rootWriteCounts.set(root, writes);
197
+ if (configuredCap === undefined && writes !== 1 && writes % 64 !== 0)
198
+ return;
199
+ const capBytes = Number(configuredCap ?? "4096") * 1024 * 1024;
200
+ if (!Number.isFinite(capBytes) || capBytes <= 0)
201
+ return;
202
+ const files = [];
203
+ const walk = async (dir) => {
204
+ const entries = await readdir(dir, { withFileTypes: true }).catch(() => []);
205
+ for (const ent of entries) {
206
+ const p = join(dir, ent.name);
207
+ if (ent.isDirectory())
208
+ await walk(p);
209
+ else if (ent.isFile()) {
210
+ // Atomic publishers use private names until their data/digest or
211
+ // metadata stamp is complete. They are active writes, not LRU entries.
212
+ if (ent.name.startsWith(".scriptc-") ||
213
+ ent.name.startsWith(".tmp-") ||
214
+ ent.name.includes(".tmp-"))
215
+ continue;
216
+ if (protectedPaths?.has(p))
217
+ continue;
218
+ const s = await stat(p).catch(() => null);
219
+ if (s !== null)
220
+ files.push({ path: p, size: s.size, mtimeMs: s.mtimeMs });
221
+ }
222
+ }
223
+ };
224
+ await walk(root);
225
+ let total = files.reduce((n, f) => n + f.size, 0);
226
+ if (total <= capBytes)
227
+ return;
228
+ files.sort((a, b) => a.mtimeMs - b.mtimeMs);
229
+ for (const f of files) {
230
+ if (total <= capBytes * 0.75)
231
+ break;
232
+ try {
233
+ await unlink(f.path);
234
+ total -= f.size;
235
+ }
236
+ catch {
237
+ // A concurrent reader/publisher may already have moved the name.
238
+ }
239
+ }
240
+ }
241
+ //# sourceMappingURL=build-cache.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-cache.js","sourceRoot":"","sources":["../../src/backend/build-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC1H,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAE7D,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,IAAY;IAC3C,OAAO,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,CACpB,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,EACjB,GAAG,EAAE,CAAC,KAAK,CACZ,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,KAA8B,EAAE,IAAY;IAChF,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC;IACjB,KAAK,EAAE,GAAG,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,WAAmB,EAAE,KAAa;IACnE,uEAAuE;IACvE,2EAA2E;IAC3E,4EAA4E;IAC5E,OAAO,IAAI,CACT,OAAO,CAAC,WAAW,CAAC,EACpB,YAAY,KAAK,IAAI,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,MA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IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;YAC5E,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IACF,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,IAAI,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAClD,IAAI,KAAK,IAAI,QAAQ;QAAE,OAAO;IAC9B,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;IAC5C,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,KAAK,IAAI,QAAQ,GAAG,IAAI;YAAE,MAAM;QACpC,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACrB,KAAK,IAAI,CAAC,CAAC,IAAI,CAAC;QAClB,CAAC;QAAC,MAAM,CAAC;YACP,iEAAiE;QACnE,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -1,10 +1,10 @@
1
- import type { CEmitter } from "./emitter.js";
2
- import { IrType } from "../../ir/nodes.js";
1
+ import type { CEmitter } from "./c-emitter.js";
2
+ import { IrType } from "../../ir/ir.js";
3
3
  /** Per-async-function machinery: an argument pack, a fiber trampoline
4
4
  * (unpacks, runs the ordinary compiled body, settles the promise), and a
5
5
  * spawn wrapper call sites use. Lifted async lambdas additionally thread
6
6
  * their closure env through the pack (+1, released after the body). */
7
- export declare function emitAsyncScaffolding(E: CEmitter, out: string[]): void;
7
+ export declare function emitAsyncScaffolding(emitter: CEmitter, out: string[]): void;
8
8
  /** Interned per-union child exit adapter: the runtime invokes
9
9
  * adapter(cb, has_code, code, signal_name); the adapter builds the
10
10
  * `number | null` union value (tags are program data — the frontend
@@ -12,19 +12,19 @@ export declare function emitAsyncScaffolding(E: CEmitter, out: string[]): void;
12
12
  * owns the union param per the universal convention (unit-arm
13
13
  * instances are immortal; their release is a no-op). The one-param
14
14
  * shape ignores the signal. */
15
- export declare function childExitThunkFor(E: CEmitter, param: IrType): string;
15
+ export declare function childExitThunkFor(emitter: CEmitter, param: IrType): string;
16
16
  /** The TWO-parameter exit adapter — Node's `(code, signal)` listener:
17
17
  * the code union as above plus the signal as its own `string | null`
18
18
  * union (a fresh string from the runtime's static signal name when a
19
19
  * signal killed the child, the null arm otherwise). */
20
- export declare function childExitThunkFor2(E: CEmitter, codeParam: IrType, sigParam: IrType): string;
20
+ export declare function childExitSignalThunkFor(emitter: CEmitter, codeParam: IrType, sigParam: IrType): string;
21
21
  /** Interned per-union child-stream data adapter: the runtime invokes
22
22
  * adapter(cb, chunk) with the chunk BORROWED; the adapter wraps a
23
23
  * retained chunk at the union's Buffer arm (the frontend guaranteed
24
24
  * the arm exists — the ngrok `Buffer | string` listener; strings never
25
25
  * fire from a pipe) and calls the listener, which owns the union param
26
26
  * per the universal convention. */
27
- export declare function childDataThunkFor(E: CEmitter, param: IrType): string;
27
+ export declare function childDataThunkFor(emitter: CEmitter, param: IrType): string;
28
28
  /** Interned per-union bound-close adapter (`server.close.bind(server)`
29
29
  * as a value): invoked through the closure ABI with the callback-union
30
30
  * argument, it closes the server DIRECTLY (never through the override —
@@ -33,13 +33,13 @@ export declare function childDataThunkFor(E: CEmitter, param: IrType): string;
33
33
  * `(err?: Error) => void`) behind an emitted zero-arg trampoline that
34
34
  * fires it with the undefined arm (a clean close carries no error) —
35
35
  * and answers the +1 server (Node's chaining return). */
36
- export declare function closeBindThunkFor(E: CEmitter, cbUnion: IrType, retServer: boolean): string;
36
+ export declare function closeBindThunkFor(emitter: CEmitter, cbUnion: IrType, retServer: boolean): string;
37
37
  /** Interned close-override zero-arg wrapper (`server.close = fn`): the
38
38
  * stored override must be invocable by the runtime WITHOUT program
39
39
  * types, so this wrapper carries the user function and fires it with
40
40
  * the undefined-arm callback argument (tags are program data),
41
41
  * releasing the chaining-return server when the signature answers one. */
42
- export declare function closeOverrideWrapFor(E: CEmitter, cbUnion: IrType, retServer: boolean): string;
42
+ export declare function closeOverrideWrapFor(emitter: CEmitter, cbUnion: IrType, retServer: boolean): string;
43
43
  /** Interned per-shape dgram message adapter for the TWO-parameter
44
44
  * (msg: Buffer, rinfo) listener: the rinfo RECORD is program data, so
45
45
  * the adapter builds it from the runtime's parts (address/family
@@ -47,26 +47,26 @@ export declare function closeOverrideWrapFor(E: CEmitter, cbUnion: IrType, retSe
47
47
  * which owns both params per the universal convention (msg retains like
48
48
  * the net data thunk). Zero/one-param listeners take the runtime's own
49
49
  * scr_dgram_msg_thunk0/1. */
50
- export declare function dgramMsgThunkFor(E: CEmitter, param: IrType): string;
50
+ export declare function dgramMsgThunkFor(emitter: CEmitter, param: IrType): string;
51
51
  /** Interned dns.lookup callback adapter, per (union id, param count):
52
52
  * the runtime invokes adapter(cb, errmsg-or-NULL, address, family) with
53
53
  * everything borrowed; the adapter builds the `Error | null` first
54
54
  * argument (tags are program data — the frontend pinned the union) and
55
55
  * calls the listener with as many arguments as it declared, each owned
56
56
  * per the universal convention. */
57
- export declare function dnsLookupThunkFor(E: CEmitter, cbT: IrType): string;
57
+ export declare function dnsLookupThunkFor(emitter: CEmitter, cbT: IrType): string;
58
58
  /** Interned fs.rename callback adapter. The runtime supplies a borrowed
59
59
  * ScrError (or NULL); the adapter builds the callback's program-specific
60
60
  * Error | null union, or a dyn error/null for checkJs callbacks. */
61
- export declare function fsRenameThunkFor(E: CEmitter, cbT: IrType): string;
61
+ export declare function fsRenameThunkFor(emitter: CEmitter, cbT: IrType): string;
62
62
  /** Interned CONNECT-listener adapter for a UNION socket slot — the h2
63
63
  * compat listener (`(req, resOrSocket: Http2ServerResponse | net.Socket)
64
64
  * => void`): the runtime fires (cb, req, sock, head) like an upgrade;
65
65
  * the adapter wraps the socket at the union's netSocket arm (its tag is
66
66
  * program data) and drops `head` when the listener declares two params.
67
67
  * All three runtime args arrive +1; the union takes the socket's. */
68
- export declare function connectSockThunkFor(E: CEmitter, cbT: IrType): string;
69
- export declare function connectResThunkFor(E: CEmitter, cbT: IrType): string;
68
+ export declare function connectSockThunkFor(emitter: CEmitter, cbT: IrType): string;
69
+ export declare function connectResThunkFor(emitter: CEmitter, cbT: IrType): string;
70
70
  /** Interned net.connect-lookup answer thunk: the fn of the runtime-minted
71
71
  * callback the caller's `lookup` option receives (the SNI-answer
72
72
  * pattern). COMPILED code calls it per its static type — `(err:
@@ -75,7 +75,7 @@ export declare function connectResThunkFor(E: CEmitter, cbT: IrType): string;
75
75
  * tag) and the addresses record's field layout down to the runtime's
76
76
  * (has_err, message, ip-list) answer. Params arrive +1 and release
77
77
  * here; the extracted message/ips hand over +1. */
78
- export declare function netLookupAnswerThunkFor(E: CEmitter, cbT: IrType): string;
78
+ export declare function netLookupAnswerThunkFor(emitter: CEmitter, cbT: IrType): string;
79
79
  /** Interned SNI answer-closure thunk: the fn of the runtime-minted `cb`
80
80
  * a TLS server's SNICallback receives. COMPILED code calls cb per its
81
81
  * static type — `(err: Error | null, ctx?: SecureContext) => void`, or
@@ -84,7 +84,7 @@ export declare function netLookupAnswerThunkFor(E: CEmitter, cbT: IrType): strin
84
84
  * to the runtime's (has_err, ctx-or-NULL) answer. The thunk owns its
85
85
  * union params per the universal convention (the ctx payload retains
86
86
  * +1 before its union releases; ownership moves to the runtime). */
87
- export declare function sniAnswerThunkFor(E: CEmitter, cbT: IrType): string;
87
+ export declare function sniAnswerThunkFor(emitter: CEmitter, cbT: IrType): string;
88
88
  /** Interned Promise.race fulfillment adapter: converts a settled entry's
89
89
  * payload (inner type `from`) into the result promise's inner type `to`
90
90
  * and fulfills the destination. Three shapes, mirroring the frontend's
@@ -93,7 +93,7 @@ export declare function sniAnswerThunkFor(E: CEmitter, cbT: IrType): string;
93
93
  * entry re-tags arm-wise (canonical arm order makes the mapping a
94
94
  * typeKey lookup). Rejections never reach adapters — the runtime copies
95
95
  * them raw. */
96
- export declare function raceAdapterFor(E: CEmitter, from: IrType, to: IrType): string;
96
+ export declare function raceAdapterFor(emitter: CEmitter, from: IrType, to: IrType): string;
97
97
  /** Interned generator-resume result builder: reads the post-resume state
98
98
  * of a generator into a fresh IteratorResult record `{ done, value }`.
99
99
  * One helper per generator type (every next/return/throw on it shares
@@ -103,29 +103,20 @@ export declare function raceAdapterFor(E: CEmitter, from: IrType, to: IrType): s
103
103
  * a present completion value wraps the same way and an empty OUT is
104
104
  * JS's undefined (the interned undefined arm — or the dyn undefined
105
105
  * when V is dyn, the any/unknown channel). */
106
- export declare function genResultThunkFor(E: CEmitter, genT: IrType & {
106
+ export declare function genResultThunkFor(emitter: CEmitter, genT: IrType & {
107
107
  kind: "generator";
108
108
  }, recT: IrType & {
109
109
  kind: "record";
110
110
  }): string;
111
111
  /** Interned per inner-type resolve thunk for ref-kind new Promise. */
112
- export declare function resolveThunkFor(E: CEmitter, inner: IrType): string;
112
+ export declare function resolveThunkFor(emitter: CEmitter, inner: IrType): string;
113
113
  /** The EventEmitter listener invoke adapter for one listener signature:
114
114
  * `void (ScrClosure *, va_list)` — va_args exactly the listener's own
115
115
  * parameter prefix of the emit site's typed tail (the frontend unified
116
116
  * the tuple, so reads agree with writes), retains each refcounted value
117
117
  * (the callee owns +1 per the universal convention; f64/bool copy), and
118
118
  * calls cb->fn behind its exact C signature. Interned per func-type key. */
119
- export declare function emitterInvokeThunkFor(E: CEmitter, cbT: IrType): string;
120
- /** The stream completion-callback closure fn for one done func type: the
121
- * `callback` a user's write/final/destroy/transform/flush receives. The
122
- * closure's one capture box holds the stream (+1); calling it unwraps the
123
- * (optional) error/data union arguments and reports completion to the
124
- * runtime. Kind names the runtime entry: "w" scr_stream_write_done, "f"
125
- * scr_stream_final_done, "d" scr_stream_destroy_done, "t"
126
- * scr_stream_transform_done, "l" scr_stream_flush_done. Args arrive
127
- * callee-owned (+1) per the universal convention and are released here. */
128
- export declare function streamDoneFnFor(E: CEmitter, kind: "w" | "f" | "d" | "t" | "l", doneT: IrType): string;
119
+ export declare function emitterInvokeThunkFor(emitter: CEmitter, cbT: IrType): string;
129
120
  /** The stream-'data' listener invoke adapter for one listener func type:
130
121
  * the runtime's 'data' emission carries BOTH payload slots (ScrBytes *b,
131
122
  * ScrStr *s — exactly one non-NULL; encoded streams deliver strings),
@@ -135,7 +126,7 @@ export declare function streamDoneFnFor(E: CEmitter, kind: "w" | "f" | "d" | "t"
135
126
  * just hand the value over — SEMANTICS.md). Zero-parameter listeners
136
127
  * ignore both slots; DYN-parameter listeners (the JS lane's adapter,
137
128
  * emitter.onDataDyn) box by tag, which is always right. */
138
- export declare function streamDataThunkFor(E: CEmitter, cbT: IrType): string;
129
+ export declare function streamDataThunkFor(emitter: CEmitter, cbT: IrType): string;
139
130
  /** The stream option-callback invoke adapter for one (kind, callback
140
131
  * type): the runtime calls the user's read/write/final/destroy/transform/
141
132
  * flush closure through it. The stream rides first (the leading `this`
@@ -147,4 +138,4 @@ export declare function streamDataThunkFor(E: CEmitter, cbT: IrType): string;
147
138
  * never complete, exactly Node. Kinds: "r" read(size), "w" write(chunk,
148
139
  * enc, cb), "f" final(cb), "d" destroy(err, cb), "t" transform(chunk,
149
140
  * enc, cb), "l" flush(cb). */
150
- export declare function streamCbThunkFor(E: CEmitter, kind: "r" | "w" | "f" | "d" | "t" | "l" | "e", cbT: IrType): string;
141
+ export declare function streamCbThunkFor(emitter: CEmitter, kind: "r" | "w" | "f" | "d" | "t" | "l" | "e", cbT: IrType): string;