Command-line utilities are the gateway to learning any programming language. They have simplified input and output systems which makes the code less complex to write. This allows you to focus on the problem at hand and learn Rust instead of learning a specific problem domain.
Rewriting existing tools in Rust can provide a great baseline to get started:
echo
: repeats inputcat
: concatenates filesls
: list directoriesfind
: locate files or directgoriesgrep
: matches text in files
Add extra flags to the tools to enhance their feature set Use proper error handling so the programs don't end prematurely (no .unwrap() and no .expect()) Add multi-threading support. find and grep are good candidates for this Add colorized output
The Rust standard library is light on features, so here are some foundation crates that are great to use in nearly any project:
- thiserror: Make custom error types
- color-eyre: Report application errors
- clap: Process command line arguments
- serde: Serialize and de-serialize data structures