@scriptc/compiler 0.0.9 → 0.0.11

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 (97) hide show
  1. package/ambient/scriptc-node-fallback.d.ts +54 -9
  2. package/dist/backend/emission/emit-exprs.js +170 -14
  3. package/dist/backend/emission/emit-exprs.js.map +1 -1
  4. package/dist/backend/emission/emit-walkers.js +29 -2
  5. package/dist/backend/emission/emit-walkers.js.map +1 -1
  6. package/dist/backend/emission/emitter.js +25 -1
  7. package/dist/backend/emission/emitter.js.map +1 -1
  8. package/dist/backend/llvm/dyn.d.ts +1 -0
  9. package/dist/backend/llvm/dyn.js +83 -1
  10. package/dist/backend/llvm/dyn.js.map +1 -1
  11. package/dist/backend/llvm/emitter.js +210 -13
  12. package/dist/backend/llvm/emitter.js.map +1 -1
  13. package/dist/coverage/surface-manifest.js +16 -2
  14. package/dist/coverage/surface-manifest.js.map +1 -1
  15. package/dist/diagnostics/diagnostic.d.ts +41 -14
  16. package/dist/diagnostics/diagnostic.js +79 -27
  17. package/dist/diagnostics/diagnostic.js.map +1 -1
  18. package/dist/diagnostics/render.js +8 -0
  19. package/dist/diagnostics/render.js.map +1 -1
  20. package/dist/frontend/lowering/lib-boundary.js +11 -1
  21. package/dist/frontend/lowering/lib-boundary.js.map +1 -1
  22. package/dist/frontend/lowering/lower-builtins.d.ts +69 -0
  23. package/dist/frontend/lowering/lower-builtins.js +380 -4
  24. package/dist/frontend/lowering/lower-builtins.js.map +1 -1
  25. package/dist/frontend/lowering/lower-calls.d.ts +41 -0
  26. package/dist/frontend/lowering/lower-calls.js +559 -11
  27. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  28. package/dist/frontend/lowering/lower-classes.d.ts +7 -0
  29. package/dist/frontend/lowering/lower-classes.js +51 -1
  30. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  31. package/dist/frontend/lowering/lower-containers.d.ts +21 -0
  32. package/dist/frontend/lowering/lower-containers.js +262 -17
  33. package/dist/frontend/lowering/lower-containers.js.map +1 -1
  34. package/dist/frontend/lowering/lower-dgram.js +92 -17
  35. package/dist/frontend/lowering/lower-dgram.js.map +1 -1
  36. package/dist/frontend/lowering/lower-emitter.d.ts +70 -3
  37. package/dist/frontend/lowering/lower-emitter.js +436 -29
  38. package/dist/frontend/lowering/lower-emitter.js.map +1 -1
  39. package/dist/frontend/lowering/lower-exprs.d.ts +80 -5
  40. package/dist/frontend/lowering/lower-exprs.js +651 -23
  41. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  42. package/dist/frontend/lowering/lower-modules.d.ts +8 -5
  43. package/dist/frontend/lowering/lower-modules.js +144 -19
  44. package/dist/frontend/lowering/lower-modules.js.map +1 -1
  45. package/dist/frontend/lowering/lower-namespaces.d.ts +39 -11
  46. package/dist/frontend/lowering/lower-namespaces.js +166 -24
  47. package/dist/frontend/lowering/lower-namespaces.js.map +1 -1
  48. package/dist/frontend/lowering/lower-server.js +211 -4
  49. package/dist/frontend/lowering/lower-server.js.map +1 -1
  50. package/dist/frontend/lowering/lower-stmts.d.ts +1 -5
  51. package/dist/frontend/lowering/lower-stmts.js +293 -10
  52. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  53. package/dist/frontend/lowering/lower-stream.js +178 -10
  54. package/dist/frontend/lowering/lower-stream.js.map +1 -1
  55. package/dist/frontend/lowering/lowerer.d.ts +53 -1
  56. package/dist/frontend/lowering/lowerer.js +210 -19
  57. package/dist/frontend/lowering/lowerer.js.map +1 -1
  58. package/dist/frontend/lowering/surfaces.d.ts +44 -0
  59. package/dist/frontend/lowering/surfaces.js +234 -3
  60. package/dist/frontend/lowering/surfaces.js.map +1 -1
  61. package/dist/frontend/npm.d.ts +12 -0
  62. package/dist/frontend/npm.js +30 -0
  63. package/dist/frontend/npm.js.map +1 -1
  64. package/dist/frontend/program.d.ts +25 -0
  65. package/dist/frontend/program.js +144 -135
  66. package/dist/frontend/program.js.map +1 -1
  67. package/dist/frontend/shared.d.ts +1 -1
  68. package/dist/frontend/shared.js +1 -1
  69. package/dist/frontend/shared.js.map +1 -1
  70. package/dist/frontend/types.d.ts +13 -0
  71. package/dist/frontend/types.js +84 -7
  72. package/dist/frontend/types.js.map +1 -1
  73. package/dist/index.d.ts +2 -1
  74. package/dist/index.js +157 -12
  75. package/dist/index.js.map +1 -1
  76. package/dist/ir/nodes.d.ts +163 -13
  77. package/dist/ir/nodes.js +65 -6
  78. package/dist/ir/nodes.js.map +1 -1
  79. package/dist/ir/validate.js +64 -5
  80. package/dist/ir/validate.js.map +1 -1
  81. package/dist/library/fence-eval.d.ts +77 -0
  82. package/dist/library/fence-eval.js +395 -0
  83. package/dist/library/fence-eval.js.map +1 -0
  84. package/dist/library/int-infer.d.ts +119 -0
  85. package/dist/library/int-infer.js +1301 -0
  86. package/dist/library/int-infer.js.map +1 -0
  87. package/dist/library/int-infer.test.d.ts +1 -0
  88. package/dist/library/int-infer.test.js +279 -0
  89. package/dist/library/int-infer.test.js.map +1 -0
  90. package/dist/library/profile.d.ts +43 -6
  91. package/dist/library/profile.js +179 -31
  92. package/dist/library/profile.js.map +1 -1
  93. package/dist/library/sidecar.d.ts +23 -0
  94. package/dist/library/sidecar.js +150 -16
  95. package/dist/library/sidecar.js.map +1 -1
  96. package/package.json +2 -2
  97. package/surface-manifest.json +208 -10
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "compilerVersion": "0.0.9",
3
+ "compilerVersion": "0.0.11",
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
- "Absence from this manifest means 'not projected', never 'unsupported'. Surfaces lowered through dedicated code paths rather than tables are not yet projected: console, JSON, process, 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, and global functions (parseInt, parseFloat, isNaN, isFinite).",
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.",
7
+ "The ambient-nondeterminism and ambient-authority surfaces the library sidecar's determinism attestation scans ARE projected even where they lower through dedicated code paths — the Date compositions (stdlib.date.*), perf_hooks' performance.now, and the process global's ambient reads and authority calls (node-builtin.process.*) — so a determinism fence can name every surface the attestation demotes on.",
7
8
  "stdlib and node-builtin member entries name surface whose LOWERED call forms are constrained (arity, argument shapes); declared call forms outside the lowered set are refused per site, with code SC2020 for standard-library and node-builtin surface.",
