| [ Web Proxy ] |
| Viewing: https://scriptc.dev/platforms | [Back] [Original] |
The primary platform. clang preinstalled with the Xcode Command Line Tools is the only system dependency for producing executables. Source artifacts selected with --emit=ir|c|llvm need only Node. On macOS 15+ arm64, --emit=asm|obj uses the version-matched @scriptc/llvm-darwin-arm64 helper installed with scriptc, emits arm64-apple-macosx14.0.0 artifacts, and does not invoke a compiler, archiver, linker, or SDK. Object output retains undefined runtime references and is not a library archive. The full executable surface is supported: the language, the stdlib, the Node API surface including the server stack, --dynamic, and the sanitizer lane.
scriptc cross-compiles from macOS using zig's bundled clang and sysroots. Install zig, then select it with two environment variables:
SCRIPTC_CC=zigccSCRIPTC_TARGET=<triple>$ SCRIPTC_CC=zigcc SCRIPTC_TARGET=aarch64-linux-gnu.2.36 scriptc build fib.ts -o fib-linux
$ file fib-linux
fib-linux: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 2.0.0, with debug_info, not strippedThe runtime has native Linux backends throughout: the event loop is epoll (kqueue on macOS), the server stack and TLS (with distro CA-bundle probing) and fs.watch all have Linux implementations, verified against Linux Node in a container-based differential lane. x86_64-linux-gnu.2.36 works the same way. For Alpine containers, use <arch>-linux-musl; Zig produces a statically linked executable for either AArch64 or x86_64, and the same static runtime surface is verified against Node on Alpine.
$ SCRIPTC_CC=zigcc SCRIPTC_TARGET=x86_64-windows-gnu scriptc build fib.ts -o fib.exe
$ file fib.exe
fib.exe: PE32+ executable (console) x86-64, for MS WindowsThe full corpus runs in a differential lane against Windows Node, including --dynamic programs and child_process. The Windows fixture lanes also exercise real loopback traffic through net, http, https, tls, http2, dgram, and dns, plus the native fetch implementation (including redirects, streaming bodies, compression, cancellation, and proxy handling).
Three mobile triples build library-mode static archives for an embedding app to link a mobile app is the executable, so scriptc build without --lib rejects these targets with SC3002:
SCRIPTC_TARGET=aarch64-apple-iosLC_BUILD_VERSION with minimum OS 15.0.SCRIPTC_TARGET=aarch64-apple-ios-simulatorSCRIPTC_TARGET=aarch64-linux-androidminSdkVersion must be 26 or higher. Requires an Android NDK: ANDROID_NDK_ROOT, or the newest ndk/<version> under ANDROID_HOME or the default SDK location.$ SCRIPTC_CC=zigcc SCRIPTC_TARGET=aarch64-apple-ios scriptc build --lib --profile app.profile.json
$ SCRIPTC_CC=zigcc SCRIPTC_TARGET=aarch64-linux-android scriptc build --lib --profile app.profile.jsonThe full library-mode feature set applies: profile-declared exports and ABI entry points, host-callback channels (callbacks + abi.callback_register_symbol), contract sidecars, determinism fences, abi.localize_runtime (multi-instance archives Mach-O localization runs the macOS host linker for both iOS platforms; Android rides the same in-process ELF localization as the Linux cross targets), and abi.instance_per_thread (thread-instanced state). The archive's external-symbol contract is unchanged: undefined references only to the target's C/math runtime and system APIs, resolved by Xcode's link against the selected SDK or the NDK clang link at API 26+. Simulator and emulator execution of the archive probes is part of the test matrix; device-architecture archives are build- and link-verified.
Set SCRIPTC_CC=zigcc and SCRIPTC_TARGET=wasm32-wasi to produce a standalone .wasm module. Without -o, scriptc build hello.ts writes .scriptc/hello.wasm. scriptc run hosts the module with Node's WASI implementation, inherits stdio and environment, preopens the current working directory as /, and maps the host platform's temporary directory to the guest's /tmp. A built module can run in another WASI Preview 1 host instead.
WASI is a production LLVM target with the same language tiers as the native targets. Its 32-bit LLVM ABI supports collections, closures, exceptions, classes, checked dynamic values, async/await, promises, synchronous and asynchronous generators, timers, stdin/readline events, process-exit listeners, filesystem callbacks and promises, and the --dynamic QuickJS island. The debugging C backend remains available for async-free inspection only through an explicit --backend c; coroutine-dependent programs report SC3001, and WASI never silently falls back to C.
The remaining executable boundary is host capability, not language coverage. WASI Preview 1 has no portable socket, process-spawn, OS-signal, network-interface, or filesystem-notification APIs. Networking/fetch, child processes, signal APIs, os.networkInterfaces(), and fs.watch therefore fail before linking with diagnostic SC3002. --sanitize, native FFI, and library-mode archive builds are unavailable too. Filesystem behavior is bounded by the host's preopens, and process/OS introspection follows WASI's reduced model.
--sanitize is a host-build lane.wasm32-wasi rejects scriptc build --lib with SC3002.SC3002, and only the library-admissible surface (the async-free static tier a library archive links) is supported there.| Platform | How | Status |
|---|---|---|
| macOS arm64 | native | Primary: full surface, --dynamic, sanitizer lane |
| Linux arm64 / x86_64 | SCRIPTC_CC=zigcc SCRIPTC_TARGET=<arch>-linux-gnu.2.36 or <arch>-linux-musl | Static and dynamic surfaces incl. servers, TLS, fetch, fs.watch, and child_process; verified against Linux Node on Bookworm and Alpine |
| Windows x86_64 | SCRIPTC_CC=zigcc SCRIPTC_TARGET=x86_64-windows-gnu | Static and dynamic surfaces incl. servers, TLS, fetch, and child_process; verified against Windows Node |
| iOS arm64 (device and simulator) | SCRIPTC_CC=zigcc SCRIPTC_TARGET=aarch64-apple-ios or aarch64-apple-ios-simulator, macOS host with Xcode | Library mode only (--lib): static archives for Xcode projects, iOS 15.0 minimum; multi-instance and thread-instanced profiles; simulator-executed test matrix |
| Android arm64 | SCRIPTC_CC=zigcc SCRIPTC_TARGET=aarch64-linux-android, any host with an NDK | Library mode only (--lib): static archives for Gradle/NDK projects, API level 26 minimum; multi-instance and thread-instanced profiles; emulator-executed test matrix |
| WebAssembly / WASI Preview 1 | SCRIPTC_CC=zigcc SCRIPTC_TARGET=wasm32-wasi | Production LLVM target; full language and dynamic tiers, bounded by WASI P1 host capabilities |
| Web Proxy Viewer | New URL | Original Page |