Rust-script

113 points Soggy-Mistake-562 16 comments

So I wanted to highlight this cool tool that I found called “rust-script” and it’s just like a bash file…but rust.
https://rust-script.org/

•Allows running Rust code as a script without explicit compilation steps.

•Doesn’t require a Cargo.toml file or a full project structure.

•Uses a shebang (#!/usr/bin/env rust-script) to execute scripts directly.

•Good for quick prototyping, automation, or small utilities.

This with something like Duct is awesome
https://docs.rs/duct/latest/duct/

Of course Rust can execute commands, but it can get quite verbose and As someone who doesn’t like bash or python very much this was a really cool find. So I wanted to share :D