@scriptc/compiler 0.1.4 → 0.1.5

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 (150) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +75 -11
  2. package/dist/backend/c/c-emitter.d.ts +5 -1
  3. package/dist/backend/c/c-emitter.js +22 -9
  4. package/dist/backend/c/c-emitter.js.map +1 -1
  5. package/dist/backend/c/exprs.d.ts +2 -2
  6. package/dist/backend/c/exprs.js +264 -21
  7. package/dist/backend/c/exprs.js.map +1 -1
  8. package/dist/backend/c/stmts.js +5 -3
  9. package/dist/backend/c/stmts.js.map +1 -1
  10. package/dist/backend/c/types.d.ts +2 -3
  11. package/dist/backend/c/types.js +8 -1
  12. package/dist/backend/c/types.js.map +1 -1
  13. package/dist/backend/c/walkers.js +1 -1
  14. package/dist/backend/c/walkers.js.map +1 -1
  15. package/dist/backend/link-plan.d.ts +1 -0
  16. package/dist/backend/link-plan.js +2 -1
  17. package/dist/backend/link-plan.js.map +1 -1
  18. package/dist/backend/llvm/dyn.js +1 -1
  19. package/dist/backend/llvm/dyn.js.map +1 -1
  20. package/dist/backend/llvm/emitter.js +25 -9
  21. package/dist/backend/llvm/emitter.js.map +1 -1
  22. package/dist/backend/llvm/expr-bytes.d.ts +1 -2
  23. package/dist/backend/llvm/expr-bytes.js +22 -17
  24. package/dist/backend/llvm/expr-bytes.js.map +1 -1
  25. package/dist/backend/llvm/expr-containers.d.ts +1 -0
  26. package/dist/backend/llvm/expr-containers.js +32 -4
  27. package/dist/backend/llvm/expr-containers.js.map +1 -1
  28. package/dist/backend/llvm/expr-context.d.ts +6 -2
  29. package/dist/backend/llvm/expr-primitives.js +22 -7
  30. package/dist/backend/llvm/expr-primitives.js.map +1 -1
  31. package/dist/backend/llvm/lib-filesystem.js +12 -0
  32. package/dist/backend/llvm/lib-filesystem.js.map +1 -1
  33. package/dist/backend/llvm/lib-network.js +53 -10
  34. package/dist/backend/llvm/lib-network.js.map +1 -1
  35. package/dist/backend/llvm/lib-shared.js +64 -0
  36. package/dist/backend/llvm/lib-shared.js.map +1 -1
  37. package/dist/backend/native-toolchain.d.ts +2 -0
  38. package/dist/backend/native-toolchain.js +2 -1
  39. package/dist/backend/native-toolchain.js.map +1 -1
  40. package/dist/backend/targets.d.ts +3 -0
  41. package/dist/backend/targets.js +13 -0
  42. package/dist/backend/targets.js.map +1 -1
  43. package/dist/coverage/surface-manifest.js +6 -4
  44. package/dist/coverage/surface-manifest.js.map +1 -1
  45. package/dist/executable/executable-cache.d.ts +2 -0
  46. package/dist/executable/executable-cache.js +3 -1
  47. package/dist/executable/executable-cache.js.map +1 -1
  48. package/dist/executable/executable-cache.test.js +3 -3
  49. package/dist/executable/executable-cache.test.js.map +1 -1
  50. package/dist/frontend/lowering/containers/bytes.d.ts +1 -1
  51. package/dist/frontend/lowering/containers/bytes.js +6 -5
  52. package/dist/frontend/lowering/containers/bytes.js.map +1 -1
  53. package/dist/frontend/lowering/containers/string-and-regexp.d.ts +7 -6
  54. package/dist/frontend/lowering/containers/string-and-regexp.js +237 -28
  55. package/dist/frontend/lowering/containers/string-and-regexp.js.map +1 -1
  56. package/dist/frontend/lowering/expressions/object-literals.js +8 -0
  57. package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
  58. package/dist/frontend/lowering/lower-builtins.d.ts +4 -5
  59. package/dist/frontend/lowering/lower-builtins.js +18 -10
  60. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  61. package/dist/frontend/lowering/lower-calls.d.ts +3 -2
  62. package/dist/frontend/lowering/lower-calls.js +265 -88
  63. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  64. package/dist/frontend/lowering/lower-classes.js +2 -2
  65. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  66. package/dist/frontend/lowering/lower-containers.d.ts +7 -9
  67. package/dist/frontend/lowering/lower-containers.js +143 -51
  68. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  69. package/dist/frontend/lowering/lower-exprs.d.ts +12 -0
  70. package/dist/frontend/lowering/lower-exprs.js +128 -10
  71. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  72. package/dist/frontend/lowering/lower-island.js +17 -6
  73. package/dist/frontend/lowering/lower-island.js.map +1 -1
  74. package/dist/frontend/lowering/lower-server.d.ts +2 -4
  75. package/dist/frontend/lowering/lower-server.js +288 -32
  76. package/dist/frontend/lowering/lower-server.js.map +1 -1
  77. package/dist/frontend/lowering/lower-stmts.js +4 -4
  78. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  79. package/dist/frontend/lowering/lowerer.js +37 -2
  80. package/dist/frontend/lowering/lowerer.js.map +1 -1
  81. package/dist/frontend/lowering/optional-arguments.d.ts +9 -1
  82. package/dist/frontend/lowering/optional-arguments.js +67 -1
  83. package/dist/frontend/lowering/optional-arguments.js.map +1 -1
  84. package/dist/frontend/lowering/pairs-snapshot.d.ts +3 -1
  85. package/dist/frontend/lowering/pairs-snapshot.js +12 -4
  86. package/dist/frontend/lowering/pairs-snapshot.js.map +1 -1
  87. package/dist/frontend/lowering/surfaces.d.ts +8 -14
  88. package/dist/frontend/lowering/surfaces.js +37 -27
  89. package/dist/frontend/lowering/surfaces.js.map +1 -1
  90. package/dist/frontend/npm-static-prune.d.ts +6 -0
  91. package/dist/frontend/npm-static-prune.js +203 -0
  92. package/dist/frontend/npm-static-prune.js.map +1 -0
  93. package/dist/frontend/npm-static-prune.test.d.ts +1 -0
  94. package/dist/frontend/npm-static-prune.test.js +48 -0
  95. package/dist/frontend/npm-static-prune.test.js.map +1 -0
  96. package/dist/frontend/npm.js +7 -6
  97. package/dist/frontend/npm.js.map +1 -1
  98. package/dist/frontend/program.js +15 -4
  99. package/dist/frontend/program.js.map +1 -1
  100. package/dist/frontend/provenance.js +8 -3
  101. package/dist/frontend/provenance.js.map +1 -1
  102. package/dist/frontend/type-mapper.js +16 -5
  103. package/dist/frontend/type-mapper.js.map +1 -1
  104. package/dist/index.d.ts +3 -3
  105. package/dist/index.js +13 -41
  106. package/dist/index.js.map +1 -1
  107. package/dist/ir/analysis.d.ts +5 -3
  108. package/dist/ir/analysis.js +25 -11
  109. package/dist/ir/analysis.js.map +1 -1
  110. package/dist/ir/analysis.test.js +50 -2
  111. package/dist/ir/analysis.test.js.map +1 -1
  112. package/dist/ir/constant-tables.d.ts +17 -0
  113. package/dist/ir/constant-tables.js +99 -0
  114. package/dist/ir/constant-tables.js.map +1 -0
  115. package/dist/ir/constant-tables.test.d.ts +1 -0
  116. package/dist/ir/constant-tables.test.js +78 -0
  117. package/dist/ir/constant-tables.test.js.map +1 -0
  118. package/dist/ir/integer-ranges.d.ts +13 -0
  119. package/dist/ir/integer-ranges.js +122 -0
  120. package/dist/ir/integer-ranges.js.map +1 -0
  121. package/dist/ir/integer-ranges.test.d.ts +1 -0
  122. package/dist/ir/integer-ranges.test.js +63 -0
  123. package/dist/ir/integer-ranges.test.js.map +1 -0
  124. package/dist/ir/ir.d.ts +42 -34
  125. package/dist/ir/ir.js +7 -1
  126. package/dist/ir/ir.js.map +1 -1
  127. package/dist/ir/ir.test.js +6 -0
  128. package/dist/ir/ir.test.js.map +1 -1
  129. package/dist/ir/scalar-records.d.ts +8 -0
  130. package/dist/ir/scalar-records.js +216 -0
  131. package/dist/ir/scalar-records.js.map +1 -0
  132. package/dist/ir/scalar-records.test.d.ts +1 -0
  133. package/dist/ir/scalar-records.test.js +142 -0
  134. package/dist/ir/scalar-records.test.js.map +1 -0
  135. package/dist/ir/validate.js +92 -8
  136. package/dist/ir/validate.js.map +1 -1
  137. package/dist/ir/validate.test.d.ts +1 -0
  138. package/dist/ir/validate.test.js +31 -0
  139. package/dist/ir/validate.test.js.map +1 -0
  140. package/dist/library/cache-primitives.d.ts +1 -1
  141. package/dist/library/cache-primitives.js +3 -3
  142. package/dist/library/cache-primitives.js.map +1 -1
  143. package/dist/library/fence-eval.js +11 -4
  144. package/dist/library/fence-eval.js.map +1 -1
  145. package/dist/library/library-cache.js +0 -1
  146. package/dist/library/library-cache.js.map +1 -1
  147. package/dist/library/library-cache.test.js +3 -3
  148. package/dist/library/library-cache.test.js.map +1 -1
  149. package/package.json +17 -17
  150. package/surface-manifest.json +55 -42
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "compilerVersion": "0.1.4",
3
+ "compilerVersion": "0.1.5",
4
4
  "coverage": [
5
5
  "Entries are projected mechanically from the compiler's own decision tables: the diagnostics registry, the unsupported-syntax dispatch tables, the stdlib and node-builtin lowering tables, and the supported-builtin-module list. Nothing is hand-maintained; the manifest regenerates byte-identically from the source tree at this version.",
6
6
  "Absence from this manifest means 'not projected', never 'unsupported'. Surfaces lowered through dedicated code paths rather than tables are not yet projected: console, JSON, Promise/async and the timer surface, the net/http/tls/https/dgram/dns/assert/test/stream/readline module member surfaces, template literals, the regex slice, global functions (parseInt, parseFloat, isNaN, isFinite), and the process surface outside its ambient slice.",
@@ -1123,6 +1123,13 @@
1123
1123
  "status": "static",
1124
1124
  "note": "recognized module (bare and node:-prefixed specifiers)"
1125
1125
  },
