@scriptc/compiler 0.0.4 → 0.0.6

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 (74) hide show
  1. package/dist/backend/cc.d.ts +16 -0
  2. package/dist/backend/cc.js +88 -0
  3. package/dist/backend/cc.js.map +1 -1
  4. package/dist/backend/emission/emit-async.js +2 -2
  5. package/dist/backend/emission/emit-async.js.map +1 -1
  6. package/dist/backend/emission/emit-exprs.js +27 -4
  7. package/dist/backend/emission/emit-exprs.js.map +1 -1
  8. package/dist/backend/emission/emit-shapes.js +2 -2
  9. package/dist/backend/emission/emit-shapes.js.map +1 -1
  10. package/dist/backend/emission/emit-walkers.js +54 -8
  11. package/dist/backend/emission/emit-walkers.js.map +1 -1
  12. package/dist/backend/emission/emitter.d.ts +1 -0
  13. package/dist/backend/emission/emitter.js +108 -0
  14. package/dist/backend/emission/emitter.js.map +1 -1
  15. package/dist/backend/emission/may-throw.js +12 -0
  16. package/dist/backend/emission/may-throw.js.map +1 -1
  17. package/dist/backend/llvm/dyn.js +23 -1
  18. package/dist/backend/llvm/dyn.js.map +1 -1
  19. package/dist/backend/llvm/emitter.js +150 -6
  20. package/dist/backend/llvm/emitter.js.map +1 -1
  21. package/dist/backend/llvm/walkers.d.ts +5 -0
  22. package/dist/backend/llvm/walkers.js +65 -5
  23. package/dist/backend/llvm/walkers.js.map +1 -1
  24. package/dist/diagnostics/diagnostic.d.ts +25 -0
  25. package/dist/diagnostics/diagnostic.js +86 -0
  26. package/dist/diagnostics/diagnostic.js.map +1 -1
  27. package/dist/frontend/lib-exports.d.ts +16 -0
  28. package/dist/frontend/lib-exports.js +35 -0
  29. package/dist/frontend/lib-exports.js.map +1 -0
  30. package/dist/frontend/lowering/lower-assert.js +41 -1
  31. package/dist/frontend/lowering/lower-assert.js.map +1 -1
  32. package/dist/frontend/lowering/lower-calls.js +2 -2
  33. package/dist/frontend/lowering/lower-calls.js.map +1 -1
  34. package/dist/frontend/lowering/lower-classes.js +1 -1
  35. package/dist/frontend/lowering/lower-classes.js.map +1 -1
  36. package/dist/frontend/lowering/lower-exprs.js +1 -1
  37. package/dist/frontend/lowering/lower-exprs.js.map +1 -1
  38. package/dist/frontend/lowering/lower-inspect.d.ts +7 -0
  39. package/dist/frontend/lowering/lower-inspect.js +130 -28
  40. package/dist/frontend/lowering/lower-inspect.js.map +1 -1
  41. package/dist/frontend/lowering/lower-island.js +1 -1
  42. package/dist/frontend/lowering/lower-island.js.map +1 -1
  43. package/dist/frontend/lowering/lower-mixins.js +4 -2
  44. package/dist/frontend/lowering/lower-mixins.js.map +1 -1
  45. package/dist/frontend/lowering/lower-stmts.js +107 -0
  46. package/dist/frontend/lowering/lower-stmts.js.map +1 -1
  47. package/dist/frontend/lowering/lowerer.d.ts +16 -2
  48. package/dist/frontend/lowering/lowerer.js +64 -15
  49. package/dist/frontend/lowering/lowerer.js.map +1 -1
  50. package/dist/frontend/npm-static-rewrite.d.ts +3 -0
  51. package/dist/frontend/npm-static-rewrite.js +677 -0
  52. package/dist/frontend/npm-static-rewrite.js.map +1 -0
  53. package/dist/frontend/npm-static.d.ts +8 -1
  54. package/dist/frontend/npm-static.js +159 -18
  55. package/dist/frontend/npm-static.js.map +1 -1
  56. package/dist/frontend/program.d.ts +6 -0
  57. package/dist/frontend/program.js +51 -14
  58. package/dist/frontend/program.js.map +1 -1
  59. package/dist/frontend/types.d.ts +68 -6
  60. package/dist/frontend/types.js +285 -57
  61. package/dist/frontend/types.js.map +1 -1
  62. package/dist/index.d.ts +22 -0
  63. package/dist/index.js +253 -17
  64. package/dist/index.js.map +1 -1
  65. package/dist/ir/nodes.d.ts +50 -4
  66. package/dist/ir/nodes.js +179 -13
  67. package/dist/ir/nodes.js.map +1 -1
  68. package/dist/ir/validate.js +61 -0
  69. package/dist/ir/validate.js.map +1 -1
  70. package/dist/library/profile.d.ts +52 -0
  71. package/dist/library/profile.js +232 -0
  72. package/dist/library/profile.js.map +1 -0
  73. package/package.json +2 -2
  74. package/surface-manifest.json +1 -1
