Commit Graph
136 Commits
Author SHA1 Message Date
Chris Tate 9b6dae4af2 feat: add static CommonJS module graph 2026-09-15 20:49:33 -05:00
Chris Tate 280fe1a8da feat: preserve class and child handles through unknown (#331)
* feat: preserve class and child handles through unknown

* fix: hide private fields from unknown views
2026-09-15 19:30:22 -05:00
Chris Tate e559808ef0 feat: run Commander actions statically (#330) 2026-09-15 16:30:54 -05:00
Chris Tate 5a782a6150 feat: add static async iteration parity (#328) 2026-09-15 00:03:07 -05:00
Chris Tate 2ac8743dbb feat(compiler): add Node module resolution introspection (#322) 2026-09-14 18:15:44 -05:00
Chris TateandPaolo Anzani 2bfc37b138 fix(compiler): support branded primitive types (#320)
Co-authored-by: Paolo Anzani <201222836+paoloanzn@users.noreply.github.com>
2026-09-14 13:46:36 -05:00
Chris TateandMateus Mamede Lage 16de852347 fix(compiler): lower dynamic any-local operators (#319)
Fixes #290

Co-authored-by: Mateus Mamede Lage <23098414+mmamedel@users.noreply.github.com>
2026-09-14 12:31:25 -05:00
Chris Tate 74dce238ab perf(runtime): scale URLSearchParams sorting (#318) 2026-09-14 11:53:42 -05:00
Chris Tateand2youg1 b74364ed01 fix(compiler): preserve leading BOM literals (#316)
Co-authored-by: 2youg1 <65069696+2youg1@users.noreply.github.com>
2026-09-14 10:29:16 -05:00
Chris Tate 073c840564 Enforce TypeScript 7 and Node type-link parity (#315)
* Enforce TypeScript 7 and Node type-link parity

* fix(compiler): normalize Windows resolver paths

* fix(compiler): canonicalize Windows realpaths
2026-09-14 09:19:08 -05:00
Chris Tate a8a5204574 Implement typed async generators (#310) 2026-09-14 00:38:06 -05:00
Chris Tate d7aed4b722 Unify TS 7 project module resolution (#308) 2026-09-13 21:53:45 -05:00
Chris Tate 94fd361b54 Implement sparse native arrays and missing-value parity (#297)
Represent ordinary JavaScript arrays with hole, value, and explicit-undefined states; add sparse side storage and carry missing values through the frontend, native backends, runtime, and Node-facing consumers.
2026-09-12 22:39:07 -05:00
Chris Tate 4b241f77d7 Replace quadratic array sorting with stable merge sort (#296)
* Fix Sandbox command transport and pinned native setup

Build the Linux LLVM helper and runtime pack before running both test lanes, and align native cache contracts with the current target policy. Full managed Sandbox gate passed.

* Replace quadratic array sorting with stable merge sort

Cover sort snapshots, consistent-comparator results, stable ties, and comparator complexity with Node differential fixtures. Document differences from V8 TimSort.
2026-09-12 16:05:16 -05:00
Chris Tate bf32f155fc test: record TS7 order parity baselines (#285) 2026-09-02 20:08:06 -05:00
Chris Tateandeuxaristia 1730676951 fix(compiler): keep targetless Zig native builds coherent (#273)
Co-authored-by: euxaristia <25621994+euxaristia@users.noreply.github.com>
2026-08-31 10:47:41 -05:00
Chris Tateandmonteslu 4d9e2a2397 fix ffi call initializers (#268)
Co-authored-by: monteslu <423800+monteslu@users.noreply.github.com>
2026-08-30 19:23:04 -05:00
Chris Tateandmmamedel 0b1738d51e optimize string self-concatenation ownership (#267)
Co-authored-by: mmamedel <23098414+mmamedel@users.noreply.github.com>
2026-08-30 17:53:30 -05:00
Chris Tateandmmamedel 5b7a5bd82b fix(compiler): reshape inline record assertions (#266)
Co-authored-by: mmamedel <23098414+mmamedel@users.noreply.github.com>
2026-08-30 17:05:44 -05:00
Chris Tate 64b2a285d5 feat(runtime): ship precompiled macOS artifacts (#248)
* feat(runtime): ship precompiled macOS artifacts

- Add a versioned macOS arm64 runtime pack with deterministic feature selection and artifact verification.
- Link LLVM helper objects against release-built runtime and vendor inputs without compiling user-machine C.
- Wire package publishing, cache validation, documentation, and full-gate coverage for the new path.

* fix(runtime): harden precompiled artifact handling

* fix(runtime): make precompiled artifacts reproducible

* fix(runtime): reject opaque linkers from executable cache

* fix(runtime): normalize precompiled archive metadata

* fix(runtime): harden precompiled artifact caching

* fix(runtime): close executable cache link race

* fix(runtime): stage verified pack artifacts

* fix(runtime): bracket helper cache inputs

* fix(runtime): preserve executable link identity

* fix(runtime): trace selected linker dependencies
2026-08-28 09:29:21 -05:00
Chris Tate 73efea6ab3 feat(cli): expose native object link info (#247)
* 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
2026-08-27 13:47:09 -05:00
Chris Tate 401338f437 feat(compiler): add native LLVM object emission (#242)
* feat(compiler): add native LLVM object emission

- ship the pinned macOS arm64 LLVM helper and platform package
- add assembly/object CLI outputs, caching, diagnostics, and runtime ABI checks
- validate helper artifacts through CI, packaging, docs, and differential coverage

* fix(compiler): harden native LLVM emission

* fix(compiler): harden LLVM helper packaging

* fix(compiler): stabilize LLVM helper package size

* fix(compiler): harden native helper validation

* fix(compiler): harden LLVM helper verification

* fix(compiler): harden native object emission
2026-08-27 10:30:40 -05:00
Chris Tate 77fad3c4cc feat(cli): add source-level output kinds (#241)
* feat(cli): add source-level output kinds

- add typed IR, C, and LLVM primary artifacts without native toolchain discovery
- centralize output paths, compatibility validation, and stale artifact cleanup
- document and test the new CLI contract

* fix(cli): harden source output contracts

* fix(cli): harden source output compatibility
2026-08-26 15:26:24 -05:00
Chris Tate 73ee01d7ef refactor(llvm): split expression emission by family (#235)
* refactor(llvm): split expression emission by family

- Extract expression and support emission into focused LLVM modules.
- Partition library calls behind prefix-dispatched domain modules.
- Consolidate keyed-record reads behind one shared implementation.

* fix(llvm): preserve validation call routing
2026-08-24 07:28:38 -05:00
Chris Tate 469efdd7f0 refactor: clarify compiler module boundaries (#232)
* refactor: clarify compiler module boundaries

- Rename backend, frontend, IR, and cache modules for explicit ownership.
- Split native cache/vendor and frontend shared concerns into focused modules.
- Expand compiler context names and refresh imports, tests, and documentation.

* fix: preserve renamed compiler interfaces
2026-08-23 20:16:13 -05:00
Chris Tate f5f04a5f49 Improve compiler lint and error classification (#208)
* Warn on non-null assertions

- Surface non-null assertions during linting without making them blocking.

- Preserve existing assertion sites for opportunistic cleanup.

* Classify internal compiler errors

- Export InternalCompilerError and migrate compiler invariant throws without changing messages.

- Rename the native cache test to match cc.ts and update test scheduling references.

- Document test placement by unit, package integration, and cross-package scope.

* Fix internal compiler error classification
2026-08-23 00:02:28 -05:00
Chris Tate 09f51311f9 perf: reduce checker RPC traffic (#190)
- Batch checker type work for reached call/receiver paths and eager npm-static implicit instances.
- Memoize immutable type constituents and skip array checks for visibly non-object types.
2026-08-21 11:42:42 -05:00
Chris Tate ce6eb7e5fe Prefetch checker work by lowering phase (#181)
* Prefetch checker work by lowering phase

- Batch program structure and reachable body waves without querying dead bodies.
- Preserve memoization and panic fencing with focused checker coverage.

* Batch checker queries in coverage remainder

* Batch JavaScript class collection queries

* Batch managed checker analysis gaps

* Batch types for previously prefetched symbols
2026-08-20 18:17:08 -05:00
Chris Tate 6310dfb960 Reuse reachability lowering output (#178)
* Reuse reachability lowering output

- Retain reachable IR and assemble the emitted module without lowering bodies a second time
- Preserve reached-only artifact filtering, coverage remainder behavior, and add lowering phase timing

* Preserve record order in retained lowering

* Preserve record order in retained helpers

* Preserve generic lowering record order

* Recheck retained generic rest order

* Record retained lowering parity fixtures

* Preserve retained lowering failure parity
2026-08-20 14:01:39 -05:00
Chris Tate 5544b23ee9 Cache emitted library translation units (#175)
* Cache emitted library translation units

- Restore cached C and LLVM translation units on semantic library cache hits while refreshing volatile build identity
- Rebase public C source annotations and strip them from stable native-cache inputs

* Fix cached library source annotations

* Fix cached C source annotations

* Fix cached C newline annotations
2026-08-20 02:04:30 -05:00
Chris Tate 741e8cd3f6 Split volatile library identity code (#174)
* Split volatile library identity code

- Emit build identity getters from a tiny standalone C translation unit
- Cache generated library program objects independently of volatile identity and archives
- Preserve toolchain, runtime, and translation-unit dependency invalidation coverage

* Preserve library identity during localization

* Keep library identity sources private

* Preserve library identity in public emission

* Preserve identity in kept library units
2026-08-19 23:36:22 -05:00
Chris Tate 273ceac4a7 Optimize same-shape record spreads (#168)
* Optimize same-shape record spreads

- Lower TypeScript record updates through reusable clone helpers
- Outline large record clones in C and LLVM to reduce generated code
- Add ownership, IR, integer-proof, and differential coverage

* Fix cast record spread clone fallback
2026-08-17 23:37:15 -05:00
Chris Tate ff98ee2330 Speed up scriptc builds (#166)
* Speed up scriptc builds

- Cache native compilation inputs and enable Node 24 bytecode caching
- Memoize frontend type lowering and reduce checker overfetch
- Add dev-mode library optimization and phase timing

* Fix persistent cache invalidation

* Fix native cache dependency validation

* Fix native cache header shadow invalidation
2026-08-17 20:15:56 -05:00
Jimmy Miller 729f809099 Merge pull request #153 from vercel-labs/split/filter-truthy-predicate
feat(compiler): accept truthy filter predicates
2026-08-17 08:56:40 -07:00
Jimmy Miller b98b7c4a49 fix(compiler): guard zero-arg dynamic filter calls 2026-08-17 10:34:43 -04:00
Chris TateandDemonGPT a737fde346 feat(ffi): marshal foreign-thread callbacks (#164)
* feat(ffi): marshal foreign-thread callbacks

- Add format 5 foreign callback descriptors with strict retained, context, and void-return validation.
- Marshal copied callback arguments through an optional MPSC event-loop queue in both C and LLVM backends.
- Cover concurrent delivery, liveness, fairness, teardown, cross-platform builds, and document the boundary contract.

Co-authored-by: DemonGPT <127974011+DemonGPT@users.noreply.github.com>

* fix(ffi): preserve callback checkpoints

---------

Co-authored-by: DemonGPT <127974011+DemonGPT@users.noreply.github.com>
2026-08-16 22:59:02 -05:00
Chris TateandDemonGPT da9a8f5524 feat(ffi): copy callback strings and spans (#162)
* feat(ffi): copy callback strings and spans

- Add format 3 callback classes for cstrings, UTF-8 spans, and byte spans.
- Materialize owned callback arguments in both backends with strict null handling.
- Cover validation, ownership, sanitizers, and document the boundary contract.

Co-authored-by: DemonGPT <127974011+DemonGPT@users.noreply.github.com>

* fix(ir): bump schema for callback spans

---------

Co-authored-by: DemonGPT <127974011+DemonGPT@users.noreply.github.com>
2026-08-16 08:52:45 -05:00
Chris TateandKayakyx 952f5788aa fix(runtime): trust Windows root certificates (#158)
* fix(runtime): trust Windows root certificates

- Load default TLS roots from the Windows ROOT store.
- Link crypt32 for Windows TLS builds.
- Cover the certificate-store import in cross-build tests.

Co-authored-by: Kayakyx <Kayakyx@users.noreply.github.com>

* fix Windows CA store policy handling

* fix(runtime): cover Windows policy root stores

* fix(runtime): dedupe Windows root stores

* fix(tls): match Windows system CA stores

---------

Co-authored-by: Kayakyx <Kayakyx@users.noreply.github.com>
2026-08-15 19:27:33 -05:00
Chris TateandArth Tyagi 6f50205dfd feat: support aarch64 Linux musl (#159)
- 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>
2026-08-15 10:53:06 -05:00
Jimmy Miller 625a8ee6c0 fix(compiler): fence dynamic filter void predicates 2026-08-14 10:27:39 -04:00
Jimmy Miller 6f4592295f test(compiler): cover island filter void predicate 2026-08-14 10:27:38 -04:00
Jimmy Miller f1a577fd0a test(compiler): record dynamic filter diagnostic baseline 2026-08-14 10:27:38 -04:00
Jimmy Miller 0bd90765cf feat(compiler): accept truthy (non-bool) filter predicates
`.filter(fn)` required the callback to return exactly bool. JS applies
ToBoolean to whatever the predicate answers, so `xs.filter((s) => s)` — the
idiomatic drop-the-falsy — was refused for no semantic reason.

The filter loop now wraps the call in the same toBool an `if` statement would
apply. A bool answer is unchanged and emits identical IR. A union answer
routes through its interned per-arm truthy helper, requested at the call site
where a real node exists for the diagnostic. A unit-only answer is constantly
falsy, and the call still runs for its effects.

The kinds with no native ToBoolean keep the fence: void has no value at all,
and dyn/jsval/caught truthiness needs the embedded engine.

Verified against Node: filtering strings, numbers, and a
`(string | undefined)[]` all print identically in both.

Diagnostics 100, filter corpus 9 across both
backends.
2026-08-14 10:27:38 -04:00
Jimmy Miller 990c7ce048 fix(compiler): preserve runtime-optional soundness 2026-08-13 15:47:45 -04:00
Chris Tate 2ea62825cb feat: add mobile library targets for iOS and Android (#145)
* 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
2026-08-13 09:48:09 -05:00
Chris TateandAlbert 31f268be2b feat: support wasm32-wasi as a production target (#133)
* 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>
2026-08-11 14:12:59 -05:00
Chris Tateandsqlpxc 2c164dd374 feat: support x86_64 Linux musl targets (#131)
* feat: support x86_64 Linux musl targets

- add musl runtime shims for randomness, fibers, and child-process cwd support
- validate executable and library outputs against Alpine Linux
- document x86_64-linux-musl cross-compilation

Co-authored-by: sqlpxc <38583139+sqlpxc@users.noreply.github.com>

* fix: harden musl runtime portability

* fix: keep child fixture portable across hosts

---------

Co-authored-by: sqlpxc <38583139+sqlpxc@users.noreply.github.com>
2026-08-11 12:10:03 -05:00
Chris Tateandmorler 00eb380a0f perf: use integer induction for byte loops (#121)
- Recognize canonical typed-array loops with semantics-safe fallbacks.
- Emit integer induction and direct integer byte indices in C and LLVM.
- Add backend and differential regression coverage.

Co-authored-by: morler <478444+morler@users.noreply.github.com>
2026-08-10 11:33:17 -05:00
Chris Tate b94c88e31c feat: support static non-UTF-8 TextDecoder labels (#111)
* feat: support static non-UTF-8 TextDecoder labels

- Recognize static WHATWG labels and aliases during builtin lowering.
- Add feature-gated portable decoders generated against the pinned Node runtime.
- Cover legacy encodings, malformed input, and unsupported dynamic labels.

* fix: match Node legacy decoder recovery

* fix TextDecoder edge-case parity

* fix(runtime): match Node malformed text decoding

* fix TextDecoder recovery edge cases
2026-08-09 23:15:51 -05:00
Chris Tateandryoppippi 23a2d3309e feat(fs): support static rename APIs (#104)
* feat(fs): support static rename APIs

- Lower fs.rename, fs.renameSync, and fs/promises.rename through the C and LLVM backends.
- Add runtime callback, error, and promise handling for rename operations.
- Cover typed and check-JS usage with differential corpus tests.

Co-authored-by: ryoppippi <1560508+ryoppippi@users.noreply.github.com>

* fix Windows rename semantics

* fix: move callback rename work off main thread

* fix(runtime): preserve rename callback checkpoints

---------

Co-authored-by: ryoppippi <1560508+ryoppippi@users.noreply.github.com>
2026-08-09 13:29:15 -05:00