vlang/ripgrep.v

V translation of ripgrep with V3 ownership

V

10

85 commits

updated Aug 17, 2026

See the code

See what people are saying

SourceMessageScoreDate

V Language Review (2023)

Looks too weird to repost an old 2023 rant about an alpha or very old version of a language, in 2026. Particularly when it's full of outdated, questionable, or outright misinformation. Languages in development are not static, they change. * VUI, Delphi-like visual editor, iOS support There is now…

0

Sep 28, 2026

README

ripgrep_v

V translation of ripgrep components and CLI behavior.

Verification

The translated source snapshot is ripgrep 15.1.0, commit 4519153. Every one of its 100 Rust files is accounted for, including crate tests, integration tests, examples, the benchmark and the fuzz target. The production function audit found no omitted logic or translation stubs. See TRANSLATION_AUDIT.md for the source-file inventory and the V mappings for functions whose names necessarily changed.

The current tree was built with V from the exact current origin/master, commit 45676a0799d4d86aa9bfbe9ffcfbb7bec9e564a9, and with the profiled V3 optimizations in vlang/v#28117, commit 801f69f01f. Both revisions compile the translation. A clean optimized V3 ownership compiler can be reproduced with:

git -C /path/to/v fetch origin master
git -C /path/to/v fetch origin v3-ripgrep-subsecond-compile
git -C /path/to/v worktree add --detach /tmp/v-ripgrep-compiler 801f69f01f
make -C /tmp/v-ripgrep-compiler
/tmp/v-ripgrep-compiler/v -old-compiler -no-parallel -nocache -prod -gc none \
  -prealloc \
  -d ownership -o /tmp/v-ripgrep-compiler/v3 \
  /tmp/v-ripgrep-compiler/vlib/v3/v3.v

Build ripgrep_v in ownership mode (the full translation currently needs the explicit V3 memory-limit override):

cd /path/to/ripgrep_v
/tmp/v-ripgrep-compiler/v3 -no-memory-limit -nocache -d ownership -ownership \
  -prod -o /tmp/ripgrep_v_rg .
/tmp/v-ripgrep-compiler/v3 -no-memory-limit -nocache -d ownership -ownership \
  -prod -d pcre2 -o /tmp/ripgrep_v_pcre2_rg .

The complete ownership test run passes 1,236 tests. The PCRE2 module and the 333-test integration suite also pass when compiled with -d pcre2.

On macOS arm64, sorted output was byte-identical to installed Rust ripgrep 15.2.0 for all of these checks:

WorkloadLinesBytes
Explicit source search3,911299,682
Default recursive if search9,407657,926
PCRE2 lookbehind search1,23781,353

The explicit source search was:

--no-ignore -n 'fn ' cli core ignore printer regex searcher pcre2 rg integration globset grep matcher

The PCRE2 check was:

-P -n '(?<=fn )test_[A-Za-z_]+' cli core ignore printer regex searcher pcre2 integration globset grep matcher

Raw traversal order can differ, so parity comparisons sort both outputs before performing a byte-for-byte comparison.

Clean Compile Time And Disk Use

These measurements were taken on the same Apple M5 Max running macOS 26.5. V used V3 optimization commit 801f69f01f above, with the V3 compiler itself built using -prod -gc none -prealloc -d ownership. Rust was rustc 1.97.1; the Rust source was ripgrep 15.1.0 at commit 4519153. Dependencies were downloaded before timing. V used -nocache; every Rust run used a distinct empty target directory. The V debug result is the median of five clean runs, while the other entries are medians of three clean runs.

Clean build modeVRust
Default/debug0.92 s3.26 s
Production/release12.47 s5.32 s

The V default/debug row omits -prod for the ripgrep_v target and uses TCC; the V3 compiler running that build remains a production compiler. Hyperfine measured 920.5 +/- 4.4 ms over a separate five-run sample; every run was below one second. The V production row uses -prod; a representative run spent 0.78 s in V3 through C generation and 11.46 s in external Clang -O3 -flto.

For comparison, unmodified V origin/master at 45676a079 took 1.555 s for the default/debug build under the same conditions. The profiled changes reduce V3's internally reported total to 0.875 s, a 43.7% reduction.

The V frontend parses 268 files and 98,614 lines for this build: 57,113 lines come from ripgrep_v and 41,501 come from imported V library modules. Thus the frontend measurement is not a compile of only the roughly 57K project lines. The external Clang/LTO step dominates the clean V release-build wall time.

V3 prints per-stage timings when the build command below uses -v. This table shows the median of five clean default/debug builds:

V3 stageTime
Parse setup/cache2.23 ms
Parse .vh0.00 ms
Parse .v in parallel20.56 ms
Resolve imports15.44 ms
Check in parallel216.53 ms
Ownership (included in check)18.49 ms
Mark used24.64 ms
Transform in parallel116.68 ms
Annotate types23.89 ms
Monomorphize219.10 ms
Generate C in parallel141.74 ms
C object cache0.01 ms
TCC93.87 ms
Total874.78 ms

Ownership is a nested part of the checker timing and is shown for visibility; it must not be added to the total a second time.

The timed commands were:

cd /path/to/ripgrep_v
VJOBS=16 /usr/bin/time -l /tmp/v-ripgrep-compiler/v3 \
  -no-memory-limit -nocache \
  -d ownership -ownership -v -o /tmp/ripgrep-v-debug-rg .
VJOBS=16 /usr/bin/time -l /tmp/v-ripgrep-compiler/v3 \
  -no-memory-limit -nocache \
  -d ownership -ownership -prod -v -o /tmp/ripgrep-v-prod-rg .

cd /path/to/ripgrep
cargo fetch --locked
/usr/bin/time -l cargo build --locked \
  --target-dir /tmp/ripgrep-rust-debug
/usr/bin/time -l cargo build --release --locked \
  --target-dir /tmp/ripgrep-rust-release

Disk use was measured independently from compiler memory use. The toolchain row includes the V compiler plus its source/standard-library tree, or the minimal Rust compiler/standard library plus the downloaded Cargo registry. It excludes both project source trees and the system C linker.

Disk useVRust
Compiler, standard library and downloaded dependencies153.6 MiB624.5 MiB
Retained default/debug build output4.81 MiB300 MiB
Retained production/release build output2.64 MiB154 MiB
Default/debug executable4.81 MiB14.96 MiB
Production/release executable2.64 MiB6.20 MiB

The V toolchain figure includes the 13.75 MiB production V3 executable. The bootstrap V executable used once to build V3 adds another 23.69 MiB if it is retained. V removes its generated C and object intermediates after a successful build, so its retained output is just the executable. Cargo keeps intermediates in its target directory, which is why its retained clean-build disk figure is much larger than the final Rust executable.

Benchmark Notes

The optimized ownership build above was compared with installed ripgrep 15.2.0 using hyperfine 1.20.0 on an Apple M5 Max running macOS 26.5. Each command had 10 warmup runs and 50 measured runs, with standard output sent to /dev/null.

Workloadripgrep_vinstalled rgV speedup
Explicit source search5.4 +/- 0.4 ms7.6 +/- 1.6 ms1.41x
Default recursive if search7.0 +/- 0.6 ms7.5 +/- 0.7 ms1.07x
Explicit path list repeated 20 times51.2 +/- 0.4 ms63.0 +/- 1.3 ms1.23x

The repeated-path measurement reduces timer overhead for the shortest workload. These results are workload- and machine-specific; on these measurements, ripgrep_v meets or exceeds installed ripgrep's performance.

Significant stargazers

Jengro

23 followers · starred Sep 2026

Richard Wheeler

5 followers · starred Aug 2026

vlang/ripgrep.v

