ripgrep
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
- 70k
- Rust
- Unlicense
- 13 h ago
An ECMAScript regex engine designed for explicit host memory ownership.
Repo PerryTS/perex, read from GitHub 1 min ago. PerryTS has not joined Take My Repo.
PerryTS/perex is a public repo on GitHub by PerryTS. An ECMAScript regex engine designed for explicit host memory ownership. It declares the MIT license on GitHub. It is written mainly in Rust, has 14 stars and last changed on 2026-11-18. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-22.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
An independent ECMAScript regex engine for Perry and other embedders that own their memory.
Perex is Perry's only regular-expression engine: its runtime's RegExp, string methods and glob matching, and its CLI's own patterns, all run on it. One evaluator implements matching, numbered and named captures, repetition, scoped flags, assertions and backreferences over caller-owned storage and the original subject bytes. A search can pause at any instruction, release every borrow, and resume against storage a moving collector has relocated.
Against every pattern harvested from Test262 — 48,718 compared cases — Perex and V8 make the same syntax decision and produce the same complete answer on every one, with nothing reported unsupported; see conformance. The crate has no dependencies and uses no standard library.
Against V8, on the twenty cases both drivers in bench/ run, Perex is at or better than V8 at both of its entry points on seventeen, taking whichever of its two execution paths its own rule picks rather than the better of the two. The three behind are <class>+<literal> shapes the rule hands to the interpreter. The compilation tier generates AArch64 and x86-64 from one analysis and verifies both; what a host still owes it is mapping the code and calling it. docs/performance.md records the figures, the method, and every measurement that refuted an idea, which is the standard this project holds its own claims to.
Perex is designed around one matching engine and explicit host memory ownership:
The API is Rust and never allocates. An owned-buffer convenience layer belongs in the embedder over the same core, as Perry's adapter does.
cargo add perex
The engine never allocates. A caller supplies the arena a pattern is parsed into, the buffer its program is written to, and the registers, frames and undo trail a search runs on:
use perex::{Budget, compiler::{Node, Range, compile}, executor::{Frame, Scratch, Undo, find}, input::Input, span::Span}; let pattern = Input::utf8(r"(\w+)@(\w+)\.com"); let mut nodes = vec![Node::default(); 256]; let mut ranges = vec![Range::default(); 512]; let mut words = vec![0u32; 2048]; let mut budget = Budget::new(1_000_000); let program = compile(pattern, "", &mut nodes, &mut ranges, &mut words, &mut budget).unwrap(); let mut registers = vec![0usize; program.register_count()]; let mut frames = vec![Frame::default(); 256]; let mut undo = vec![Undo::default(); 1024]; let mut captures = vec![None::<Span>; program.capture_count()]; let mut budget = Budget::new(1_000_000); let found = find( program, Input::utf8("mail user@example.com now"), 0, Scratch { registers: &mut registers, frames: &mut frames, undo: &mut undo }, &mut captures, &mut budget, ).unwrap(); assert!(found); assert_eq!(captures[0].map(|s| (s.start(), s.end())), Some((5, 21))); assert_eq!(captures[1].map(|s| (s.start(), s.end())), Some((5, 9)));
That example is examples/basic.rs, so it is compiled by
cargo check --all-targets and cannot rot.
Budget bounds a whole compile or search and is never reset per start position,
so a pattern cannot spend unbounded time on a subject. The buffers above are
Vec for brevity; nothing requires them to be.
bench/ holds two development-only drivers: a cross-engine comparison
against regress, regex and fancy-regex, and a comparison against V8 at
both of its entry points. A third maps and executes what the compilation tier
emits. See bench/README.md.
| Perex owns | The embedding host owns |
|---|---|
| Pattern parsing, compilation and matching | GC roots, tracing, relocation and object layout |
| Unicode rules, captures and input cursor semantics | Program/scratch allocation policy and lifetime |
| Program representation and execution state | JS objects, lastIndex, callbacks and string operations |
| Engine conformance, fuzzing and microbenchmarks | Whole-application correctness, CPU and memory measurements |
Perex does not depend on perry-runtime. Perry depends on the published crate through thin adapters: a traced, relocation-aware one in its runtime and an owned-buffer one for its build tooling. This repository is the one authoritative engine source.
Start with the implemented engine and its limits, architecture, the memory contract, and the implementation milestones. The research notes explain the source material and what existing engine tests do and do not establish.
The compilation plan separates parsing from final storage allocation without retaining the original pattern view or resetting work.
The input API reads the original string, including individual surrogate halves inside four-byte UTF-8 characters. Capture spans borrow those units without constructing substrings. span::BoundSpan traverses captures in bounded steps across owner relocation, including initial seeking, so a host can allocate exact output strings without a subject conversion buffer. Its consumer callback runs inside the input borrow; allocation and collection belong between steps. Validation, seeking and relocation costs are documented explicitly. The performance requirements preserve per-case CPU and RSS results alongside complete host measurements.
Starting from a position lets a search or span reader begin where the previous one on the same subject ended, so a global loop over a non-ASCII byte string does linear seek work rather than seeking from an end every time.
Binding what the host already validated takes a subject's known length and a program's validation witness in constant work, so a host that searches once per call does not revalidate the whole string and program every time.
BoundSpan::retarget selects another span of the same immutable binding and reuses
the current offset when it shortens the seek. Adjacent reads need no prefix
rescan or subject index. Seeking still consumes the caller's cumulative work
budget in bounded steps; retargeting cannot revive a failed reader.
Release notes are in the changelog.
cargo fmt --all -- --check cargo check --locked --all-targets cargo clippy --locked --all-targets -- -D warnings cargo test --locked cargo test --locked --release cargo test --locked --release --features selectable-unicode --lib properties::tests python3 tools/generate-casefold.py --check python3 tools/generate-properties.py --check cargo run --locked --release --example compilable cargo build --locked --release --example input_probe node tools/check-input.mjs target/release/examples/input_probe cargo build --locked --release --example engine_probe node tools/check-engine.mjs target/release/examples/engine_probe --allow-listed-unsupported --allow-reviewed-reference-disagreements node tools/check-casefold.mjs target/release/examples/engine_probe node tools/check-names.mjs target/release/examples/engine_probe node tools/check-legacy.mjs target/release/examples/engine_probe node tools/check-admission.mjs target/release/examples/engine_probe node tools/check-repetition.mjs target/release/examples/engine_probe node tools/check-atom-filter.mjs target/release/examples/engine_probe artifacts/atom-filter node tools/check-atom-filter.mjs target/release/examples/engine_probe artifacts/atom-filter-q1 --quantum 1 --relocate --grow node tools/check-atom-filter.mjs target/release/examples/engine_probe artifacts/atom-filter-q17 --quantum 17 --relocate --grow PEREX_DFA=1 node tools/check-engine.mjs target/release/examples/engine_probe --allow-listed-unsupported --allow-reviewed-reference-disagreements PEREX_DFA=small node tools/check-engine.mjs target/release/examples/engine_probe --allow-listed-unsupported --allow-reviewed-reference-disagreements node tools/check-dfa-fuzz.mjs target/release/examples/engine_probe artifacts/dfa-fuzz --seed 1 --cases 20000 node tools/check-modifiers.mjs target/release/examples/engine_probe node tools/check-unicode-sets.mjs target/release/examples/engine_probe artifacts/unicode-sets node tools/check-sets.mjs target/release/examples/engine_probe artifacts/sets --allow-reviewed-reference-disagreements node tools/check-sequences.mjs target/release/examples/engine_probe artifacts/sequences node tools/check-sequences.mjs target/release/examples/engine_probe artifacts/sequences-q1 --quantum 1 --relocate --grow node tools/check-candidate.mjs target/release/examples/engine_probe artifacts/candidate node tools/check-end-candidate.mjs target/release/examples/engine_probe artifacts/end-candidate node tools/check-end-candidate.mjs target/release/examples/engine_probe artifacts/end-candidate-q1 --quantum 1 --relocate --grow node tools/check-end-candidate.mjs target/release/examples/engine_probe artifacts/end-candidate-q17 --quantum 17 --relocate --grow node tools/check-candidate.mjs target/release/examples/engine_probe artifacts/candidate-q1 --quantum 1 --relocate --grow node tools/check-candidate.mjs target/release/examples/engine_probe artifacts/candidate-q17 --quantum 17 --relocate --grow node tools/check-classes.mjs target/release/examples/engine_probe artifacts/classes node tools/check-classes.mjs target/release/examples/engine_probe artifacts/classes-q1 --quantum 1 --relocate --grow node tools/check-classes.mjs target/release/examples/engine_probe artifacts/classes-q17 --quantum 17 --relocate --grow cargo build --locked --release --example property_probe node tools/check-properties.mjs target/release/examples/property_probe target/release/examples/engine_probe --allow-reviewed-reference-disagreements node tools/check-test262.mjs target/release/examples/engine_probe /path/to/test262 artifacts/test262 --work 64000000 node tools/reference.mjs --check node --test tools/reference.test.mjs
The semantic fixture oracle requires Node 26.8.1 in CI. The fixture receipt records the exact Node/V8/Unicode versions that generated the committed expected answers. check-input.mjs compares the implemented Perex cursors with Node string operations and Unicode RegExp starting positions. The separate reference.mjs checks validate the reference fixtures and comparator; they do not themselves test Perex matching. check-engine.mjs runs the actual matcher and reports its exact omissions and reviewed reference disagreement; strict mode is required before claiming full reference parity.
An engine harness can emit the documented JSONL answers and compare them using:
node tools/reference.mjs --compare /path/to/candidate.jsonl
See contributing for fixtures, source attribution and validation expectations. Licensed under MIT.
Case equivalence uses generated Unicode 17.0.0 data under the Unicode License V3. Pinned inputs, hashes and generation rules are documented in case folding.
Unicode character properties use shared immutable data and compact property references in programs. Their exhaustive membership check preserves the documented Node disagreement on the empty historical Hrkt script; strict mode remains available and fails on that discrepancy.
Named captures keep packed names and numeric capture lists inside the relocatable program. Matching and backreferences continue to borrow the original subject.
Required-text admission uses a condition proved by the compiler and original subject storage. Its correctness and CPU/RSS costs require separate checks.
Candidate-start scanning skips impossible ASCII start positions using the same evaluator and original storage. Complete-answer and relocation checks precede performance claims.
Bounded end-anchored starts skip the whole prefix a match anchored at the subject's end cannot begin in, which removed a 256 KiB scan from 305,825 work units to 24.
Unicode sets implements the v grammar: union, ranges, nesting, the set operators, nested complements, string members, the properties of strings, its escaping and reserved-punctuation rules, and its complement-after-folding rule. A property of strings is a shared table of sequences and a program reference to it, never members copied into a program.
Test262 pattern conformance compares every pattern harvested from the suite's regular-expression tests against Node, for syntax acceptance and complete match answers. There is no remaining gap: 48,718 cases compared, nothing unsupported and no difference, on the harvest recorded there.
The lazy automaton answers whether a program matches, and where its match begins and ends, in a few instructions per character from states it builds on demand in a cache the host owns, for programs without backreferences, lookaround or properties of strings. dfa::captures also reads every capture group off a transition's single path when the program is one-pass at the match, and declines to the evaluator otherwise; every differential harness compares the two.
Branches lay alternation out flat and skip an alternative, and its backtracking frame, when the next character cannot begin it, by a first-character set re-derived from the instructions during validation.
Leading literal starts reject an impossible start with a byte comparison instead of an initialized trial. The claim is re-derived from the instructions during program validation, so it cannot disagree with them.
Required-text admission also bounds where a match can begin when the condition is one the match itself consumes, so text present only before every possible start stops the search instead of retrying it.
Skipping a failed start's run removes the starts inside a leading atom repeat's run once one of them has failed, since each reaches a subset of the positions the first one tried.
Single-atom repetition merging removes duplicate partitions when match ordering can be preserved, using the same evaluator and caller-owned storage.
The optional selectable-unicode feature lets an embedder omit the Unicode
membership database when it proves that no pattern or imported program needs
it. Call perex::install_unicode_properties() before compiling or validating
arbitrary patterns/programs, including non-ASCII capture names. Installation is
idempotent and safe across threads. Missing installation panics on that cold
path, before a program needing membership can be published.
Compilation and validation resolve the provider once, on the first property or
non-ASCII identifier query. The validated Program view and ProgramWitness
retain the native membership function and the selected DFA entry points.
Evaluator and atom membership calls invoke the cached function. The DFA is one
implementation generic over a zero-sized provider: Unicode membership calls
inline into its character-class builder, while property-free programs select
an instantiation with no database reference. A search calls its cached entry
once; its character loops use static dispatch. Neither executor reads the
installation slot or checks whether it is filled. Rebinding a witnessed program, relocation and resumed searches
reuse the same capability. Property-free patterns never read the slot.
Program words remain relocation-safe property IDs: no native pointer is stored in the bytecode, and format 16 is unchanged. Hosts may move program storage between borrows; witnesses are process-local, not serialization metadata. Descriptors, property names, case folding and properties-of-strings data remain independent. The default build remains no_std with direct membership calls; the optional feature uses std and adds no dependencies or unsafe code. Cargo feature unification applies this initialization contract to every user of the same Perex instance.
PerryTS/perex is a public repo on GitHub by PerryTS. An ECMAScript regex engine designed for explicit host memory ownership.
It declares the MIT license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-11-18. GitHub counts 0 open issues and pull requests. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
A simple, fast and user-friendly alternative to 'find'
Official brand assets and guidelines for Perry — the TypeScript → Native compiler
:fire: Android developers should collect the following utils(updating).
UDP datagram socket bindings (Node `dgram` module) for the Perry TypeScript-to-native compiler. Closes PerryTS/perry#492.

A native TypeScript/JavaScript compiler written in Rust. Compiles TypeScript/JavaScript directly to executables using SWC and LLVM.

A fast, native JSON viewer built with Perry — TypeScript compiled to native ARM64
Pure-TypeScript Redis / Valkey wire-protocol driver. Runs unchanged on Node.js + Bun, AOT-compiles to a native binary via Perry (LLVM).
React-compatible renderer for Perry native desktop apps — write React/JSX, compile to native
Embeddable, cross-platform event-loop driver that the host turns: bounded turn(), completion-shaped I/O on epoll, kqueue, IOCP, WASI and the web.
Pure-TypeScript Postgres wire-protocol driver. Zero native dependencies. Runs on Perry, Node.js, and Bun.
This page is also available as structured data, with the same sources and dates.
/api/v1/resources/gh/PerryTS/perexTake My Repo has not tested this on your machine. Requirements come from the project's own documentation.