Why I switched from Python to Rust for CLI tools
I love Python. But for CLI tools that need to be fast and distributable, Rust wins:
| Metric | Python | Rust |
|---|---|---|
| Startup time | ~50ms | ~1ms |
| Binary size | 30MB+ | 2-5MB |
| Distribution | pip + venv hell | Single binary |
use clap::Parser;
#[derive(Parser)]
struct Cli {
pattern: String,
path: std::path::PathBuf,
}
fn main() {
let args = Cli::parse();
}