Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ scriptc is experimental and targets macOS, Linux, Windows, and WebAssembly via W

## Installation

The compiler requires Node.js 20 or newer and clang. The executables it produces do not require Node.
The compiler requires Node.js 24 or newer and clang. The executables it produces do not require Node.

```console
$ npm install -g scriptc
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
},
"type": "module",
"bin": {
"scriptc": "dist/main.js"
"scriptc": "dist/bootstrap.js"
},
"files": [
"dist"
],
"engines": {
"node": ">=20"
"node": ">=24"
},
"scripts": {
"build": "node ../../node_modules/typescript/bin/tsc -p tsconfig.json"
Expand Down
16 changes: 16 additions & 0 deletions packages/cli/src/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env node

import { enableCompileCache } from "node:module";

// Node 24 can persist V8's compiled module bytecode. scriptc's CLI imports
// the compiler and its lowering/backend graph before handling any command, so
// enabling this in the tiny bootstrap avoids reparsing that graph on every
// edit/build invocation.
try {
enableCompileCache();
} catch {
// Bytecode caching is an optimization boundary. A read-only temp directory
// must never prevent the compiler from running.
}

await import("./main.js");
1 change: 0 additions & 1 deletion packages/cli/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#!/usr/bin/env node
import { spawn } from "node:child_process";
import { existsSync, readFileSync, rmSync, statSync } from "node:fs";
import { basename, dirname, join, resolve } from "node:path";
Expand Down
364 changes: 363 additions & 1 deletion packages/compiler/src/backend/cc-cache.test.ts

Large diffs are not rendered by default.

Loading
Loading