I’ve fallen in love with Rust scripts. With cargo -Zscript, you get type safety, the entire crates ecosystem, and performance that embarrasses Python. The front-matter syntax is perfect—dependencies right at the top, no separate Cargo.toml needed.
But the startup time was killing me. 200ms minimum, even when nothing changed. For scripts you run constantly, that’s death by a thousand paper cuts.
So I built scriptr: a wrapper that makes Rust scripts start as fast as shell scripts.
The trick is smart caching. First run builds normally through cargo. After that, we check the file’s modification time. If unchanged, exec the cached binary in 5ms flat. If the file was touched (say, by git), we check the content hash. Only if the content actually changed do we rebuild.
This isn’t rocket science. It’s just fixing an annoying problem that was keeping me from using Rust for everything.
Now my git helpers start instantly. My build scripts feel snappy. My daily automation doesn’t lag. Rust has become a genuinely great scripting language.
The future of scripting is typed, fast, and starts in 5ms.
cargo install scriptr
chmod +x hello.rs
./hello.rs # First run: ~1s
./hello.rs # Every run after: 5ms
Try it. You’ll never go back to slow scripts.