@scriptc/compiler 0.0.32 → 0.0.34

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 (120) hide show
  1. package/dist/backend/cc-cache.test.js +430 -1
  2. package/dist/backend/cc-cache.test.js.map +1 -1
  3. package/dist/backend/cc.d.ts +25 -0
  4. package/dist/backend/cc.js +818 -88
  5. package/dist/backend/cc.js.map +1 -1
  6. package/dist/backend/emission/emit-exprs.js +79 -3
  7. package/dist/backend/emission/emit-exprs.js.map +1 -1
  8. package/dist/backend/emission/emit-shapes.js +37 -4
  9. package/dist/backend/emission/emit-shapes.js.map +1 -1
  10. package/dist/backend/emission/emitter.d.ts +23 -7
  11. package/dist/backend/emission/emitter.js +171 -27
  12. package/dist/backend/emission/emitter.js.map +1 -1
  13. package/dist/backend/emission/may-throw.js +7 -4
  14. package/dist/backend/emission/may-throw.js.map +1 -1
  15. package/dist/backend/ffi-callbacks.d.ts +38 -1
  16. package/dist/backend/ffi-callbacks.js +76 -3
  17. package/dist/backend/ffi-callbacks.js.map +1 -1
  18. package/dist/backend/library-identity.d.ts +22 -0
  19. package/dist/backend/library-identity.js +103 -0
  20. package/dist/backend/library-identity.js.map +1 -0
  21. package/dist/backend/llvm/emitter.d.ts +3 -0
  22. package/dist/backend/llvm/emitter.js +278 -17
  23. package/dist/backend/llvm/emitter.js.map +1 -1
  24. package/dist/backend/llvm/shapes.d.ts +1 -0
  25. package/dist/backend/llvm/shapes.js +25 -1
  26. package/dist/backend/llvm/shapes.js.map +1 -1
  27. package/dist/backend/mangle.d.ts +1 -0
  28. package/dist/backend/mangle.js +3 -0
  29. package/dist/backend/mangle.js.map +1 -1
  30. package/dist/backend/object-localize.d.ts +5 -5
  31. package/dist/backend/object-localize.js +19 -16
  32. package/dist/backend/object-localize.js.map +1 -1
  33. package/dist/backend/object-localize.test.js +37 -13
  34. package/dist/backend/object-localize.test.js.map +1 -1
  35. package/dist/diagnostics/diagnostic.js +2 -0
  36. package/dist/diagnostics/diagnostic.js.map +1 -1
  37. package/dist/ffi/profile.d.ts +17 -5
  38. package/dist/ffi/profile.js +169 -22
  39. package/dist/ffi/profile.js.map +1 -1
  40. package/dist/frontend/input-tracker.d.ts +82 -0
  41. package/dist/frontend/input-tracker.js +380 -0
  42. package/dist/frontend/input-tracker.js.map +1 -0
  43. package/dist/frontend/input-tracker.test.d.ts +1 -0
  44. package/dist/frontend/input-tracker.test.js +137 -0
  45. package/dist/frontend/input-tracker.test.js.map +1 -0
  46. package/dist/frontend/lowering/lower-builtins.js +2 -8
  47. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  48. package/dist/frontend/lowering/lower-calls.d.ts +1 -0
  49. package/dist/frontend/lowering/lower-calls.js +244 -163
  50. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  51. package/dist/frontend/lowering/lower-classes.js +3 -0
  52. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  53. package/dist/frontend/lowering/lower-containers.js +113 -28
  54. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  55. package/dist/frontend/lowering/lower-exprs.js +67 -1
  56. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  57. package/dist/frontend/lowering/lower-inspect.js +45 -26
  58. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  59. package/dist/frontend/lowering/lower-modules.js +1 -1
  60. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  61. package/dist/frontend/lowering/lower-stmts.js +48 -3
  62. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  63. package/dist/frontend/lowering/lowerer.d.ts +79 -29
  64. package/dist/frontend/lowering/lowerer.js +429 -87
  65. package/dist/frontend/lowering/lowerer.js.map +1 -1
  66. package/dist/frontend/npm-static-rewrite.js +25 -26
  67. package/dist/frontend/npm-static-rewrite.js.map +1 -1
  68. package/dist/frontend/npm-static.js +29 -30
  69. package/dist/frontend/npm-static.js.map +1 -1
  70. package/dist/frontend/npm-static.test.d.ts +1 -0
  71. package/dist/frontend/npm-static.test.js +15 -0
  72. package/dist/frontend/npm-static.test.js.map +1 -0
  73. package/dist/frontend/npm.js +5 -17
  74. package/dist/frontend/npm.js.map +1 -1
  75. package/dist/frontend/program.js +2 -6
  76. package/dist/frontend/program.js.map +1 -1
  77. package/dist/frontend/resolve.js +8 -29
  78. package/dist/frontend/resolve.js.map +1 -1
  79. package/dist/frontend/ts7/checker.d.ts +2 -0
  80. package/dist/frontend/ts7/checker.js +20 -3
  81. package/dist/frontend/ts7/checker.js.map +1 -1
  82. package/dist/frontend/ts7/program.js +17 -18
  83. package/dist/frontend/ts7/program.js.map +1 -1
  84. package/dist/frontend/types.d.ts +41 -0
  85. package/dist/frontend/types.js +147 -8
  86. package/dist/frontend/types.js.map +1 -1
  87. package/dist/index.d.ts +1 -1
  88. package/dist/index.js +275 -41
  89. package/dist/index.js.map +1 -1
  90. package/dist/ir/nodes.d.ts +42 -12
  91. package/dist/ir/nodes.js +7 -1
  92. package/dist/ir/nodes.js.map +1 -1
  93. package/dist/ir/serialize.d.ts +1 -1
  94. package/dist/ir/serialize.js +1 -1
  95. package/dist/ir/validate.js +104 -1
  96. package/dist/ir/validate.js.map +1 -1
  97. package/dist/library/early-cache.d.ts +65 -0
  98. package/dist/library/early-cache.js +380 -0
  99. package/dist/library/early-cache.js.map +1 -0
  100. package/dist/library/early-cache.test.d.ts +1 -0
  101. package/dist/library/early-cache.test.js +528 -0
  102. package/dist/library/early-cache.test.js.map +1 -0
  103. package/dist/library/int-infer.js +14 -0
  104. package/dist/library/int-infer.js.map +1 -1
  105. package/dist/library/int-infer.test.js +21 -4
  106. package/dist/library/int-infer.test.js.map +1 -1
  107. package/dist/library/profile.d.ts +3 -0
  108. package/dist/library/profile.js +9 -1
  109. package/dist/library/profile.js.map +1 -1
  110. package/dist/library/semantic-source.d.ts +13 -0
  111. package/dist/library/semantic-source.js +257 -0
  112. package/dist/library/semantic-source.js.map +1 -0
  113. package/dist/library/semantic-source.test.d.ts +1 -0
  114. package/dist/library/semantic-source.test.js +113 -0
  115. package/dist/library/semantic-source.test.js.map +1 -0
  116. package/dist/library/sidecar.d.ts +6 -0
  117. package/dist/library/sidecar.js +11 -0
  118. package/dist/library/sidecar.js.map +1 -1
  119. package/package.json +2 -2
  120. package/surface-manifest.json +1 -1