8
9
  "Entries with status 'unsupported' or 'dynamic-only' describe where the named code is raised: forms of the construct outside the supported subset are refused with that code — not that every form of the named feature is refused. Supported forms appear as their own static entries where a table projects them.",
9
10
  "Entries with status 'dynamic-only' compile when the build embeds the dynamic engine (--dynamic); without the flag each use site is refused with the entry's code.",
@@ -17,7 +18,7 @@
17
18
  "name": "package imports",
18
19
  "status": "unsupported",
19
20
  "code": "SC1010",
20
- "note": "relative imports (./file, ../dir/file), package.json-mediated project imports (#alias via the imports field, self-name references via exports), installed npm packages (their code runs under --dynamic), and the built-in fs, fs/promises, path, os, url, crypto, zlib, child_process, net, http, tls, https, http2, dgram, dns, util, util/types, string_decoder, querystring, readline, events, stream, stream/promises, buffer, assert, assert/strict, worker_threads, cluster, tty, async_hooks, timers, timers/promises, diagnostics_channel, perf_hooks, and node:test and node:module modules (bare or node:-prefixed) are supported"
21
+ "note": "relative imports (./file, ../dir/file), package.json-mediated project imports (#alias via the imports field, self-name references via exports), installed npm packages (their code runs under --dynamic), and the built-in fs, fs/promises, path, os, url, crypto, zlib, child_process, net, http, tls, https, http2, dgram, dns, util, util/types, string_decoder, querystring, readline, events, stream, stream/promises, stream/consumers, buffer, assert, assert/strict, worker_threads, cluster, tty, async_hooks, timers, timers/promises, diagnostics_channel, perf_hooks, and node:test and node:module modules (bare or node:-prefixed) are supported"
21
22
  },
