fancy-regex
cw
fancy-regex | cw | |
---|---|---|
5 | 5 | |
387 | 100 | |
2.6% | - | |
7.9 | 0.0 | |
3 months ago | over 1 year ago | |
Rust | Rust | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
fancy-regex
-
lemmeknow v0.7.0 is here with support for identifying bytes with help of regex crate!
https://github.com/fancy-regex/fancy-regex/issues/84 it's still open issue
-
Debian Running on Rust Coreutils
Ahh, very interesting, thanks for sharing! Do you have any thoughts around why that is? I presume that's due to Oniguruma supporting a much broader feature set and something like fancy-regexp's approach with mixing a backtracking VM and NFA implementation for simple queries would be needed for better perf? (I am aware you played a role in that) [1]
I have been playing around with regex parsing through building parsers through parser combinators at runtime recently, no clue how it will perform in practice yet (structuring parser generators at runtime is challenging in general in low-level languages) but maybe that could pan out and lead to an interesting way to support broader sets of regex syntaxes like POSIX in a relatively straightforward and performant way.
[1] https://github.com/fancy-regex/fancy-regex#theory
- Fancy-Regex: A hybrid NFA and backtracking Regex library in Rust
-
An additional non-backtracking RegExp engine
Not an expert but fancy regex is a Rust library that uses a hybrid approach to detect whether a sub expression contains backtracking and delegates to the appropriate engine.
https://github.com/fancy-regex/fancy-regex
cw
-
why GNU grep is fast
For things that are commonly and almost-ideally represented as text files, there’s a lot of Rust based alternatives are faster and have more features than the old unix/GNU tools: ripgrep, fd, cw, and you can find more in this list.
-
A wc clone, written in Go
Nice, beats my old Rust wc through sheer brute force on my old 12c/24t server:
-
How to learn Rust by own tiny applications?
A lot of unix-y tools have been rewritten in rust, where the usefulness comes from it being faster or having more features. Examples: bat, cw, lsd, ripgrep, diskonaut, gping. Maybe you could find an interesting program to rewrite?
-
Awesome Rewrite It In Rust - A curated list of replacements for existing software written in Rust
cw, an optionally-multithreaded bytecount-accelerated wc clone
-
Debian Running on Rust Coreutils
Having written a Rust wc implementation a few years ago (https://github.com/Freaky/cw), I had a look at theirs.
It's pretty naive - a simple linewise read_until loop, a conditional to avoid word splitting and such if it's not needed, and for some reason it collects results into an array and prints when it's done rather than printing as it goes.
It doesn't support --files0-from like GNU wc, so isn't a drop-in replacement from that perspective. It also has the sadly common Rust trope of only supporting filenames that are valid UTF-8.
It doesn't seem overly slow considering its simplicity - usually trading blows with GNU and BSD wc. Perhaps the most glaring omission is the lack of a fast path for -c, which should reduce to a stat() call. Also unfortunate not to use the excellent bytecount crate to provide a very fast -l/m path.
The read_until loop also makes its memory use unpredictable compared with other wc's. If you run it on /dev/zero it will try to eat your computer.
What are some alternatives?
min-sized-rust - 🦀 How to minimize Rust binary size 📦
gping - Ping, but with a graph
pomsky - A new, portable, regular expression language
CompactGUI - Transparently compress active games and programs using Windows 10/11 APIs [Moved to: https://github.com/IridiumIO/CompactGUI]
just - 🤖 Just a command runner
regex - An implementation of regular expressions for Rust. This implementation uses finite automata and guarantees linear time matching on all inputs.
fab-rs - The fabulous, aspirationally Make-compatible, fabricator of files.
ht - Friendly and fast tool for sending HTTP requests
BSDCoreUtils - BSD coreutils is a port of many utilities from BSD to Linux and macOS.
nushell - A new type of shell
awesome-rewrite-it-in-rust - A curated list of replacements for existing software written in Rust [Moved to: https://github.com/TaKO8Ki/awesome-alternatives-in-rust]