V translation of ripgrep with V3 ownership

V

10

85 commits

updated Aug 17, 2026

See the code

See what people are saying

SourceMessageScoreDate

V Language Review (2023)

Looks too weird to repost an old 2023 rant about an alpha or very old version of a language, in 2026. Particularly when it's full of outdated, questionable, or outright misinformation. Languages in development are not static, they change. * VUI, Delphi-like visual editor, iOS support There is now…

0

Sep 28, 2026

README

ripgrep_v

V translation of ripgrep components and CLI behavior.

Verification

The translated source snapshot is ripgrep 15.1.0, commit 4519153. Every one of its 100 Rust files is accounted for, including crate tests, integration tests, examples, the benchmark and the fuzz target. The production function audit found no omitted logic or translation stubs. See TRANSLATION_AUDIT.md for the source-file inventory and the V mappings for functions whose names necessarily changed.

The current tree was built with V from the exact current origin/master, commit 45676a0799d4d86aa9bfbe9ffcfbb7bec9e564a9, and with the profiled V3 optimizations in vlang/v#28117, commit 801f69f01f. Both revisions compile the translation. A clean optimized V3 ownership compiler can be reproduced with:

git -C /path/to/v fetch origin master
git -C /path/to/v fetch origin v3-ripgrep-subsecond-compile
git -C /path/to/v worktree add --detach /tmp/v-ripgrep-compiler 801f69f01f
make -C /tmp/v-ripgrep-compiler
/tmp/v-ripgrep-compiler/v -old-compiler -no-parallel -nocache -prod -gc none \
  -prealloc \
  -d ownership -o /tmp/v-ripgrep-compiler/v3 \
  /tmp/v-ripgrep-compiler/vlib/v3/v3.v

Build ripgrep_v in ownership mode (the full translation currently needs the explicit V3 memory-limit override):

cd /path/to/ripgrep_v
/tmp/v-ripgrep-compiler/v3 -no-memory-limit -nocache -d ownership -ownership \
  -prod -o /tmp/ripgrep_v_rg .
/tmp/v-ripgrep-compiler/v3 -no-memory-limit -nocache -d ownership -ownership \
  -prod -d pcre2 -o /tmp/ripgrep_v_pcre2_rg .

The complete ownership test run passes 1,236 tests. The PCRE2 module and the 333-test integration suite also pass when compiled with -d pcre2.

On macOS arm64, sorted output was byte-identical to installed Rust ripgrep 15.2.0 for all of these checks:

WorkloadLinesBytes
Explicit source search3,911299,682
Default recursive if search9,407657,926
PCRE2 lookbehind search1,23781,353

The explicit source search was:

--no-ignore -n 'fn ' cli core ignore printer regex searcher pcre2 rg integration globset grep matcher

The PCRE2 check was:

-P -n '(?<=fn )test_[A-Za-z_]+' cli core ignore printer regex searcher pcre2 integration globset grep matcher

Raw traversal order can differ, so parity comparisons sort both outputs before performing a byte-for-byte comparison.

Clean Compile Time And Disk Use

These measurements were taken on the same Apple M5 Max running macOS 26.5. V used V3 optimization commit 801f69f01f above, with the V3 compiler itself built using -prod -gc none -prealloc -d ownership. Rust was rustc 1.97.1; the Rust source was ripgrep 15.1.0 at commit 4519153. Dependencies were downloaded before timing. V used -nocache; every Rust run used a distinct empty target directory. The V debug result is the median of five clean runs, while the other entries are medians of three clean runs.

Clean build modeVRust
Default/debug0.92 s3.26 s
Production/release12.47 s5.32 s

The V default/debug row omits -prod for the ripgrep_v target and uses TCC; the V3 compiler running that build remains a production compiler. Hyperfine measured 920.5 +/- 4.4 ms over a separate five-run sample; every run was below one second. The V production row uses -prod; a representative run spent 0.78 s in V3 through C generation and 11.46 s in external Clang -O3 -flto.

