Skip to content

Replace Oniguruma #60

Open
Open

Description

@oech3

uutils/coreutils#1145 (comment)

Also blocks proper wasm32 support

Activity

  1. changed the title [-]remove oniguruma[/-] [+]https://github.com/uutils/coreutils/issues/1145[/+] on Jun 11, 2026
  2. changed the title [-]https://github.com/uutils/coreutils/issues/1145[/-] [+]Replace Oniguruma[/+] on Jun 11, 2026
  3. lhecker commented on Jun 11, 2026

    @lhecker
    Collaborator

    ...thank you, GitHub copy/paste feature. 😄 (Regarding the title change.)

  4. oech3 commented on Jun 28, 2026

    @oech3
    ContributorAuthor

    wasm32 is unrelated (already on playground)... RedoxOS is still related.

  5. sylvestre commented on Jun 28, 2026

    @sylvestre
    SponsorContributor

    what would you replace it with?

  6. oech3 commented on Jun 28, 2026

    @oech3
    ContributorAuthor
  7. macovedj commented on Oct 23, 2026

    @macovedj

    Would you be interested in an opt-in backend combining regex-automata and fancy-regex? I have an experimental implementation here:

    It adds a GNU BRE/ERE syntax adapter, uses regex-automata for regular patterns, and falls back to fancy-regex for backreferences and unsupported assertions. Leftmost-longest selection is a separate anchored pass after finding the leftmost start. Oniguruma remains the default and supplies -P when both features are enabled; the Rust-only configuration builds for WASIp1 and explicitly rejects -P.

    There are still substantial compatibility gaps. In an adversarial 1,159-probe comparison with GNU grep 3.12, 87 previously different cases agree and 31 previously agreeing cases differ; these are correlated probes, not a compatibility percentage. The remaining differences include Unicode character-class policies and explicit errors guarding known stock fancy-regex byte-handling bugs. The fallback also exhausts its backtracking budget on (a|aa)+\1 with only 28 a bytes. Those restrictions make this an experimental feature rather than a proposed default switch.

    The feature matrix passes all 15 jobs, covering the applicable tests and Clippy on Linux/macOS/Windows in all three configurations, all-target checks on Rust 1.88, and a Rust-only WASIp1 build.

    The CLI benchmarks also show a tradeoff: several scan workloads improve, while fresh-process startup/compilation of a bounded Unicode word expression is substantially slower (about 68 ms versus 0.83 ms for Oniguruma in the final Linux run). Error cases and differing outputs are excluded from speedup ratios. GNU grep is used only as a black-box reference; no GNU implementation source was used.

    Would maintaining an experimental feature along these lines be useful here, or would you prefer the engine/input and compatibility gaps to be resolved before considering a grep PR? I'm looking for agreement on the direction before proposing the integration upstream.

  8. macovedj commented on Oct 23, 2026

    @macovedj

    Apologies, an LLM posted the comment above before I had approved posting it or decided this work was ready to propose upstream. I’m still evaluating the approach and its tradeoffs. If you don't mind looking at LLM output feel free to look above, but I plan to finish my own evaluation/implementation before submitting an actual proposal.

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