1126
+ {
1127
+ "id": "node-builtin.http.maxHeaderSize",
1128
+ "kind": "node-builtin",
1129
+ "name": "http.maxHeaderSize",
1130
+ "status": "static",
1131
+ "note": "constant value read"
1132
+ },
1126
1133
  {
1127
1134
  "id": "node-builtin.http2",
1128
1135
  "kind": "node-builtin",
@@ -2175,6 +2182,12 @@
2175
2182
  "name": "Array.prototype.join",
2176
2183
  "status": "static"
2177
2184
  },
2185
+ {
2186
+ "id": "stdlib.array.lastIndexOf",
2187
+ "kind": "stdlib",
2188
+ "name": "Array.prototype.lastIndexOf",
2189
+ "status": "static"
2190
+ },
2178
2191
  {
2179
2192
  "id": "stdlib.array.map",
2180
2193
  "kind": "stdlib",
@@ -2683,36 +2696,36 @@
2683
2696
  "id": "stdlib.math.acos",
2684
2697
  "kind": "stdlib",
2685
2698
  "name": "Math.acos",
2686
- "status": "dynamic-only",
2687
- "code": "SC2012"
2699
+ "status": "static",
2700
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2688
2701
  },
2689
2702
  {
2690
2703
  "id": "stdlib.math.asin",
2691
2704
  "kind": "stdlib",
2692
2705
  "name": "Math.asin",
2693
- "status": "dynamic-only",
2694
- "code": "SC2012"
2706
+ "status": "static",
2707
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2695
2708
  },
2696
2709
  {
2697
2710
  "id": "stdlib.math.atan",
2698
2711
  "kind": "stdlib",
2699
2712
  "name": "Math.atan",
2700
- "status": "dynamic-only",
2701
- "code": "SC2012"
2713
+ "status": "static",
2714
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2702
2715
  },
2703
2716
  {
2704
2717
  "id": "stdlib.math.atan2",
2705
2718
  "kind": "stdlib",
2706
2719
  "name": "Math.atan2",
2707
- "status": "dynamic-only",
2708
- "code": "SC2012"
2720
+ "status": "static",
2721
+ "note": "compiles statically at arity 2; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2709
2722
  },
2710
2723
  {
2711
2724
  "id": "stdlib.math.cbrt",
2712
2725
  "kind": "stdlib",
2713
2726
  "name": "Math.cbrt",
2714
- "status": "dynamic-only",
2715
- "code": "SC2012"
2727
+ "status": "static",
2728
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2716
2729
  },
2717
2730
  {
2718
2731
  "id": "stdlib.math.ceil",
@@ -2725,15 +2738,15 @@
2725
2738
  "id": "stdlib.math.cos",
2726
2739
  "kind": "stdlib",
2727
2740
  "name": "Math.cos",
2728
- "status": "dynamic-only",
2729
- "code": "SC2012"
2741
+ "status": "static",
2742
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2730
2743
  },