@@ -173,6 +173,10 @@ export interface CcOptions {
173
173
  * scr_watch.c into the binary — the net gating precedent, so watch-free
174
174
  * binaries keep their exact link line. */
175
175
  watch?: boolean;
176
+ /** The executable manifest has a format-5 foreign callback descriptor:
177
+ * compiles the MPSC queue/self-pipe unit. Other FFI and non-FFI binaries
178
+ * keep their existing runtime size class. */
179
+ foreignFfi?: boolean;
176
180
  /** The program uses node:test (moduleUsesNodeTest on the IR): compiles
177
181
  * scr_test.c into the binary — the net gating precedent, so test-free
178
182
  * binaries keep their exact link line. */
@@ -267,6 +271,15 @@ export declare function vendorCacheBuildIdentity(environmentFingerprint: string,
267
271
  export interface LibArchiveOptions {
268
272
  /** The program TU (.c or .ll — clang compiles either with -c). */
269
273
  cPath: string;
274
+ /** Invocation-owned program source to compile under `cPath`'s public
275
+ * spelling. Library assembly uses this for the identity-free projection of
276
+ * a complete caller-visible TU; its bytes drive every native cache key. */
277
+ programSource?: string;
278
+ /** Tiny generated C source carrying volatile library identity getters.
279
+ * Its bytes join the complete archive key, but the source itself exists
280
+ * only in the invocation-private build directory and the large program-
281
+ * object cache is keyed independently. */
282
+ identityCSource?: string;
270
283
  /** The archive to produce (<name>.lib.a). */
271
284
  outPath: string;
272
285
  /** Caller-owned identity for the generated TU's complete non-system
@@ -274,6 +287,8 @@ export interface LibArchiveOptions {
274
287
  * matching compileC's arbitrary-input safety boundary. */
275
288
  cacheIdentity?: string;
276
289
  sanitize?: boolean;
290
+ /** Native optimization posture: release = -O2, dev = -O0. */
291
+ optimization?: "release" | "dev";
277
292
  /** Multi-instance library mode (the profile's abi.localize_runtime): the
278
293
  * external symbols to KEEP global — every other scriptc external
279
294
  * definition in the archive (the runtime's internals, the program TU's
@@ -312,6 +327,16 @@ export declare function compileLibArchive(opts: LibArchiveOptions): Promise<void
312
327
  /** Resolve the build cache without touching the filesystem. Exported from this
313
328
  * internal module so its platform and override behavior can be pinned directly. */
314
329
  export declare function resolveBuildCacheRoot(env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, userHome?: string): string | null;
330
+ /** Shared persistent-cache root for compiler-level tiers. The early library
331
+ * cache deliberately follows the native cache's activation and hard-disable
332
+ * contract, while native compilation retains ownership of toolchain safety. */
333
+ export declare function buildCacheRoot(): string | null;
334
+ /** Harden/create a compiler-level cache root using the same privacy policy as
335
+ * the artifact caches. Failure disables only the optional caller's tier. */
336
+ export declare function prepareBuildCacheRoot(root: string | null): Promise<string | null>;
337
+ /** Register a successful compiler-level cache write with the shared bounded
338
+ * LRU policy. */
339
+ export declare function pruneBuildCache(root: string | null): Promise<void>;
315
340
  export declare function ccVersionOnce(argv: string[], environmentFingerprint?: string, fresh?: boolean): Promise<string>;
316
341
  /** Every system-header spelling consumed by a source tree scriptc owns. The
317
342
  * dependency probe preprocesses these spellings with the selected driver and