22
23
  {
23
24
  "id": "diagnostic.sc1012",
@@ -54,7 +55,8 @@
54
55
  "kind": "diagnostic-fence",
55
56
  "name": "circular imports",
56
57
  "status": "unsupported",
57
- "code": "SC1016"
58
+ "code": "SC1016",
59
+ "note": "cycles of ES modules with declaration-only top levels whose cycle-crossing bindings are only used inside function bodies compile as-is; move the named top-level read or call into a function body (or break the named edge) so nothing runs during the cycle's init window"
58
60
  },
59
61
  {
60
62
  "id": "diagnostic.sc1020",
@@ -188,7 +190,7 @@
188
190
  "name": "this regex feature",
189
191
  "status": "unsupported",
190
192
  "code": "SC1120",
191
- "note": "supported: literal regexes with the g/i/m/s/u/y flags — .test(), .source/.flags, and string replace/replaceAll/split with string replacement templates"
193
+ "note": "supported: literal regexes with the g/i/m/s/u/y flags — .test(), .exec()/.match()/.matchAll(), named capture groups (.groups, $<name> templates, \\k<name>), .source/.flags, and string replace/replaceAll/split with string replacement templates"
192
194
  },
193
195
  {
194
196
  "id": "diagnostic.sc1121",
@@ -833,7 +835,23 @@
833
835
  "name": "module.createRequire",
834
836
  "status": "unsupported",
835
837
  "code": "SC2020",
836
- "note": "createRequire loads CommonJS from disk at RUNTIME (the config/plugin-loading pattern) — a compiled program's modules are fixed at build time, so no lowering can exist; in JS sources the call defers to a runtime error naming this pattern"
838
+ "note": "the lowered shape is a const binding over createRequire(import.meta.url) (or __filename) whose require calls take STATIC string literals — builtins, relative .json documents, and installed npm packages (under --dynamic) resolve at build time; dynamic specifiers cannot exist in a compiled binary's fixed module graph"
839
+ },
840
+ {
841
+ "id": "node-builtin.module.isBuiltin",
842
+ "kind": "node-builtin",
843
+ "name": "module.isBuiltin",
844
+ "status": "unsupported",
845
+ "code": "SC2020",
846
+ "note": "builtinModules.includes(name) answers the same question over the baked list (strip a node: prefix first; the prefix-only builtins appear with it, as node:test)"
847
+ },
848
+ {
849
+ "id": "node-builtin.module.syncBuiltinESMExports",
850
+ "kind": "node-builtin",
851
+ "name": "module.syncBuiltinESMExports",
852
+ "status": "unsupported",
853
+ "code": "SC2020",
854
+ "note": "a compiled program has no live builtin ESM namespace bindings to synchronize — nothing a compiled surface can mutate makes the call observable; remove it"
837
855
  },
838
856
  {
839
857
  "id": "node-builtin.net",
@@ -1148,6 +1166,135 @@
1148
1166
  "status": "static",
1149
1167
  "note": "recognized module (bare and node:-prefixed specifiers)"
1150
1168
  },
