@scriptc/compiler 0.1.6 → 0.1.7
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.
- package/ambient/scriptc-node-fallback.d.ts +0 -1
- package/ambient/scriptc.d.ts +13 -5
- package/dist/backend/c/c-emitter.d.ts +5 -0
- package/dist/backend/c/c-emitter.js +15 -0
- package/dist/backend/c/c-emitter.js.map +1 -1
- package/dist/backend/c/exprs.js +45 -1
- package/dist/backend/c/exprs.js.map +1 -1
- package/dist/backend/c/stmts.js +25 -1
- package/dist/backend/c/stmts.js.map +1 -1
- package/dist/backend/c/walkers.js +2 -3
- package/dist/backend/c/walkers.js.map +1 -1
- package/dist/backend/debug-symbols.d.ts +8 -0
- package/dist/backend/debug-symbols.js +52 -0
- package/dist/backend/debug-symbols.js.map +1 -0
- package/dist/backend/link-plan.d.ts +1 -0
- package/dist/backend/link-plan.js +2 -0
- package/dist/backend/link-plan.js.map +1 -1
- package/dist/backend/linker.js +8 -0
- package/dist/backend/linker.js.map +1 -1
- package/dist/backend/llvm/blocks.d.ts +2 -0
- package/dist/backend/llvm/blocks.js +18 -2
- package/dist/backend/llvm/blocks.js.map +1 -1
- package/dist/backend/llvm/debug-info.d.ts +32 -0
- package/dist/backend/llvm/debug-info.js +203 -0
- package/dist/backend/llvm/debug-info.js.map +1 -0
- package/dist/backend/llvm/dyn.js +4 -10
- package/dist/backend/llvm/dyn.js.map +1 -1
- package/dist/backend/llvm/emitter.d.ts +2 -0
- package/dist/backend/llvm/emitter.js +49 -4
- package/dist/backend/llvm/emitter.js.map +1 -1
- package/dist/backend/llvm/expr-dynamic.js +10 -0
- package/dist/backend/llvm/expr-dynamic.js.map +1 -1
- package/dist/backend/llvm/lib-filesystem.js +29 -0
- package/dist/backend/llvm/lib-filesystem.js.map +1 -1
- package/dist/backend/llvm/lib-shared.js +8 -0
- package/dist/backend/llvm/lib-shared.js.map +1 -1
- package/dist/backend/llvm/split.js +4 -1
- package/dist/backend/llvm/split.js.map +1 -1
- package/dist/backend/llvm/split.test.js +26 -1
- package/dist/backend/llvm/split.test.js.map +1 -1
- package/dist/backend/native-toolchain.js +58 -8
- package/dist/backend/native-toolchain.js.map +1 -1
- package/dist/backend/native-toolchain.test.js +10 -0
- package/dist/backend/native-toolchain.test.js.map +1 -1
- package/dist/backend/source-locations.d.ts +12 -0
- package/dist/backend/source-locations.js +32 -0
- package/dist/backend/source-locations.js.map +1 -0
- package/dist/backend/source-locations.test.d.ts +1 -0
- package/dist/backend/source-locations.test.js +16 -0
- package/dist/backend/source-locations.test.js.map +1 -0
- package/dist/diagnostics/diagnostic.d.ts +4 -0
- package/dist/diagnostics/diagnostic.js +12 -0
- package/dist/diagnostics/diagnostic.js.map +1 -1
- package/dist/executable/executable-cache.js +28 -4
- package/dist/executable/executable-cache.js.map +1 -1
- package/dist/executable/executable-cache.test.js +23 -0
- package/dist/executable/executable-cache.test.js.map +1 -1
- package/dist/frontend/arguments-usage.d.ts +6 -0
- package/dist/frontend/arguments-usage.js +40 -0
- package/dist/frontend/arguments-usage.js.map +1 -0
- package/dist/frontend/binding-source.d.ts +4 -0
- package/dist/frontend/binding-source.js +18 -0
- package/dist/frontend/binding-source.js.map +1 -0
- package/dist/frontend/lowering/expressions/object-literals.js +13 -8
- package/dist/frontend/lowering/expressions/object-literals.js.map +1 -1
- package/dist/frontend/lowering/expressions/optional-chains.d.ts +5 -6
- package/dist/frontend/lowering/expressions/optional-chains.js +7 -6
- package/dist/frontend/lowering/expressions/optional-chains.js.map +1 -1
- package/dist/frontend/lowering/lower-builtins.js +15 -4
- package/dist/frontend/lowering/lower-builtins.js.map +1 -1
- package/dist/frontend/lowering/lower-calls.d.ts +2 -9
- package/dist/frontend/lowering/lower-calls.js +140 -30
- package/dist/frontend/lowering/lower-calls.js.map +1 -1
- package/dist/frontend/lowering/lower-exprs.js +116 -16
- package/dist/frontend/lowering/lower-exprs.js.map +1 -1
- package/dist/frontend/lowering/lower-island.d.ts +1 -1
- package/dist/frontend/lowering/lower-island.js +1 -1
- package/dist/frontend/lowering/lower-modules.js +19 -8
- package/dist/frontend/lowering/lower-modules.js.map +1 -1
- package/dist/frontend/lowering/lower-stmts.js +4 -37
- package/dist/frontend/lowering/lower-stmts.js.map +1 -1
- package/dist/frontend/lowering/lowerer.js +14 -3
- package/dist/frontend/lowering/lowerer.js.map +1 -1
- package/dist/frontend/lowering/surfaces.d.ts +1 -1
- package/dist/frontend/lowering/surfaces.js +37 -6
- package/dist/frontend/lowering/surfaces.js.map +1 -1
- package/dist/frontend/program.d.ts +5 -0
- package/dist/frontend/program.js +216 -32
- package/dist/frontend/program.js.map +1 -1
- package/dist/frontend/program.test.d.ts +1 -0
- package/dist/frontend/program.test.js +117 -0
- package/dist/frontend/program.test.js.map +1 -0
- package/dist/frontend/type-mapper.d.ts +4 -2
- package/dist/frontend/type-mapper.js +249 -186
- package/dist/frontend/type-mapper.js.map +1 -1
- package/dist/frontend/type-mapper.test.d.ts +1 -0
- package/dist/frontend/type-mapper.test.js +86 -0
- package/dist/frontend/type-mapper.test.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/dist/ir/analysis.js +4 -2
- package/dist/ir/analysis.js.map +1 -1
- package/dist/ir/ir.d.ts +18 -12
- package/dist/ir/ir.js +3 -1
- package/dist/ir/ir.js.map +1 -1
- package/dist/ir/validate.js +14 -5
- package/dist/ir/validate.js.map +1 -1
- package/dist/library/compiler-self-identity.d.ts +1 -1
- package/dist/library/compiler-self-identity.js +31 -15
- package/dist/library/compiler-self-identity.js.map +1 -1
- package/dist/library/compiler-self-identity.test.d.ts +1 -0
- package/dist/library/compiler-self-identity.test.js +93 -0
- package/dist/library/compiler-self-identity.test.js.map +1 -0
- package/package.json +17 -17
- package/surface-manifest.json +120 -1
|
@@ -19,5 +19,5 @@ export declare function compilerImplementationRoot(): string;
|
|
|
19
19
|
* produced an early frontend artifact. Full compiles hash every byte before
|
|
20
20
|
* publication; the CLI fast path validates the captured inode/time/size
|
|
21
21
|
* metadata and loads the large compiler graph only when anything changed. */
|
|
22
|
-
export declare function compilerImplementationIdentity(captureDependencies?: boolean): Promise<CompilerImplementationIdentity>;
|
|
22
|
+
export declare function compilerImplementationIdentity(captureDependencies?: boolean, implementationRoot?: string): Promise<CompilerImplementationIdentity>;
|
|
23
23
|
export declare function compilerImplementationDependenciesStillMatch(dependencies: readonly CompilerImplementationDependency[]): Promise<boolean>;
|
|
@@ -27,35 +27,51 @@ function dependency(path, info) {
|
|
|
27
27
|
* produced an early frontend artifact. Full compiles hash every byte before
|
|
28
28
|
* publication; the CLI fast path validates the captured inode/time/size
|
|
29
29
|
* metadata and loads the large compiler graph only when anything changed. */
|
|
30
|
-
export async function compilerImplementationIdentity(captureDependencies = true) {
|
|
31
|
-
const
|
|
32
|
-
const files = [];
|
|
30
|
+
export async function compilerImplementationIdentity(captureDependencies = true, implementationRoot = compilerImplementationRoot()) {
|
|
31
|
+
const entries = [];
|
|
33
32
|
const dependencies = [];
|
|
34
33
|
const walk = async (directory) => {
|
|
35
|
-
|
|
36
|
-
if
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
// Capture directories BEFORE enumeration: a new child arriving during
|
|
35
|
+
// the scan must invalidate this proof, even if readdir did not see it.
|
|
36
|
+
entries.push({
|
|
37
|
+
path: directory,
|
|
38
|
+
directory: captureDependencies ? dependency(directory, await lstat(directory)) : null,
|
|
39
|
+
});
|
|
40
|
+
const children = await readdir(directory, { withFileTypes: true });
|
|
41
|
+
children.sort((a, b) => a.name.localeCompare(b.name));
|
|
42
|
+
for (const entry of children) {
|
|
41
43
|
const path = join(directory, entry.name);
|
|
42
44
|
if (entry.isDirectory()) {
|
|
43
45
|
await walk(path);
|
|
44
46
|
}
|
|
45
47
|
else if (entry.isFile()) {
|
|
46
|
-
|
|
47
|
-
const fileInfo = dependency(path, await lstat(path));
|
|
48
|
-
if (captureDependencies && fileInfo !== null)
|
|
49
|
-
dependencies.push(fileInfo);
|
|
48
|
+
entries.push({ path });
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
51
|
};
|
|
53
52
|
await walk(implementationRoot);
|
|
54
53
|
// Keep the v1 digest byte-identical: dependency metadata augments replay
|
|
55
54
|
// validation without invalidating every existing library/executable entry.
|
|
55
|
+
// Read bounded batches concurrently, then hash in the original sorted DFS
|
|
56
|
+
// order. Serial reads spend hundreds of milliseconds in filesystem round
|
|
57
|
+
// trips on every application edit; reading the entire package at once
|
|
58
|
+
// would retain all its bytes and open an unbounded number of files.
|
|
56
59
|
const hash = createHash("sha256").update("scriptc-frontend-implementation-v1\0");
|
|
57
|
-
|
|
58
|
-
|
|
60
|
+
const batchSize = 16;
|
|
61
|
+
for (let start = 0; start < entries.length; start += batchSize) {
|
|
62
|
+
const batch = await Promise.all(entries.slice(start, start + batchSize).map(async (entry) => {
|
|
63
|
+
if (entry.directory !== undefined)
|
|
64
|
+
return { ...entry, info: entry.directory, bytes: null };
|
|
65
|
+
const info = captureDependencies ? dependency(entry.path, await lstat(entry.path)) : null;
|
|
66
|
+
return { ...entry, info, bytes: await readFile(entry.path) };
|
|
67
|
+
}));
|
|
68
|
+
for (const entry of batch) {
|
|
69
|
+
if (entry.info !== null)
|
|
70
|
+
dependencies.push(entry.info);
|
|
71
|
+
if (entry.bytes !== null) {
|
|
72
|
+
hash.update(relative(implementationRoot, entry.path)).update("\0").update(entry.bytes).update("\0");
|
|
73
|
+
}
|
|
74
|
+
}
|
|
59
75
|
}
|
|
60
76
|
return { digest: hash.digest("hex"), dependencies };
|
|
61
77
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler-self-identity.js","sourceRoot":"","sources":["../../src/library/compiler-self-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,kBAAkB,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|
1
|
+
export {};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { mkdir, mkdtemp, rename, rm, symlink, utimes, writeFile } from "node:fs/promises";
|
|
3
|
+
import { tmpdir } from "node:os";
|
|
4
|
+
import { join, relative } from "node:path";
|
|
5
|
+
import { afterEach, expect, test } from "vitest";
|
|
6
|
+
import { compilerImplementationDependenciesStillMatch, compilerImplementationIdentity } from "./compiler-self-identity.js";
|
|
7
|
+
const scratch = [];
|
|
8
|
+
afterEach(async () => {
|
|
9
|
+
await Promise.all(scratch.splice(0).map((path) => rm(path, { recursive: true, force: true })));
|
|
10
|
+
});
|
|
11
|
+
async function fixture() {
|
|
12
|
+
const root = await mkdtemp(join(process.platform === "win32" ? tmpdir() : "/tmp", "scriptc-self-identity-"));
|
|
13
|
+
scratch.push(root);
|
|
14
|
+
return root;
|
|
15
|
+
}
|
|
16
|
+
test("parallel fingerprinting preserves the v1 byte stream and dependency order across batches", async () => {
|
|
17
|
+
const root = await fixture();
|
|
18
|
+
await mkdir(join(root, "a"));
|
|
19
|
+
await mkdir(join(root, "z"));
|
|
20
|
+
// Sorted depth-first order is deliberately DIFFERENT from sorting the
|
|
21
|
+
// complete paths (a.ts would precede a/index.ts). More than one batch,
|
|
22
|
+
// empty files, and differently sized reads exercise ordered hashing.
|
|
23
|
+
const files = [
|
|
24
|
+
[join("a", "index.ts"), "export const value = 42;\n"],
|
|
25
|
+
["a.ts", ""],
|
|
26
|
+
...Array.from({ length: 40 }, (_, i) => [
|
|
27
|
+
join("z", `file${String(i).padStart(2, "0")}.js`),
|
|
28
|
+
`// ${i}\n${"\u03bb".repeat(i * 1000)}`,
|
|
29
|
+
]),
|
|
30
|
+
];
|
|
31
|
+
await Promise.all([...files].reverse().map(([path, text]) => writeFile(join(root, path), text)));
|
|
32
|
+
const expected = createHash("sha256").update("scriptc-frontend-implementation-v1\0");
|
|
33
|
+
for (const [path, text] of files)
|
|
34
|
+
expected.update(path).update("\0").update(text).update("\0");
|
|
35
|
+
const first = await compilerImplementationIdentity(true, root);
|
|
36
|
+
expect(first.digest).toBe(expected.digest("hex"));
|
|
37
|
+
expect(first.dependencies.map((item) => relative(root, item.path))).toEqual([
|
|
38
|
+
"", "a", join("a", "index.ts"), "a.ts", "z", ...files.slice(2).map(([path]) => path),
|
|
39
|
+
]);
|
|
40
|
+
expect(await compilerImplementationDependenciesStillMatch(first.dependencies)).toBe(true);
|
|
41
|
+
const withoutProof = await compilerImplementationIdentity(false, root);
|
|
42
|
+
expect(withoutProof).toEqual({ digest: first.digest, dependencies: [] });
|
|
43
|
+
});
|
|
44
|
+
test("content edits, including same-size writes, change the fingerprint and invalidate its proof", async () => {
|
|
45
|
+
const root = await fixture();
|
|
46
|
+
const source = join(root, "compiler.js");
|
|
47
|
+
await writeFile(source, "one");
|
|
48
|
+
const before = await compilerImplementationIdentity(true, root);
|
|
49
|
+
await writeFile(source, "two");
|
|
50
|
+
// Avoid depending on a filesystem's timestamp resolution for this test.
|
|
51
|
+
await utimes(source, new Date(1_000), new Date(1_000));
|
|
52
|
+
expect(await compilerImplementationDependenciesStillMatch(before.dependencies)).toBe(false);
|
|
53
|
+
const after = await compilerImplementationIdentity(true, root);
|
|
54
|
+
expect(after.digest).not.toBe(before.digest);
|
|
55
|
+
expect(await compilerImplementationDependenciesStillMatch(after.dependencies)).toBe(true);
|
|
56
|
+
});
|
|
57
|
+
test("added, renamed, and removed compiler files invalidate the captured directory proof", async () => {
|
|
58
|
+
const root = await fixture();
|
|
59
|
+
const directory = join(root, "nested");
|
|
60
|
+
await mkdir(directory);
|
|
61
|
+
await writeFile(join(directory, "first.js"), "unchanged");
|
|
62
|
+
const original = await compilerImplementationIdentity(true, root);
|
|
63
|
+
await writeFile(join(directory, "second.js"), "new");
|
|
64
|
+
await utimes(directory, new Date(1_000), new Date(1_000));
|
|
65
|
+
expect(await compilerImplementationDependenciesStillMatch(original.dependencies)).toBe(false);
|
|
66
|
+
const added = await compilerImplementationIdentity(true, root);
|
|
67
|
+
expect(added.digest).not.toBe(original.digest);
|
|
68
|
+
await rename(join(directory, "second.js"), join(directory, "renamed.js"));
|
|
69
|
+
expect(await compilerImplementationDependenciesStillMatch(added.dependencies)).toBe(false);
|
|
70
|
+
const renamed = await compilerImplementationIdentity(true, root);
|
|
71
|
+
expect(renamed.digest).not.toBe(added.digest);
|
|
72
|
+
await rm(join(directory, "renamed.js"));
|
|
73
|
+
expect(await compilerImplementationDependenciesStillMatch(renamed.dependencies)).toBe(false);
|
|
74
|
+
expect((await compilerImplementationIdentity(true, root)).digest).toBe(original.digest);
|
|
75
|
+
});
|
|
76
|
+
test.skipIf(process.platform === "win32")("symlinked dependencies remain outside the compiler package fingerprint", async () => {
|
|
77
|
+
const root = await fixture();
|
|
78
|
+
const external = await fixture();
|
|
79
|
+
await writeFile(join(root, "index.js"), "compiler");
|
|
80
|
+
await writeFile(join(external, "index.js"), "dependency");
|
|
81
|
+
await symlink(external, join(root, "dependency"));
|
|
82
|
+
await symlink(root, join(root, "cycle"));
|
|
83
|
+
const before = await compilerImplementationIdentity(true, root);
|
|
84
|
+
expect(before.dependencies.map((item) => relative(root, item.path))).toEqual(["", "index.js"]);
|
|
85
|
+
await writeFile(join(external, "index.js"), "changed dependency");
|
|
86
|
+
expect((await compilerImplementationIdentity(true, root)).digest).toBe(before.digest);
|
|
87
|
+
expect(await compilerImplementationDependenciesStillMatch(before.dependencies)).toBe(true);
|
|
88
|
+
});
|
|
89
|
+
test("missing compiler roots fail instead of producing a usable identity", async () => {
|
|
90
|
+
const root = await fixture();
|
|
91
|
+
await expect(compilerImplementationIdentity(true, join(root, "missing"))).rejects.toMatchObject({ code: "ENOENT" });
|
|
92
|
+
});
|
|
93
|
+
//# sourceMappingURL=compiler-self-identity.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler-self-identity.test.js","sourceRoot":"","sources":["../../src/library/compiler-self-identity.test.ts"],"names":[],"mappings":"A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AAC,CAAC;IAClD,MAAM,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IACzC,MAAM,MAAM,GAAG,MAAM,8BAA8B,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAChE,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC;IAC/F,MAAM,SAAS,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,oBAAoB,CAAC,CAAC;IAClE,MAAM,CAAC,CAAC,MAAM,8BAA8B,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IACtF,MAAM,CAAC,MAAM,4CAA4C,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7F,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,oEAAoE,EAAE,KAAK,IAAI,EAAE;IACpF,MAAM,IAAI,GAAG,MAAM,OAAO,EAAE,CAAC;IAC7B,MAAM,MAAM,CAAC,8BAA8B,CAAC,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;AACtH,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scriptc/compiler",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
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",
|
|
@@ -31,24 +31,24 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"typescript": "7.0.2",
|
|
33
33
|
"typescript5": "npm:typescript@5.9.3",
|
|
34
|
-
"@scriptc/runtime": "0.1.
|
|
34
|
+
"@scriptc/runtime": "0.1.7"
|
|
35
35
|
},
|
|
36
36
|
"optionalDependencies": {
|
|
37
|
-
"@scriptc/llvm-
|
|
38
|
-
"@scriptc/llvm-darwin-x64": "0.1.
|
|
39
|
-
"@scriptc/llvm-
|
|
40
|
-
"@scriptc/llvm-linux-arm64-
|
|
41
|
-
"@scriptc/llvm-linux-
|
|
42
|
-
"@scriptc/llvm-
|
|
43
|
-
"@scriptc/llvm-
|
|
44
|
-
"@scriptc/runtime-
|
|
45
|
-
"@scriptc/runtime-
|
|
46
|
-
"@scriptc/runtime-
|
|
47
|
-
"@scriptc/runtime-linux-arm64-musl": "0.1.
|
|
48
|
-
"@scriptc/runtime-
|
|
49
|
-
"@scriptc/runtime-
|
|
50
|
-
"@scriptc/runtime-
|
|
51
|
-
"@scriptc/runtime-
|
|
37
|
+
"@scriptc/llvm-linux-x64-gnu": "0.1.7",
|
|
38
|
+
"@scriptc/llvm-darwin-x64": "0.1.7",
|
|
39
|
+
"@scriptc/llvm-darwin-arm64": "0.1.7",
|
|
40
|
+
"@scriptc/llvm-linux-arm64-musl": "0.1.7",
|
|
41
|
+
"@scriptc/llvm-linux-x64-musl": "0.1.7",
|
|
42
|
+
"@scriptc/llvm-win32-x64-msvc": "0.1.7",
|
|
43
|
+
"@scriptc/llvm-linux-arm64-gnu": "0.1.7",
|
|
44
|
+
"@scriptc/runtime-linux-x64-gnu": "0.1.7",
|
|
45
|
+
"@scriptc/runtime-linux-x64-musl": "0.1.7",
|
|
46
|
+
"@scriptc/runtime-darwin-x64": "0.1.7",
|
|
47
|
+
"@scriptc/runtime-linux-arm64-musl": "0.1.7",
|
|
48
|
+
"@scriptc/runtime-win32-x64-msvc": "0.1.7",
|
|
49
|
+
"@scriptc/runtime-wasm32-wasi": "0.1.7",
|
|
50
|
+
"@scriptc/runtime-darwin-arm64": "0.1.7",
|
|
51
|
+
"@scriptc/runtime-linux-arm64-gnu": "0.1.7"
|
|
52
52
|
},
|
|
53
53
|
"scripts": {
|
|
54
54
|
"build": "node node_modules/typescript/bin/tsc -p tsconfig.json"
|
package/surface-manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"compilerVersion": "0.1.
|
|
3
|
+
"compilerVersion": "0.1.7",
|
|
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.",
|
|
@@ -2703,6 +2703,34 @@
|
|
|
2703
2703
|
"status": "static",
|
|
2704
2704
|
"note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
|
|
2705
2705
|
},
|
|
2706
|
+
{
|
|
2707
|
+
"id": "stdlib.math.LN10",
|
|
2708
|
+
"kind": "stdlib",
|
|
2709
|
+
"name": "Math.LN10",
|
|
2710
|
+
"status": "static",
|
|
2711
|
+
"note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
|
|
2712
|
+
},
|
|
2713
|
+
{
|
|
2714
|
+
"id": "stdlib.math.LN2",
|
|
2715
|
+
"kind": "stdlib",
|
|
2716
|
+
"name": "Math.LN2",
|
|
2717
|
+
"status": "static",
|
|
2718
|
+
"note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
|
|
2719
|
+
},
|
|
2720
|
+
{
|
|
2721
|
+
"id": "stdlib.math.LOG10E",
|
|
2722
|
+
"kind": "stdlib",
|
|
2723
|
+
"name": "Math.LOG10E",
|
|
2724
|
+
"status": "static",
|
|
2725
|
+
"note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
|
|
2726
|
+
},
|
|
2727
|
+
{
|
|
2728
|
+
"id": "stdlib.math.LOG2E",
|
|
2729
|
+
"kind": "stdlib",
|
|
2730
|
+
"name": "Math.LOG2E",
|
|
2731
|
+
"status": "static",
|
|
2732
|
+
"note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
|
|
2733
|
+
},
|
|
2706
2734
|
{
|
|
2707
2735
|
"id": "stdlib.math.PI",
|
|
2708
2736
|
"kind": "stdlib",
|
|
@@ -2710,6 +2738,20 @@
|
|
|
2710
2738
|
"status": "static",
|
|
2711
2739
|
"note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
|
|
2712
2740
|
},
|
|
2741
|
+
{
|
|
2742
|
+
"id": "stdlib.math.SQRT1_2",
|
|
2743
|
+
"kind": "stdlib",
|
|
2744
|
+
"name": "Math.SQRT1_2",
|
|
2745
|
+
"status": "static",
|
|
2746
|
+
"note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
|
|
2747
|
+
},
|
|
2748
|
+
{
|
|
2749
|
+
"id": "stdlib.math.SQRT2",
|
|
2750
|
+
"kind": "stdlib",
|
|
2751
|
+
"name": "Math.SQRT2",
|
|
2752
|
+
"status": "static",
|
|
2753
|
+
"note": "the constant read compiles to a numeric literal; no runtime Math read is performed"
|
|
2754
|
+
},
|
|
2713
2755
|
{
|
|
2714
2756
|
"id": "stdlib.math.abs",
|
|
2715
2757
|
"kind": "stdlib",
|
|
@@ -2724,6 +2766,13 @@
|
|
|
2724
2766
|
"status": "static",
|
|
2725
2767
|
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2726
2768
|
},
|
|
2769
|
+
{
|
|
2770
|
+
"id": "stdlib.math.acosh",
|
|
2771
|
+
"kind": "stdlib",
|
|
2772
|
+
"name": "Math.acosh",
|
|
2773
|
+
"status": "static",
|
|
2774
|
+
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2775
|
+
},
|
|
2727
2776
|
{
|
|
2728
2777
|
"id": "stdlib.math.asin",
|
|
2729
2778
|
"kind": "stdlib",
|
|
@@ -2731,6 +2780,13 @@
|
|
|
2731
2780
|
"status": "static",
|
|
2732
2781
|
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2733
2782
|
},
|
|
2783
|
+
{
|
|
2784
|
+
"id": "stdlib.math.asinh",
|
|
2785
|
+
"kind": "stdlib",
|
|
2786
|
+
"name": "Math.asinh",
|
|
2787
|
+
"status": "static",
|
|
2788
|
+
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2789
|
+
},
|
|
2734
2790
|
{
|
|
2735
2791
|
"id": "stdlib.math.atan",
|
|
2736
2792
|
"kind": "stdlib",
|
|
@@ -2745,6 +2801,13 @@
|
|
|
2745
2801
|
"status": "static",
|
|
2746
2802
|
"note": "compiles statically at arity 2; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2747
2803
|
},
|
|
2804
|
+
{
|
|
2805
|
+
"id": "stdlib.math.atanh",
|
|
2806
|
+
"kind": "stdlib",
|
|
2807
|
+
"name": "Math.atanh",
|
|
2808
|
+
"status": "static",
|
|
2809
|
+
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2810
|
+
},
|
|
2748
2811
|
{
|
|
2749
2812
|
"id": "stdlib.math.cbrt",
|
|
2750
2813
|
"kind": "stdlib",
|
|
@@ -2759,6 +2822,13 @@
|
|
|
2759
2822
|
"status": "static",
|
|
2760
2823
|
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2761
2824
|
},
|
|
2825
|
+
{
|
|
2826
|
+
"id": "stdlib.math.clz32",
|
|
2827
|
+
"kind": "stdlib",
|
|
2828
|
+
"name": "Math.clz32",
|
|
2829
|
+
"status": "static",
|
|
2830
|
+
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2831
|
+
},
|
|
2762
2832
|
{
|
|
2763
2833
|
"id": "stdlib.math.cos",
|
|
2764
2834
|
"kind": "stdlib",
|
|
@@ -2766,6 +2836,13 @@
|
|
|
2766
2836
|
"status": "static",
|
|
2767
2837
|
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2768
2838
|
},
|
|
2839
|
+
{
|
|
2840
|
+
"id": "stdlib.math.cosh",
|
|
2841
|
+
"kind": "stdlib",
|
|
2842
|
+
"name": "Math.cosh",
|
|
2843
|
+
"status": "static",
|
|
2844
|
+
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2845
|
+
},
|
|
2769
2846
|
{
|
|
2770
2847
|
"id": "stdlib.math.exp",
|
|
2771
2848
|
"kind": "stdlib",
|
|
@@ -2773,6 +2850,13 @@
|
|
|
2773
2850
|
"status": "static",
|
|
2774
2851
|
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2775
2852
|
},
|
|
2853
|
+
{
|
|
2854
|
+
"id": "stdlib.math.expm1",
|
|
2855
|
+
"kind": "stdlib",
|
|
2856
|
+
"name": "Math.expm1",
|
|
2857
|
+
"status": "static",
|
|
2858
|
+
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2859
|
+
},
|
|
2776
2860
|
{
|
|
2777
2861
|
"id": "stdlib.math.floor",
|
|
2778
2862
|
"kind": "stdlib",
|
|
@@ -2780,6 +2864,13 @@
|
|
|
2780
2864
|
"status": "static",
|
|
2781
2865
|
"note": "compiles statically at arity 1"
|
|
2782
2866
|
},
|
|
2867
|
+
{
|
|
2868
|
+
"id": "stdlib.math.fround",
|
|
2869
|
+
"kind": "stdlib",
|
|
2870
|
+
"name": "Math.fround",
|
|
2871
|
+
"status": "static",
|
|
2872
|
+
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2873
|
+
},
|
|
2783
2874
|
{
|
|
2784
2875
|
"id": "stdlib.math.hypot",
|
|
2785
2876
|
"kind": "stdlib",
|
|
@@ -2787,6 +2878,13 @@
|
|
|
2787
2878
|
"status": "static",
|
|
2788
2879
|
"note": "compiles statically at any arity, including number[] spreads"
|
|
2789
2880
|
},
|
|
2881
|
+
{
|
|
2882
|
+
"id": "stdlib.math.imul",
|
|
2883
|
+
"kind": "stdlib",
|
|
2884
|
+
"name": "Math.imul",
|
|
2885
|
+
"status": "static",
|
|
2886
|
+
"note": "compiles statically at arity 2; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2887
|
+
},
|
|
2790
2888
|
{
|
|
2791
2889
|
"id": "stdlib.math.log",
|
|
2792
2890
|
"kind": "stdlib",
|
|
@@ -2801,6 +2899,13 @@
|
|
|
2801
2899
|
"status": "static",
|
|
2802
2900
|
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2803
2901
|
},
|
|
2902
|
+
{
|
|
2903
|
+
"id": "stdlib.math.log1p",
|
|
2904
|
+
"kind": "stdlib",
|
|
2905
|
+
"name": "Math.log1p",
|
|
2906
|
+
"status": "static",
|
|
2907
|
+
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2908
|
+
},
|
|
2804
2909
|
{
|
|
2805
2910
|
"id": "stdlib.math.log2",
|
|
2806
2911
|
"kind": "stdlib",
|
|
@@ -2857,6 +2962,13 @@
|
|
|
2857
2962
|
"status": "static",
|
|
2858
2963
|
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2859
2964
|
},
|
|
2965
|
+
{
|
|
2966
|
+
"id": "stdlib.math.sinh",
|
|
2967
|
+
"kind": "stdlib",
|
|
2968
|
+
"name": "Math.sinh",
|
|
2969
|
+
"status": "static",
|
|
2970
|
+
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2971
|
+
},
|
|
2860
2972
|
{
|
|
2861
2973
|
"id": "stdlib.math.sqrt",
|
|
2862
2974
|
"kind": "stdlib",
|
|
@@ -2871,6 +2983,13 @@
|
|
|
2871
2983
|
"status": "static",
|
|
2872
2984
|
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2873
2985
|
},
|
|
2986
|
+
{
|
|
2987
|
+
"id": "stdlib.math.tanh",
|
|
2988
|
+
"kind": "stdlib",
|
|
2989
|
+
"name": "Math.tanh",
|
|
2990
|
+
"status": "static",
|
|
2991
|
+
"note": "compiles statically at arity 1; other declared call shapes run only in the embedded dynamic engine (SC2012 without --dynamic)"
|
|
2992
|
+
},
|
|
2874
2993
|
{
|
|
2875
2994
|
"id": "stdlib.math.trunc",
|
|
2876
2995
|
"kind": "stdlib",
|