Commit Graph
21 Commits
Author SHA1 Message Date
Chris Tate c92fdceedd Support static String.prototype.at and codePointAt (#454)
* Support static string at and codePointAt

* Update static at diagnostics and island contracts
2026-09-25 21:34:21 -05:00
Chris Tate 7482bc773b feat(math): add static support for analytic functions (#395)
- Lower ten Math methods through C and LLVM, including variadic hypot.
- Match JavaScript numeric edge cases and add differential coverage.
2026-09-23 19:12:54 -05:00
Chris Tate 37f9438084 Add static fixed-tuple call spreads (#351) 2026-09-19 00:00:26 -05:00
Chris Tate 1600935411 Add static-native BigInt support (#346)
* feat: add static BigInt support

* fix: prevent BigInt width overflow on WASI

* fix: harden BigInt formatting sizes

* test: record BigInt WASI parity baseline
2026-09-18 00:21:12 -05:00
Chris Tate 5a782a6150 feat: add static async iteration parity (#328) 2026-09-15 00:03:07 -05:00
Chris Tate a8a5204574 Implement typed async generators (#310) 2026-09-14 00:38:06 -05:00
Chris Tate 9fb0620f06 Implement explicit resource management (#309) 2026-09-13 23:34:17 -05:00
Chris Tateandyowainwright 1071b87d77 Lower Math.PI and Math.E statically (#279)
Co-authored-by: yowainwright <1074042+yowainwright@users.noreply.github.com>
2026-09-01 00:47:23 -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 844716b163 refactor: consolidate compiler helpers (#231)
- Share frontend package, CJS, lowering, and snapshot helpers.
- Consolidate vendor builds, manifest loops, and generic parameter shaping.
- Reuse LLVM truthiness and reference-counting skeletons.
2026-08-23 19:16:35 -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 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 Tateandkongxiangyiren 303ed952e1 fix(fetch): support Response construction (#98)
* fix(fetch): support Response construction

- Lower global Response calls through the native C and LLVM runtimes.
- Match Node 24 coercion, validation, and stream error precedence.
- Cover supported BodyInit and ResponseInit behavior with differential tests.

Co-authored-by: kongxiangyiren <72970235+kongxiangyiren@users.noreply.github.com>

* fix(fetch): align constructed response headers

* Fix Response construction and header iteration

* fix(fetch): align Response constructor conversion

* fix(fetch): preserve Response constructor semantics

---------

Co-authored-by: kongxiangyiren <72970235+kongxiangyiren@users.noreply.github.com>
2026-08-08 16:43:44 -05:00
Chris Tate 89b5ab3355 feat(compat): inventory Node 24 fetch surface
- Classify Node 24 fetch APIs and options by static, dynamic-only, unsupported, and out-of-scope support.

- Project the inventory into the surface manifest and add runtime drift and conformance checks.

- Fence unprofiled Headers members with actionable SC2020 diagnostics.
2026-08-01 17:01:32 -05:00
Chris Tate 2d0bc2df0b Add generated Node 24 fetch conformance
- Pin the supported fetch surface to an explicit Node and Undici profile.
- Generate deterministic WebIDL, AbortSignal, and stream differential campaigns.
- Match Node stream pull scheduling while preserving typed source identity.
2026-08-01 15:33:37 -05:00
Chris Tate bc2cd2b7d1 Support Number.toFixed statically
- Lower Number.prototype.toFixed through the compiler IR and native backends.
- Match JavaScript rounding, range errors, and numeric edge cases in the runtime.
- Add differential coverage and update surface metadata and diagnostics.
2026-07-26 18:43:53 -05:00
Chris Tate 165ca1f125 Project the attestation's ambient ground into the surface manifest so full fences imply deterministic
- The determinism attestation demoted on Date/perf_hooks/process libCalls that had no manifest entry, so the ask-5 §4 invariant (compiles under full fences => deterministic) could not be stated and the spec's own worked-example prefix stdlib.date. refused as unknown; AMBIENT_SURFACE_FNS now projects those families as permanent manifest ids (stdlib.date.*, node-builtin.perf_hooks.performance.now, node-builtin.process.*) with reach-witnessing detectors.
- BUILTIN_MODULE_FN_ALIASES folds the special-cased alternate spellings into their member detectors: the fs Buffer/fd/options/withFileTypes/watch-listener variants, the JS-ladder mkdtempSyncChk and lchmodSyncChk, crypto's composed randomBytesToString, and os.userInfo's userHomedir/userShell scalars.
- A parity test holds the two scans together over the exhaustive IrLibFn registry: every spelling LIB_NONDETERMINISTIC_PREFIXES demotes on must be deniable through a manifest-id fence, with the library-mode-refused and validate-then-fence residue pinned by name with reasons.
- The §4 invariant fixture and K14's worked fences now cover every attestation-known family, and a new K14 case pins the teeth: Date.now / process.env reads under the full-fence profile refuse SC4008 naming the entry instead of attesting deterministic: false post hoc.
- Sampling probes cover the new static entries (Date.now, process.pid, performance.now); surface-manifest.json regenerated (18 new entries, 336 total).
2026-07-24 11:25:42 -05:00
Chris Tate d66c36b020 Ship a per-release surface manifest with stable ids and refusal codes
- packages/compiler/surface-manifest.json is generated (pnpm manifest), committed, and shipped in @scriptc/compiler; entries project mechanically from the diagnostics registry, the unsupported-syntax dispatch tables, the stdlib/builtin lowering tables, and the supported-builtin-module list
- every non-static entry carries the SC code the compiler raises for it, and the version spine is the exact published release version
- FENCE_CODES joins the diagnostics registry so factory-minted construct fences are enumerable
- the sampling harness compiles listed-static probes and asserts each sampled non-static entry refuses with exactly its listed code, beside a byte-identical staleness guard
- the release workflow regenerates the manifest, fails on drift, and attaches it to the GitHub release
2026-07-22 22:01:45 -05:00
Chris Tate 7fca9785ea Coverage renders the diagnostics it stops on
- A type-error stop prints the same code frames a build prints
- The import-site stop renders its diagnostics below the blocker table
- Coverage is the first command reached for; the verdict line alone swallowed the fix
2026-07-22 19:23:23 -05:00
Chris Tate 23d5918a53 init 2026-07-22 18:08:04 -05:00