1169
+ {
1170
+ "id": "node-builtin.perf_hooks.performance.now",
1171
+ "kind": "node-builtin",
1172
+ "name": "perf_hooks.performance.now",
1173
+ "status": "static",
1174
+ "note": "the global performance object and the performance.now.bind(performance) function value reach the same clock"
1175
+ },
1176
+ {
1177
+ "id": "node-builtin.process.argv",
1178
+ "kind": "node-builtin",
1179
+ "name": "process.argv",
1180
+ "status": "static"
1181
+ },
1182
+ {
1183
+ "id": "node-builtin.process.availableMemory",
1184
+ "kind": "node-builtin",
1185
+ "name": "process.availableMemory",
1186
+ "status": "static"
1187
+ },
1188
+ {
1189
+ "id": "node-builtin.process.chdir",
1190
+ "kind": "node-builtin",
1191
+ "name": "process.chdir",
1192
+ "status": "static"
1193
+ },
1194
+ {
1195
+ "id": "node-builtin.process.columns",
1196
+ "kind": "node-builtin",
1197
+ "name": "process.columns",
1198
+ "status": "static",
1199
+ "note": "the columns read on the process stdio streams (terminal geometry)"
1200
+ },
1201
+ {
1202
+ "id": "node-builtin.process.constrainedMemory",
1203
+ "kind": "node-builtin",
1204
+ "name": "process.constrainedMemory",
1205
+ "status": "static"
1206
+ },
1207
+ {
1208
+ "id": "node-builtin.process.cpuUsage",
1209
+ "kind": "node-builtin",
1210
+ "name": "process.cpuUsage",
1211
+ "status": "static",
1212
+ "note": "the plain-sample and previous-value diff forms are one surface"
1213
+ },
1214
+ {
1215
+ "id": "node-builtin.process.cwd",
1216
+ "kind": "node-builtin",
1217
+ "name": "process.cwd",
1218
+ "status": "static"
1219
+ },
1220
+ {
1221
+ "id": "node-builtin.process.env",
1222
+ "kind": "node-builtin",
1223
+ "name": "process.env",
1224
+ "status": "static",
1225
+ "note": "reads, writes, deletes, and enumeration of the process environment (the process global)"
1226
+ },
1227
+ {
1228
+ "id": "node-builtin.process.execPath",
1229
+ "kind": "node-builtin",
1230
+ "name": "process.execPath",
1231
+ "status": "static"
1232
+ },
1233
+ {
1234
+ "id": "node-builtin.process.exit",
1235
+ "kind": "node-builtin",
1236
+ "name": "process.exit",
1237
+ "status": "static",
1238
+ "note": "process.exit and the process._exiting flag read are one surface"
1239
+ },
1240
+ {
1241
+ "id": "node-builtin.process.getgid",
1242
+ "kind": "node-builtin",
1243
+ "name": "process.getgid",
1244
+ "status": "static"
1245
+ },
1246
+ {
1247
+ "id": "node-builtin.process.getuid",
1248
+ "kind": "node-builtin",
1249
+ "name": "process.getuid",
1250
+ "status": "static"
1251
+ },
1252
+ {
1253
+ "id": "node-builtin.process.isTTY",
1254
+ "kind": "node-builtin",
1255
+ "name": "process.isTTY",
1256
+ "status": "static",
1257
+ "note": "the isTTY read on process.stdin/stdout/stderr — one surface across the three streams"
1258
+ },
1259
+ {
1260
+ "id": "node-builtin.process.kill",
1261
+ "kind": "node-builtin",
1262
+ "name": "process.kill",
1263
+ "status": "static",
1264
+ "note": "the signal-name and signal-number forms are one surface"
1265
+ },
1266
+ {
1267
+ "id": "node-builtin.process.pid",
1268
+ "kind": "node-builtin",
1269
+ "name": "process.pid",
1270
+ "status": "static"
1271
+ },
1272
+ {
1273
+ "id": "node-builtin.process.resourceUsage",
1274
+ "kind": "node-builtin",
1275
+ "name": "process.resourceUsage",
1276
+ "status": "static",
1277
+ "note": "getrusage's 16 fields — every field read samples live machine state"
1278
+ },
1279
+ {
1280
+ "id": "node-builtin.process.threadCpuUsage",
1281
+ "kind": "node-builtin",
1282
+ "name": "process.threadCpuUsage",
1283
+ "status": "static",
1284
+ "note": "the plain-sample and previous-value diff forms are one surface"
1285
+ },
1286
+ {
1287
+ "id": "node-builtin.process.umask",
1288
+ "kind": "node-builtin",
1289
+ "name": "process.umask",
1290
+ "status": "static"
1291
+ },
1292
+ {
1293
+ "id": "node-builtin.process.uptime",
1294
+ "kind": "node-builtin",
1295
+ "name": "process.uptime",
1296
+ "status": "static"
1297
+ },
1151
1298
  {
1152
1299
  "id": "node-builtin.querystring",
1153
1300
  "kind": "node-builtin",
@@ -1211,6 +1358,29 @@
1211
1358
  "status": "static",
1212
1359
  "note": "recognized module (bare and node:-prefixed specifiers)"
1213
1360
  },
