scriptc 0.2.10 → 0.3.1

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 (2) hide show
  1. package/README.md +21 -14
  2. package/package.json +10 -10
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # scriptc
2
2
 
3
- Compile ordinary TypeScript and JavaScript to small, fast native executables or WASI WebAssembly modules — no Node, no V8, no JavaScript engine in the artifact.
3
+ Compile TypeScript and JavaScript to native executables or WASI WebAssembly modules that run without Node.js installed.
4
4
 
5
5
  ```console
6
6
  $ cat fib.ts
@@ -12,36 +12,43 @@ console.log(fib(30));
12
12
  $ scriptc run fib.ts
13
13
  832040
14
14
 
15
- $ scriptc build fib.ts -o fib && ./fib
15
+ $ scriptc build fib.ts -o fib >/dev/null && ./fib
16
16
  832040
17
17
  ```
18
18
 
19
+ scriptc compiles the same TypeScript you run on Node.js, type-checked by the TypeScript compiler. npm packages your program imports compile along with it. Code scriptc can't compile fails the build with an error code and, where available, a rewrite hint.
20
+
21
+ scriptc is experimental. See the [limitations](https://scriptc.dev/docs/limitations) and the [Node.js compatibility reference](https://scriptc.dev/compatibility).
22
+
19
23
  ## Install
20
24
 
21
25
  ```console
22
26
  $ npm install -g scriptc
23
27
  ```
24
28
 
25
- The installed compiler runs natively on supported macOS, Linux, and Windows hosts. Compilation, compile-time evaluation, and native execution do not require Node. `--emit=ir|llvm|asm|obj` uses the bundled TypeScript checker and LLVM helper without an external compiler, archiver, linker, or SDK. Executable builds additionally need a platform linker driver and SDK/sysroot; precompiled runtime packs supply the C runtime. Set `SCRIPTC_LINKER` to choose that driver. Runtime development with `--sanitize` additionally needs a C compiler. Node.js 24 or newer is needed for npm installation and `scriptc run` of WASI modules.
26
-
27
- The native compiler includes its host runtime pack. Cross-compilation uses additional `@scriptc/runtime-<target>` packages installed in your project at the same version as `scriptc --version`. WASI builds use `@scriptc/runtime-wasm32-wasi`, for example. Run the compiler from that project or set `SCRIPTC_RUNTIME_PACK` to the pack directory. Linux GNU distributions require glibc 2.34 or newer.
29
+ npm installs the native compiler for your platform (macOS, Linux, or Windows). Node.js 24 or later is needed to install it and to run WASI modules with `scriptc run`; compiling and running executables doesn't need Node.js.
28
30
 
29
- Builds use a bounded persistent cache. Unchanged source can reuse the validated frontend result and LLVM program objects. Library identity getters occupy a separate LLVM module, so an identity change can reuse the large program object. Runtime objects come from the installed pack. Executable cache entries verify their native dependencies; FFI builds relink against current external inputs. Set `SCRIPTC_NO_CACHE=1` to bypass the cache or `SCRIPTC_CACHE_DIR` to select its location. An existing POSIX override must already be private.
31
+ Building executables needs a linker and the platform SDK or sysroot, such as the Xcode Command Line Tools on macOS. Set `SCRIPTC_LINKER` to choose the linker driver. `--emit=ir|llvm|asm|obj` needs no external tools. See the [quickstart](https://scriptc.dev/docs/quickstart) for details.
30
32
 
31
33
  ## Commands
32
34
 
33
- - `scriptc build <file.ts>` — compile to a native executable or selected target artifact
34
- - `scriptc run <file.ts>` — compile and run
35
- - `scriptc coverage <file.ts>` — what compiles statically, and why the rest doesn't
35
+ - `scriptc build <file.ts>`: compile to a native executable or another artifact selected with `--emit`.
36
+ - `scriptc run <file.ts>`: compile and run.
37
+ - `scriptc coverage <file.ts>`: report what compiles, and explain what doesn't.
38
+ - `scriptc build --lib --profile <profile.json>`: compile a static library, or a Wasm reactor on `wasm32-wasi`.
39
+
40
+ See the [CLI reference](https://scriptc.dev/docs/cli) for every option.
41
+
42
+ ## Cross-compilation and WebAssembly
36
43
 
37
- `scriptc build app.ts --emit=ir|llvm|asm|obj` selects serialized typed IR, textual LLVM IR, target assembly, or a relocatable program object as the one primary artifact. `--emit=exe` is the default. Assembly/object emission uses the matching helper on supported macOS, Linux, and Windows hosts (and produces WASI artifacts when that target is selected). Objects retain undefined `scr_*` runtime references plus the `scr_runtime_abi_v13` compatibility marker; they are not library archives. External consumption is experimental and requires the exact matching runtime. `scriptc build app.ts --print=native-link-info -o app.o` prints the versioned JSON target/runtime/link recipe without performing a link. `--emit=asm|obj --sanitize` is rejected until ASan pipeline parity is available.
44
+ Set `SCRIPTC_TARGET` to build for another platform, for example `SCRIPTC_TARGET=aarch64-linux-gnu.2.36` or `SCRIPTC_TARGET=wasm32-wasi`. Install the matching `@scriptc/runtime-<target>` package in your project, at the same version as `scriptc --version`, or set `SCRIPTC_RUNTIME_PACK` to a runtime pack directory. See [platform support](https://scriptc.dev/docs/platforms) and [WebAssembly modules](https://scriptc.dev/docs/wasm).
38
45
 
39
- For embedder-hosted modules that are not installed npm packages, coverage can map an exact bare specifier to a local declaration with repeatable `--external-types <specifier=file.d.ts>` options. This is analysis-only: the types unblock application measurement, while runtime module uses remain reported as blockers.
46
+ ## Native code
40
47
 
41
- No annotations, no dialect, no special stdlib: the same TypeScript you run on Node, type-checked by the real TypeScript compiler. Programs outside the static tier can opt into `--dynamic`, which embeds a small JavaScript engine (~620KB) for the parts that can't be static; everything else fails the build with a specific error code and usually a rewrite hint.
48
+ Call C functions by declaring their signatures in TypeScript and binding them to C symbols in a manifest passed with `--ffi <manifest.json>`. See the [Native FFI guide](https://scriptc.dev/docs/ffi).
42
49
 
43
- WebAssembly is available as a production LLVM target: `SCRIPTC_TARGET=wasm32-wasi scriptc build app.ts`. It emits a WASI Preview 1 `.wasm` module, and `scriptc run` supplies a WASI host. The complete executable language tier—including async, generators, timers, and `--dynamic`—is supported. APIs needing capabilities WASI P1 does not expose (network sockets/fetch, child processes, OS signals, and filesystem watching), sanitizer builds, and native FFI are rejected with `SC3002`. With `--lib --profile`, the target produces a callable Wasm reactor with named host imports and per-instance memory. See [WebAssembly Modules](https://scriptc.dev/wasm) for the embedding contract.
50
+ ## Build cache
44
51
 
45
- Native code can be called through an explicit, link-time C ABI manifest: declare the function signature in TypeScript, bind it to a C symbol, and build with `--ffi <manifest.json>`. See the [Native FFI guide](https://scriptc.dev/ffi).
52
+ Builds reuse a bounded persistent cache. Set `SCRIPTC_NO_CACHE=1` to bypass it or `SCRIPTC_CACHE_DIR` to choose its location.
46
53
 
47
54
  Docs: [scriptc.dev](https://scriptc.dev)
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "scriptc",
3
- "version": "0.2.10",
4
- "description": "Compile ordinary TypeScript and JavaScript to small, fast native executables — no Node, no V8, no JavaScript engine in the binary",
3
+ "version": "0.3.1",
4
+ "description": "Compile ordinary TypeScript and JavaScript to small, fast native executables and WebAssembly modules that run without Node.js",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://scriptc.dev",
7
7
  "repository": {
@@ -21,16 +21,16 @@
21
21
  "node": ">=24"
22
22
  },
23
23
  "devDependencies": {
24
- "@scriptc/compiler": "0.2.10"
24
+ "@scriptc/compiler": "0.3.1"
25
25
  },
26
26
  "optionalDependencies": {
27
- "@scriptc/cli-darwin-arm64": "0.2.10",
28
- "@scriptc/cli-linux-arm64-gnu": "0.2.10",
29
- "@scriptc/cli-linux-arm64-musl": "0.2.10",
30
- "@scriptc/cli-darwin-x64": "0.2.10",
31
- "@scriptc/cli-linux-x64-gnu": "0.2.10",
32
- "@scriptc/cli-win32-x64-msvc": "0.2.10",
33
- "@scriptc/cli-linux-x64-musl": "0.2.10"
27
+ "@scriptc/cli-darwin-arm64": "0.3.1",
28
+ "@scriptc/cli-linux-arm64-gnu": "0.3.1",
29
+ "@scriptc/cli-darwin-x64": "0.3.1",
30
+ "@scriptc/cli-linux-arm64-musl": "0.3.1",
31
+ "@scriptc/cli-linux-x64-gnu": "0.3.1",
32
+ "@scriptc/cli-linux-x64-musl": "0.3.1",
33
+ "@scriptc/cli-win32-x64-msvc": "0.3.1"
34
34
  },
35
35
  "scripts": {
36
36
  "build": "node ../../node_modules/typescript/bin/tsc -p tsconfig.json",