* Expand LLVM native output targets
- Add owned helper and runtime-pack contracts for macOS x64, Linux glibc/musl, Windows x64, and WASI.
- Generalize LLVM target selection, package validation, linker plans, and release/CI matrices.
- Document linker boundaries and add focused native-output and runtime-pack coverage.
* Pin Windows LLVM helper CI to VS 2022
The official LLVM archive needs the Visual Studio 2022 CMake generator, which is not guaranteed by windows-latest.
* Align bootstrap cache with LLVM runtime-pack builds
Use the same target-specific helper and linker identity before and after compiler loading so routed executable cache hits remain lightweight.
* Install Windows LLVM CI tools with Chocolatey
windows-2022 includes Visual Studio but not winget; use its available Chocolatey bootstrap for CMake and Ninja.
* Prevent Zig version probes from leaving runtime-pack objects
Run runtime-pack compiler version probes in a private temporary directory and remove the accidental tracked WASI a.o file.
* Use 7-Zip for Windows LLVM setup
Extract the official LLVM development archive with two-stage 7-Zip instead of Windows tar.exe, which timed out while materializing the toolchain tree.
* Define ssize_t for the MSVC runtime pack
Clang's MSVC target does not expose POSIX ssize_t through sys/types.h; define the pointer-sized runtime type without affecting MinGW.
* Build the Windows runtime pack with Zig
Use the MinGW-compatible Windows sysroot required by the runtime while retaining COFF helper output and installing Zig in the Windows native CI lane.
* Give macOS LLVM differential shard time to finish
Shard 1 passed its setup and focused contracts but was cancelled during its cold LLVM differential slice at the 20-minute job limit.
* Separate native linking from C compilation
- Split the helper-object runtime-pack path into explicit link planning and platform linking.
- Reserve SCRIPTC_LINKER for object-only executable links while retaining a deprecated SCRIPTC_CC compatibility path.
- Add no-legacy-C coverage and document the linker/SDK boundary.
* Preserve runtime pack link errors
* Fix linker cache invalidation and warnings
* Fix C executable cache routing
- Keep explicit C builds on compiler-backed cache identities.
- Cover linker-only environment changes across exact C repeats.
* feat(cli): expose native object link info
- add versioned, cache-independent native link metadata for program objects
- document the experimental runtime ABI and provide C-driver and Apple linker examples
- verify ABI mismatch, FFI parity, packed installs, and external linking in CI
* fix(example): validate native runtime pack identity
- Implement the Zig 0.16.0 AArch64 musl runtime and preserve compiler failure diagnostics.
- Promote the target through executable, library, localization, and documentation matrices.
- Verify both backends and the complete arm64 Alpine differential contract.
Co-authored-by: Arth Tyagi <41021374+arthtyagi@users.noreply.github.com>
* feat: add host-callback channels to library mode
- the profile's `callbacks` array declares named channels and
`abi.callback_register_symbol` names the one registration entry point:
`int32_t <sym>(const char *name, void (*fn)(void), void *ctx)` — 0 on
success, -1 for an unknown or NULL name, latest registration wins, a
NULL fn clears, registrations persist across init/reset. The stored
pointer's typed shape is the channel's with the opaque context first,
the panic sink's layout
- channel signatures ride the existing marshalling classes: params are
f64/bool/string/bytes plus the u8/u32/i32 plumbing classes (outbound
plumbing keeps JS's ToUint32/ToInt32, the executable FFI rule);
returns are scalar only (f64/bool/u8/u32/i32/void — a buffer return
needs an ownership contract the mode does not define). string/bytes
parameters arrive as (ptr, len) pairs borrowed for the call's duration
- compiled code reaches a channel as a signature-only ambient function
declaration whose direct calls deliver synchronously on the calling
thread; the recognition rides the FFI import machinery under a library
flavor: SC4024 refuses a call the channels cannot serve (undeclared
name or off-class signature), unused channels are legal capacity, and
callback-free profiles keep the ambient ReferenceError semantics
- calling an unregistered channel is the SC4025 runtime trap: a detected
trap through the library funnel, so the structured sink message names
the channel in its text and the entry the host called in its symbol
field, and profile teachings/remediations overlay it like the rest of
the runtime family
- registration slots are per copy of the runtime state, the sink's story:
per-archive under abi.localize_runtime (the register symbol joins the
localization keep-list), per-thread instance under
abi.instance_per_thread. The host callback must not reenter any library
entry or unwind across library frames
- both emissions produce identical behavior by construction: the slot
store/fetch lives in scr_library.c (scr_library_cb_set/_require/_ctx),
the generated TU emits the registration dispatch and typed indirect
calls, and the trap text is assembled once at export resolution
- callback-free profiles emit byte-identical program TUs and serialized
IR, and executable builds are byte-identical end to end
- conformance: the CB suite (tests/harness/library-callbacks.test.ts)
covers the acceptance stream, unregistered and pre-registration traps,
symbol exactness, teaching overlays, SC4024 refusals, capacity and
callback-free postures, the localized+thread-instanced composition
probe, and ASan reruns; profile-shape refusals join
library-profile.test.ts
* fix: preserve callback binding identity
* fix: harden library callback contracts
* fix: recognize project callback declarations
* fix: enforce host callback declarations
* feat: add mobile library targets for iOS and Android
- three library-mode-only triples join SCRIPTC_TARGET:
aarch64-apple-ios, aarch64-apple-ios-simulator (darwin hosts with
Xcode's iPhoneOS/iPhoneSimulator SDKs), and aarch64-linux-android
(any host with an NDK). The consuming pattern is an embedding app
linking profile-configured static archives — Xcode on the Apple side,
Gradle/NDK on the Android side — so the executable lane refuses the
triples with SC3002 and the pointer to --lib
- zig bundles no Apple or bionic libc: resolveCc discovers the sysroot
(xcrun for the selected Apple SDK; ANDROID_NDK_ROOT or the newest
ndk/<version> under the SDK root) and spells it into targetArgs,
where every cache tier already keys it. The canonical LLVM spellings
map to zig's own with the minimum-version floors pinned:
aarch64-ios.15.0[-simulator] stamps LC_BUILD_VERSION minos 15.0 into
every object, aarch64-linux-android.26 pins the bionic stub level an
embedder's minSdkVersion must meet. API 26 bionic carries everything
the library-lane units call (arc4random_buf included), so no shim TU
joins the archive
- localization follows the existing object-format rule: both iOS
platforms ride the Mach-O host-ld64 arm (ld64 reads iOS objects and
preserves platform/minos through the -r merge), Android rides the
cross-ELF arm (zig relocatable merge + in-process demotion) via the
driver's zig spelling. abi.instance_per_thread needed no per-target
work — thread-local statics compile identically on all three
- admission is a pure env/host check ahead of toolchain discovery: an
iOS triple off a darwin host and near-miss mobile spellings refuse
SC3002 with the pairing or the supported set named, in compile() and
compileLibrary() both, decorated by the profile teaching machinery
- library-multi grows the mobile lanes: M12 admission shape always
runs; SCRIPTC_IOS=1 builds localized a/b archives per target and
emission (M1 symbol exactness, ambient audit, version floor), links
probes with the Xcode clang, and EXECUTES the two-instance and
four-thread probes on a booted simulator byte-for-byte against the
desktop expectations (device-arch archives are build+link verified);
SCRIPTC_ANDROID=1 does the same through the NDK clang and an
emulator, reusing a running device or writing and booting a headless
arm64 AVD directly
- the surface manifest's coverage notes record the mobile posture (the
library-admissible surface only; no mobile claim outside it), the
profile spec and the platforms page carry the mobile matrix with the
version floors, and non-mobile builds are unchanged byte-for-byte
* fix: harden mobile target tooling
* Harden mobile target test isolation
* feat: support wasm32-wasi as a production target
- Add production LLVM WASI codegen with a 32-bit ABI, coroutines, and dynamic modules
- Integrate WASI builds and execution into the CLI with capability diagnostics
- Add differential coverage and document the fourth production target
Co-authored-by: Albert <57402359+bulatovv@users.noreply.github.com>
* fix: address wasm target review findings
* fix WASI guest paths and fetch alias detection
* fix WASI async bridge and fetch detection
---------
Co-authored-by: Albert <57402359+bulatovv@users.noreply.github.com>
- Document static and dynamic HTTP/fetch support for Windows cross targets.
- Keep Windows fetch differential fixtures hermetic and parity-correct under filtering.
Co-authored-by: mike douges <6801309+itsdouges@users.noreply.github.com>
* feat(ffi): support call-scoped native callbacks
- Add format-2 callback/context declarations with exact ABI positions and strict lifetime validation.
- Emit capture-aware C and LLVM trampolines with scalar coercion and exception propagation.
- Document the callback contract and cover both backends in plain and sanitized tests.
Co-authored-by: DemonGPT <127974011+DemonGPT@users.noreply.github.com>
* fix FFI callback safety
---------
Co-authored-by: DemonGPT <127974011+DemonGPT@users.noreply.github.com>
* Support Date instance lowering
- Lower read-only Date values and constructors through the C and LLVM backends.
- Add portable calendar helpers, differential coverage, and documented surface contracts.
- Fence unsupported mutation, identity, locale, and component-constructor forms.
Co-authored-by: sensei-woo <sensei-woo@users.noreply.github.com>
* Fix Date exception and timezone semantics
* fix: harden Date lowering edge cases
* fix Date lowering edge cases
* Fix Date union fences and offset clipping
---------
Co-authored-by: sensei-woo <sensei-woo@users.noreply.github.com>
- Add a strict versioned manifest and direct C ABI lowering for both backends.
- Link declared native inputs through the CLI and compiler APIs with precise diagnostics.
- Cover the ABI under plain and sanitized integration tests and document its contracts.
- names the deliberately re-typed ambient surface, the second-chance preflight, and the declared-but-fenced console members
- the union-edges bullet drops console.log(u), which now dispatches per arm