2731
2744
  {
2732
2745
  "id": "stdlib.math.exp",
2733
2746
  "kind": "stdlib",
2734
2747
  "name": "Math.exp",
2735
- "status": "dynamic-only",
2736
- "code": "SC2012"
2748
+ "status": "static",
2749
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2737
2750
  },
2738
2751
  {
2739
2752
  "id": "stdlib.math.floor",
@@ -2746,29 +2759,29 @@
2746
2759
  "id": "stdlib.math.hypot",
2747
2760
  "kind": "stdlib",
2748
2761
  "name": "Math.hypot",
2749
- "status": "dynamic-only",
2750
- "code": "SC2012"
2762
+ "status": "static",
2763
+ "note": "compiles statically at any arity, including number[] spreads"
2751
2764
  },
2752
2765
  {
2753
2766
  "id": "stdlib.math.log",
2754
2767
  "kind": "stdlib",
2755
2768
  "name": "Math.log",
2756
- "status": "dynamic-only",
2757
- "code": "SC2012"
2769
+ "status": "static",
2770
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2758
2771
  },
2759
2772
  {
2760
2773
  "id": "stdlib.math.log10",
2761
2774
  "kind": "stdlib",
2762
2775
  "name": "Math.log10",
2763
- "status": "dynamic-only",
2764
- "code": "SC2012"
2776
+ "status": "static",
2777
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2765
2778
  },
2766
2779
  {
2767
2780
  "id": "stdlib.math.log2",
2768
2781
  "kind": "stdlib",
2769
2782
  "name": "Math.log2",
2770
- "status": "dynamic-only",
2771
- "code": "SC2012"
2783
+ "status": "static",
2784
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2772
2785
  },
2773
2786
  {
2774
2787
  "id": "stdlib.math.max",
@@ -2788,8 +2801,8 @@
2788
2801
  "id": "stdlib.math.pow",
2789
2802
  "kind": "stdlib",
2790
2803
  "name": "Math.pow",
2791
- "status": "dynamic-only",
2792
- "code": "SC2012"
2804
+ "status": "static",
2805
+ "note": "compiles statically at arity 2; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2793
2806
  },
2794
2807
  {
2795
2808
  "id": "stdlib.math.random",
@@ -2809,29 +2822,29 @@
2809
2822
  "id": "stdlib.math.sign",
2810
2823
  "kind": "stdlib",
2811
2824
  "name": "Math.sign",
2812
- "status": "dynamic-only",
2813
- "code": "SC2012"
2825
+ "status": "static",
2826
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2814
2827
  },
2815
2828
  {
2816
2829
  "id": "stdlib.math.sin",
2817
2830
  "kind": "stdlib",
2818
2831
  "name": "Math.sin",
2819
- "status": "dynamic-only",
2820
- "code": "SC2012"
2832
+ "status": "static",
2833
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2821
2834
  },
