镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

ABI: implement exact Yarr RegularExpression boundary #213

Closed

Description

@chrisbbreuer

Parent: #134
Profiles: #163, #164
Dependencies completed: zig-utils/zig-regex#11, zig-utils/zig-regex#12

Implement the six native Yarr__RegularExpression__* imports used by the pinned Home/Bun JavaScriptCore corpus:

  • init
  • deinit
  • isValid
  • matchedLength
  • matches
  • searchRev

Acceptance criteria:

  • Match the real C++/Rust executable ABI, including the two-argument searchRev(RegularExpression*, BunString) signature; document that the checked-in Zig declaration is stale.
  • Compile BunString patterns through zig-regex with JavaScript-compatible ignore-case, multiline, dot-all, Unicode, UnicodeSets, and sticky behavior where applicable.
  • Preserve valid/invalid compiled state and JavaScriptCore last-match-length behavior, including reset to -1 after a failed match.
  • Return UTF-16 code-unit positions and lengths, including astral and lone-surrogate input.
  • Match JavaScriptCore reverse-search behavior for overlap, empty matches, and subset matches.
  • Keep allocation, null-input, and object lifetime behavior deterministic at the native boundary.
  • Add focused ABI tests plus a linked consumer fixture for all six imports.
  • Refresh both private-import inventories, the implementation matrix, README status, and parent tracking issues with exact evidence.

Backward compatibility is intentionally out of scope while zig-js is pre-release and unused.

Implementation: bc4b9e32
Documentation/inventories: ff6d8730
zig-regex prerequisites: fd4927c, 86159c5

Activity

  1. chrisbbreuer commented on Jul 17, 2026

    @chrisbbreuer
    MemberAuthor

    Completed on origin/main.

    Evidence:

    • focused Yarr test: 3/3 selected harness tests passed, 0 leaked;
    • compile-link-runtime fixture: 184/184 symbols linked and runtime matrix passed;
    • Home audit: 185/431 implemented, 246 pending;
    • Bun audit: 179/421 implemented, 242 pending;
    • public audit: 117/117 public, 19 extensions, 189 private/support exports;
    • batched build/audit gate: 12/12 steps succeeded.

    The README retains the current July 17 isolated 1,540-sample JSC benchmark report unchanged because this ABI-only slice does not alter or rerun benchmarked engine paths.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions