#python

Kai

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:

MetricPythonRust
Startup time~50ms~1ms
Binary size30MB+2-5MB
Distributionpip + venv hellSingle binary
use clap::Parser;

#[derive(Parser)]
struct Cli {
    pattern: String,
    path: std::path::PathBuf,
}

fn main() {
    let args = Cli::parse();
}
## 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 |

My workflow: prototype in Python, ship in Rust.



#rust #python #programming #cli
7 472 Chat