2822
2835
  {
2823
2836
  "id": "stdlib.math.sqrt",
2824
2837
  "kind": "stdlib",
2825
2838
  "name": "Math.sqrt",
2826
- "status": "dynamic-only",
2827
- "code": "SC2012"
2839
+ "status": "static",
2840
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2828
2841
  },
2829
2842
  {
2830
2843
  "id": "stdlib.math.tan",
2831
2844
  "kind": "stdlib",
2832
2845
  "name": "Math.tan",
2833
- "status": "dynamic-only",
2834
- "code": "SC2012"
2846
+ "status": "static",
2847
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
2835
2848
  },
2836
2849
  {
2837
2850
  "id": "stdlib.math.trunc",
@@ -3484,35 +3497,35 @@
3484
3497
  "kind": "stdlib",
3485
3498
  "name": "string.prototype.charAt",
3486
3499
  "status": "static",
3487
- "note": "the lowered call form takes exactly 1 argument"
3500
+ "note": "the lowered call form takes 0 to 1 arguments"
3488
3501
  },
3489
3502
  {
3490
3503
  "id": "stdlib.string.charCodeAt",
3491
3504
  "kind": "stdlib",
3492
3505
  "name": "string.prototype.charCodeAt",
3493
3506
  "status": "static",
3494
- "note": "the lowered call form takes exactly 1 argument"
3507
+ "note": "the lowered call form takes 0 to 1 arguments"
3495
3508
  },
3496
3509
  {
3497
3510
  "id": "stdlib.string.endsWith",
3498
3511
  "kind": "stdlib",
3499
3512
  "name": "string.prototype.endsWith",
3500
3513
  "status": "static",
3501
- "note": "the lowered call form takes exactly 1 argument"
3514
+ "note": "the lowered call form takes 0 to 2 arguments"
3502
3515
  },
3503
3516
  {
3504
3517
  "id": "stdlib.string.includes",
3505
3518
  "kind": "stdlib",
3506
3519
  "name": "string.prototype.includes",
3507
3520
  "status": "static",
3508
- "note": "the lowered call form takes 1 to 2 arguments"
3521
+ "note": "the lowered call form takes 0 to 2 arguments"
3509
3522
  },
3510
3523
  {
3511
3524
  "id": "stdlib.string.indexOf",
3512
3525
  "kind": "stdlib",
3513
3526
  "name": "string.prototype.indexOf",
3514
3527
  "status": "static",
3515
- "note": "the lowered call form takes 1 to 2 arguments"
3528
+ "note": "the lowered call form takes 0 to 2 arguments"
3516
3529
  },
3517
3530
  {
3518
3531
  "id": "stdlib.string.isWellFormed",
@@ -3526,14 +3539,14 @@
3526
3539
  "kind": "stdlib",
3527
3540
  "name": "string.prototype.padEnd",
3528
3541
  "status": "static",
3529
- "note": "the lowered call form takes 1 to 2 arguments"
3542
+ "note": "the lowered call form takes 0 to 2 arguments"
3530
3543
  },
3531
3544
  {
3532
3545
  "id": "stdlib.string.padStart",
3533
3546
  "kind": "stdlib",
3534
3547
  "name": "string.prototype.padStart",
3535
3548
  "status": "static",
3536
- "note": "the lowered call form takes 1 to 2 arguments"
3549
+ "note": "the lowered call form takes 0 to 2 arguments"
3537
3550
  },
3538
3551
  {
3539
3552
  "id": "stdlib.string.repeat",
@@ -3575,14 +3588,14 @@
3575
3588
  "kind": "stdlib",
3576
3589
  "name": "string.prototype.startsWith",
3577
3590
  "status": "static",
3578
- "note": "the lowered call form takes exactly 1 argument"
3591
+ "note": "the lowered call form takes 0 to 2 arguments"
3579
3592
  },
3580
3593
  {
3581
3594
  "id": "stdlib.string.substring",
3582
3595
  "kind": "stdlib",
3583
3596
  "name": "string.prototype.substring",
3584
3597
  "status": "static",
3585
- "note": "the lowered call form takes 1 to 2 arguments"
3598
+ "note": "the lowered call form takes 0 to 2 arguments"
3586
3599
  },
3587
3600
  {
3588
3601
  "id": "stdlib.string.toLowerCase",