1361
+ {
1362
+ "id": "node-builtin.stream.consumers",
1363
+ "kind": "node-builtin",
1364
+ "name": "stream/consumers",
1365
+ "status": "static",
1366
+ "note": "recognized module (bare and node:-prefixed specifiers)"
1367
+ },
1368
+ {
1369
+ "id": "node-builtin.stream.consumers.arrayBuffer",
1370
+ "kind": "node-builtin",
1371
+ "name": "stream/consumers.arrayBuffer",
1372
+ "status": "unsupported",
1373
+ "code": "SC2020",
1374
+ "note": "no free-standing ArrayBuffer value exists here (typed arrays own their storage) — buffer(stream) collects the same bytes as a Buffer"
1375
+ },
1376
+ {
1377
+ "id": "node-builtin.stream.consumers.blob",
1378
+ "kind": "node-builtin",
1379
+ "name": "stream/consumers.blob",
1380
+ "status": "unsupported",
1381
+ "code": "SC2020",
1382
+ "note": "Blob values have no representation in a compiled binary — buffer(stream) collects the same bytes as a Buffer, text(stream) the decoded text"
1383
+ },
1214
1384
  {
1215
1385
  "id": "node-builtin.stream.promises",
1216
1386
  "kind": "node-builtin",
@@ -1529,6 +1699,34 @@
1529
1699
  "name": "Array.prototype.some",
1530
1700
  "status": "static"
1531
1701
  },
1702
+ {
1703
+ "id": "stdlib.date.UTC",
1704
+ "kind": "stdlib",
1705
+ "name": "Date.UTC",
1706
+ "status": "static",
1707
+ "note": "the lowered call form takes 1 to 7 number arguments"
1708
+ },
1709
+ {
1710
+ "id": "stdlib.date.getTime",
1711
+ "kind": "stdlib",
1712
+ "name": "Date.prototype.getTime",
1713
+ "status": "static",
1714
+ "note": "the composed new Date(dateString).getTime() form; new Date().getTime() is stdlib.date.now's surface"
1715
+ },
1716
+ {
1717
+ "id": "stdlib.date.now",
1718
+ "kind": "stdlib",
1719
+ "name": "Date.now",
1720
+ "status": "static",
1721
+ "note": "the live clock; the zero-argument new Date() compositions read it too"
1722
+ },
1723
+ {
1724
+ "id": "stdlib.date.toISOString",
1725
+ "kind": "stdlib",
1726
+ "name": "Date.prototype.toISOString",
1727
+ "status": "static",
1728
+ "note": "the composed new Date(ms?).toISOString() form"
1729
+ },
1532
1730
  {
1533
1731
  "id": "stdlib.map.clear",
1534
1732
  "kind": "stdlib",
@@ -1625,8 +1823,8 @@
1625
1823
  "id": "stdlib.math.ceil",
1626
1824
  "kind": "stdlib",
1627
1825
  "name": "Math.ceil",
1628
- "status": "dynamic-only",
1629
- "code": "SC2012"
1826
+ "status": "static",
1827
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
1630
1828
  },
1631
1829
  {
1632
1830
  "id": "stdlib.math.cos",
@@ -1744,8 +1942,8 @@
1744
1942
  "id": "stdlib.math.trunc",
1745
1943
  "kind": "stdlib",
1746
1944
  "name": "Math.trunc",
1747
- "status": "dynamic-only",
1748
- "code": "SC2012"
1945
+ "status": "static",
1946
+ "note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
1749
1947
  },
1750
1948
  {
1751
1949
  "id": "stdlib.number.toFixed",