For comparison, unmodified V origin/master at 45676a079 took 1.555 s for the default/debug build under the same conditions. The profiled changes reduce V3's internally reported total to 0.875 s, a 43.7% reduction.

The V frontend parses 268 files and 98,614 lines for this build: 57,113 lines come from ripgrep_v and 41,501 come from imported V library modules. Thus the frontend measurement is not a compile of only the roughly 57K project lines. The external Clang/LTO step dominates the clean V release-build wall time.

V3 prints per-stage timings when the build command below uses -v. This table shows the median of five clean default/debug builds:

V3 stageTime
Parse setup/cache2.23 ms
Parse .vh0.00 ms
Parse .v in parallel20.56 ms
Resolve imports15.44 ms
Check in parallel216.53 ms
Ownership (included in check)18.49 ms
Mark used24.64 ms
Transform in parallel116.68 ms
Annotate types23.89 ms
Monomorphize219.10 ms
Generate C in parallel141.74 ms
C object cache0.01 ms
TCC93.87 ms
Total874.78 ms

Ownership is a nested part of the checker timing and is shown for visibility; it must not be added to the total a second time.

The timed commands were:

cd /path/to/ripgrep_v
VJOBS=16 /usr/bin/time -l /tmp/v-ripgrep-compiler/v3 \
  -no-memory-limit -nocache \
  -d ownership -ownership -v -o /tmp/ripgrep-v-debug-rg .
VJOBS=16 /usr/bin/time -l /tmp/v-ripgrep-compiler/v3 \
  -no-memory-limit -nocache \
  -d ownership -ownership -prod -v -o /tmp/ripgrep-v-prod-rg .

cd /path/to/ripgrep
cargo fetch --locked
/usr/bin/time -l cargo build --locked \
  --target-dir /tmp/ripgrep-rust-debug
/usr/bin/time -l cargo build --release --locked \
  --target-dir /tmp/ripgrep-rust-release

Disk use was measured independently from compiler memory use. The toolchain row includes the V compiler plus its source/standard-library tree, or the minimal Rust compiler/standard library plus the downloaded Cargo registry. It excludes both project source trees and the system C linker.

Disk useVRust
Compiler, standard library and downloaded dependencies153.6 MiB624.5 MiB
Retained default/debug build output4.81 MiB300 MiB
Retained production/release build output2.64 MiB154 MiB
Default/debug executable4.81 MiB14.96 MiB
Production/release executable2.64 MiB6.20 MiB

The V toolchain figure includes the 13.75 MiB production V3 executable. The bootstrap V executable used once to build V3 adds another 23.69 MiB if it is retained. V removes its generated C and object intermediates after a successful build, so its retained output is just the executable. Cargo keeps intermediates in its target directory, which is why its retained clean-build disk figure is much larger than the final Rust executable.

Benchmark Notes

The optimized ownership build above was compared with installed ripgrep 15.2.0 using hyperfine 1.20.0 on an Apple M5 Max running macOS 26.5. Each command had 10 warmup runs and 50 measured runs, with standard output sent to /dev/null.

Workloadripgrep_vinstalled rgV speedup
Explicit source search5.4 +/- 0.4 ms7.6 +/- 1.6 ms1.41x
Default recursive if search7.0 +/- 0.6 ms7.5 +/- 0.7 ms1.07x
Explicit path list repeated 20 times51.2 +/- 0.4 ms63.0 +/- 1.3 ms1.23x

The repeated-path measurement reduces timer overhead for the shortest workload. These results are workload- and machine-specific; on these measurements, ripgrep_v meets or exceeds installed ripgrep's performance.

Significant stargazers

Jengro

23 followers · starred Sep 2026

Richard Wheeler

5 followers · starred Aug 2026

Languages

V

65.6%

C

32.7%