ashvardanian / ashvardanian/StringZilla
Standard-compliant `wc` implementation
- Dominant language
- C
- Stars
- 3.6k
- Forks
- 135
- PR merge metrics
- No merged PRs in 30d
Description
The 4c738ea446cb8f9041077ac6364557527e8fc427 commit introduces a prototype for StringZilla-based Command-Line toolkit, including the `wc` utility replacement. The original prototype suggests a **3x performance improvement** opportunity, but it can't currently handle multiple inputs and flags. Those must be easy to add in `cli/wc.py` purely in the Python layer. We are aiming to match the following specification:
```bash
$ wc --help
Usage: wc [OPTION]... [FILE]...
or: wc [OPTION]... --files0-from=F
Print newline, word, and byte counts for each FILE, and a total line if
more than one FILE is specified. A word is a non-zero-length sequence of
characters delimited by white space.
With no FILE, or when FILE is -, read standard input.
The options below may be used to select which counts are printed, always in
the following order: newline, word, character, byte, maximum line length.
-c, --bytes print the byte counts
-m, --chars print the character counts
-l, --lines print the newline counts
--files0-from=F read input from the files specified by
NUL-terminated names in file F;
If F is - then read names from standard input
-L, --max-line-length print the maximum display width
-w, --words print the word counts
--help display this help and exit
--version output version information and exit
GNU coreutils online help:
Report any translation bugs to
Full documentation
or available locally via: info '(coreutils) wc invocation'
```
Contributor guide
Research direction
Start with cli/wc.py and compare its current behavior with the GNU wc specification in the issue. Implement multiple inputs and the listed flags in the Python layer, including totals and standard-input handling, then verify the output and option ordering against the documented examples and requirements.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100