@@ -0,0 +1,52 @@
1
+ import { type ScrDiagnostic } from "../diagnostics/diagnostic.js";
2
+ /** Marshalling classes legal in PARAMETER position (v1). */
3
+ export declare const LIB_PARAM_CLASSES: readonly ["f64", "bool", "string", "bytes", "u8", "u32", "i32"];
4
+ /** Marshalling classes legal in RETURN position (v1): the value classes
5
+ * plus void; the integer plumbing classes are param-only until ask 4. */
6
+ export declare const LIB_RETURN_CLASSES: readonly ["f64", "bool", "string", "bytes", "void"];
7
+ export type LibParamClass = (typeof LIB_PARAM_CLASSES)[number];
8
+ export type LibReturnClass = (typeof LIB_RETURN_CLASSES)[number];
9
+ export interface LibraryExportEntry {
10
+ /** The entry module's export name. */
11
+ export: string;
12
+ /** The external C symbol the wrapper is emitted under. */
13
+ symbol: string;
14
+ params: LibParamClass[];
15
+ returns: LibReturnClass;
16
+ }
17
+ export interface LibraryProfile {
18
+ profileFormat: 1;
19
+ name: string;
20
+ /** Resolved absolute path of the ONE entry module. */
21
+ entry: string;
22
+ /** The pinned emission — no fallback concept exists on the library path. */
23
+ emission: "llvm" | "c";
24
+ prefix: string;
25
+ initSymbol: string;
26
+ sinkRegisterSymbol: string;
27
+ /** Session ruling 2's mode-provided collect entry (delegates to the
28
+ * runtime cycle collector; snapshot-invariant, arena-resetting). Null =
29
+ * the profile declares none. */
30
+ collectSymbol: string | null;
31
+ /** §4.3: declared → results accumulate until the host calls it; null →
32
+ * every entry prologue resets the result arena. */
33
+ resultResetSymbol: string | null;
34
+ exports: LibraryExportEntry[];
35
+ /** Profile-supplied teaching text appended to refusals (the ratified
36
+ * SC4004/SC4005 rider): keyed by diagnostic code ("SC4005"), with
37
+ * "async" accepted as the shared key for both async-surface codes. */
38
+ teachings: Readonly<Record<string, string>>;
39
+ }
40
+ /** Parse + validate a profile file. Returns the profile or the SC4001
41
+ * diagnostics (one per problem found before parsing had to stop). */
42
+ export declare function loadLibraryProfile(profilePath: string): {
43
+ ok: true;
44
+ profile: LibraryProfile;
45
+ } | {
46
+ ok: false;
47
+ diagnostics: ScrDiagnostic[];
48
+ };
49
+ /** The profile's teaching text for one refusal code (the ratified rider:
50
+ * SC4004/SC4005 carry profile-supplied guidance naming the embedder's
51
+ * sanctioned alternative). Falls back to the shared "async" key. */
52
+ export declare function profileTeaching(profile: LibraryProfile, code: string): string | undefined;
@@ -0,0 +1,232 @@
1
+ /* Library-mode profile: the published configuration file an embedder ships to
2
+ * name its ABI (symbol prefix, entry module, export map with per-param/
3
+ * return marshalling classes, and the mode-provided symbol names). The
4
+ * profile is configuration, not code — scriptc knows nothing about any
5
+ * particular embedder; a second embedder writes its own profile against the
6
+ * same mode. Every validation failure is SC4001 with the offending JSON
7
+ * path named (the design's "profile malformed" family: parse errors,
8
+ * meaning-changing unknown fields, prefix violations, duplicate symbols,
9
+ * bad C identifiers).
10
+ *
11
+ * Ratified shape (the ratified library-mode design §5.1 + the ABI ratification session):
12
+ * {
13
+ * "profile_format": 1,
14
+ * "name": "<embedder identity string>",
15
+ * "entry": "src/lib.ts", // ONE module, profile-relative
16
+ * "emission": "llvm" | "c", // pins the emission; no fallback
17
+ * "abi": {
18
+ * "prefix": "<prefix>_",
19
+ * "init_symbol": "<prefix>_init",
20
+ * "sink_register_symbol": "<prefix>_set_panic_sink",
21
+ * "collect_symbol": "<prefix>_collect" | null, // session ruling 2
22
+ * "result_reset_symbol": "<prefix>_reset" | null // §4.3 two postures
23
+ * },
24
+ * "exports": [ { "export": "update", "symbol": "<prefix>_update",
25
+ * "params": ["f64", "string"], "returns": "bytes" } ],
26
+ * "determinism": { ... } // ask-5 surface, reserved;
27
+ * // only `teachings` is read
28
+ * // today (the SC4004/SC4005
29
+ * // teaching rider)
30
+ * }
31
+ *
32
+ * Marshalling classes (design §4.2 + session ruling 3): f64, bool, string,
33
+ * bytes for params and returns; u8/u32/i32 are PARAM-ONLY plumbing classes
34
+ * in v1 (outbound integer returns wait for ask-4's prove-or-refuse
35
+ * machinery); void is return-only. Unknown top-level fields are ignored
36
+ * (reserved surface: determinism, identity/version echo); unknown fields
37
+ * INSIDE `abi` and export entries are refused — a typo there silently
38
+ * changes meaning. */
39
+ import { readFileSync } from "node:fs";
40
+ import { dirname, isAbsolute, resolve } from "node:path";
41
+ import { libProfileDiag } from "../diagnostics/diagnostic.js";
42
+ /** Marshalling classes legal in PARAMETER position (v1). */
43
+ export const LIB_PARAM_CLASSES = ["f64", "bool", "string", "bytes", "u8", "u32", "i32"];
44
+ /** Marshalling classes legal in RETURN position (v1): the value classes
45
+ * plus void; the integer plumbing classes are param-only until ask 4. */
46
+ export const LIB_RETURN_CLASSES = ["f64", "bool", "string", "bytes", "void"];
47
+ const C_IDENT = /^[A-Za-z_][A-Za-z0-9_]*$/;
48
+ class ProfileError extends Error {
49
+ detail;
50
+ constructor(detail) {
51
+ super(detail);
52
+ this.detail = detail;
53
+ }
54
+ }
55
+ function req(v, path, kind) {
56
+ if (typeof v !== kind) {
57
+ throw new ProfileError(`'${path}' must be a ${kind}${v === undefined ? " (missing)" : ""}`);
58
+ }
59
+ return v;
60
+ }
61
+ function symbolField(v, path, prefix, nullable) {
62
+ if (nullable && (v === null || v === undefined))
63
+ return null;
64
+ const s = req(v, path, "string");
65
+ if (!C_IDENT.test(s))
66
+ throw new ProfileError(`'${path}' is not a valid C identifier: '${s}'`);
67
+ if (!s.startsWith(prefix)) {
68
+ throw new ProfileError(`'${path}' must start with the profile prefix '${prefix}': '${s}'`);
69
+ }
70
+ return s;
71
+ }
72
+ function rejectUnknownKeys(obj, path, known) {
73
+ for (const k of Object.keys(obj)) {
74
+ if (!known.includes(k)) {
75
+ throw new ProfileError(`unknown field '${path}.${k}' (a typo here would change the ABI; remove it)`);
76
+ }
77
+ }
78
+ }
79
+ /** Parse + validate a profile file. Returns the profile or the SC4001
80
+ * diagnostics (one per problem found before parsing had to stop). */
81
+ export function loadLibraryProfile(profilePath) {
82
+ const fail = (detail) => ({
83
+ ok: false,
84
+ diagnostics: [libProfileDiag(detail, profilePath)],
85
+ });
86
+ let text;
87
+ try {
88
+ text = readFileSync(profilePath, "utf8");
89
+ }
90
+ catch (e) {
91
+ return fail(`cannot read profile: ${e.message}`);
92
+ }
93
+ let raw;
94
+ try {
95
+ raw = JSON.parse(text);
96
+ }
97
+ catch (e) {
98
+ return fail(`profile is not valid JSON (${e.message})`);
99
+ }
100
+ try {
101
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) {
102
+ throw new ProfileError("profile must be a JSON object");
103
+ }
104
+ const p = raw;
105
+ const format = req(p["profile_format"], "profile_format", "number");
106
+ if (format !== 1)
107
+ throw new ProfileError(`unsupported profile_format ${format} (this scriptc reads format 1)`);
108
+ const name = req(p["name"], "name", "string");
109
+ if (name === "")
110
+ throw new ProfileError("'name' must be a non-empty identity string");
111
+ const entryRel = req(p["entry"], "entry", "string");
112
+ if (entryRel === "")
113
+ throw new ProfileError("'entry' must name the profile's one entry module");
114
+ const emission = req(p["emission"], "emission", "string");
115
+ if (emission !== "llvm" && emission !== "c") {
116
+ throw new ProfileError(`'emission' must be "llvm" or "c", got '${emission}'`);
117
+ }
118
+ const abi = p["abi"];
119
+ if (abi === null || typeof abi !== "object" || Array.isArray(abi)) {
120
+ throw new ProfileError("'abi' must be an object");
121
+ }
122
+ rejectUnknownKeys(abi, "abi", ["prefix", "init_symbol", "sink_register_symbol", "collect_symbol", "result_reset_symbol"]);
123
+ const a = abi;
124
+ const prefix = req(a["prefix"], "abi.prefix", "string");
125
+ if (!C_IDENT.test(prefix)) {
126
+ throw new ProfileError(`'abi.prefix' is not a valid C identifier fragment: '${prefix}'`);
127
+ }
128
+ const initSymbol = symbolField(a["init_symbol"], "abi.init_symbol", prefix, false);
129
+ const sinkRegisterSymbol = symbolField(a["sink_register_symbol"], "abi.sink_register_symbol", prefix, false);
130
+ const collectSymbol = symbolField(a["collect_symbol"], "abi.collect_symbol", prefix, true);
131
+ const resultResetSymbol = symbolField(a["result_reset_symbol"], "abi.result_reset_symbol", prefix, true);
132
+ const exportsRaw = p["exports"];
133
+ if (!Array.isArray(exportsRaw))
134
+ throw new ProfileError("'exports' must be an array");
135
+ const entries = [];
136
+ exportsRaw.forEach((e, i) => {
137
+ const path = `exports[${i}]`;
138
+ if (e === null || typeof e !== "object" || Array.isArray(e)) {
139
+ throw new ProfileError(`'${path}' must be an object`);
140
+ }
141
+ rejectUnknownKeys(e, path, ["export", "symbol", "params", "returns"]);
142
+ const ee = e;
143
+ const exportName = req(ee["export"], `${path}.export`, "string");
144
+ if (exportName === "")
145
+ throw new ProfileError(`'${path}.export' must be a non-empty export name`);
146
+ const symbol = symbolField(ee["symbol"], `${path}.symbol`, prefix, false);
147
+ const paramsRaw = ee["params"];
148
+ if (!Array.isArray(paramsRaw))
149
+ throw new ProfileError(`'${path}.params' must be an array`);
150
+ const params = paramsRaw.map((c, j) => {
151
+ if (typeof c !== "string" || !LIB_PARAM_CLASSES.includes(c)) {
152
+ throw new ProfileError(`'${path}.params[${j}]' must be one of ${LIB_PARAM_CLASSES.join("/")}, got ${JSON.stringify(c)}`);
153
+ }
154
+ return c;
155
+ });
156
+ const returns = req(ee["returns"], `${path}.returns`, "string");
157
+ if (!LIB_RETURN_CLASSES.includes(returns)) {
158
+ const detail = returns === "u8" || returns === "u32" || returns === "i32"
159
+ ? `'${path}.returns': integer classes are parameter-only in v1 — outbound integer returns wait for the prove-or-refuse machinery (ask 4); return f64 and convert on the host side`
160
+ : `'${path}.returns' must be one of ${LIB_RETURN_CLASSES.join("/")}, got '${returns}'`;
161
+ throw new ProfileError(detail);
162
+ }
163
+ entries.push({ export: exportName, symbol, params, returns: returns });
164
+ });
165
+ // Pairwise-distinct symbols across the whole declared set (exports +
166
+ // the mode-provided entries).
167
+ const all = new Map();
168
+ const claim = (sym, path) => {
169
+ if (sym === null)
170
+ return;
171
+ const prev = all.get(sym);
172
+ if (prev !== undefined) {
173
+ throw new ProfileError(`symbol '${sym}' is declared twice (${prev} and ${path}); symbols must be pairwise distinct`);
174
+ }
175
+ all.set(sym, path);
176
+ };
177
+ claim(initSymbol, "abi.init_symbol");
178
+ claim(sinkRegisterSymbol, "abi.sink_register_symbol");
179
+ claim(collectSymbol, "abi.collect_symbol");
180
+ claim(resultResetSymbol, "abi.result_reset_symbol");
181
+ entries.forEach((e, i) => claim(e.symbol, `exports[${i}].symbol`));
182
+ const exportNames = new Set();
183
+ entries.forEach((e, i) => {
184
+ if (exportNames.has(e.export)) {
185
+ throw new ProfileError(`export '${e.export}' is mapped twice (exports[${i}])`);
186
+ }
187
+ exportNames.add(e.export);
188
+ });
189
+ // Ask-5 surface: only the teachings rider is read today; everything
190
+ // else under `determinism` is reserved and ignored.
191
+ const teachings = {};
192
+ const det = p["determinism"];
193
+ if (det !== undefined && det !== null && typeof det === "object" && !Array.isArray(det)) {
194
+ const t = det["teachings"];
195
+ if (t !== undefined && t !== null && typeof t === "object" && !Array.isArray(t)) {
196
+ for (const [k, v] of Object.entries(t)) {
197
+ if (typeof v === "string")
198
+ teachings[k] = v;
199
+ }
200
+ }
201
+ }
202
+ const entry = isAbsolute(entryRel) ? entryRel : resolve(dirname(profilePath), entryRel);
203
+ return {
204
+ ok: true,
205
+ profile: {
206
+ profileFormat: 1,
207
+ name,
208
+ entry,
209
+ emission,
210
+ prefix,
211
+ initSymbol,
212
+ sinkRegisterSymbol,
213
+ collectSymbol,
214
+ resultResetSymbol,
215
+ exports: entries,
216
+ teachings,
217
+ },
218
+ };
219
+ }
220
+ catch (e) {
221
+ if (e instanceof ProfileError)
222
+ return fail(e.detail);
223
+ throw e;
224
+ }
225
+ }
226
+ /** The profile's teaching text for one refusal code (the ratified rider:
227
+ * SC4004/SC4005 carry profile-supplied guidance naming the embedder's
228
+ * sanctioned alternative). Falls back to the shared "async" key. */
229
+ export function profileTeaching(profile, code) {
230
+ return profile.teachings[code] ?? (code === "SC4004" || code === "SC4005" ? profile.teachings["async"] : undefined);
231
+ }
232
+ //# sourceMappingURL=profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prof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E,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,CAA4B,CAAC,EAAE,CAAC;oBAClE,IAAI,OAAO,CAAC,KAAK,QAAQ;wBAAE,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;gBAC9C,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,KAAK,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,QAAQ,CAAC,CAAC;QACxF,OAAO;YACL,EAAE,EAAE,IAAI;YACR,OAAO,EAAE;gBACP,aAAa,EAAE,CAAC;gBAChB,IAAI;gBACJ,KAAK;gBACL,QAAQ;gBACR,MAAM;gBACN,UAAU;gBACV,kBAAkB;gBAClB,aAAa;gBACb,iBAAiB;gBACjB,OAAO,EAAE,OAAO;gBAChB,SAAS;aACV;SACF,CAAC;IACJ,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,YAAY,YAAY;YAAE,OAAO,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QACrD,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC;AAED;;oEAEoE;AACpE,MAAM,UAAU,eAAe,CAAC,OAAuB,EAAE,IAAY;IACnE,OAAO,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACtH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scriptc/compiler",
3
- "version": "0.0.4",
3
+ "version": "0.0.6",
4
4
  "description": "The scriptc compiler — TypeScript/JavaScript frontend, typed IR, LLVM and C backends",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://scriptc.dev",
@@ -30,7 +30,7 @@
30
30
  "dependencies": {
31
31
  "typescript": "7.0.2",
32
32
  "typescript5": "npm:typescript@5.9.3",
33
- "@scriptc/runtime": "0.0.4"
33
+ "@scriptc/runtime": "0.0.6"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "node node_modules/typescript5/bin/tsc -p tsconfig.json"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "compilerVersion": "0.0.4",
3
+ "compilerVersion": "0.0.6",
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, 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).",