runner was inspired by a post here where someone declared themselves ‘disappointed’ in Cargo because it was awkward to use for testing out little bits of code. The post seems to have disappeared, probably out of embarrassment, but it struck me that a utility to run snippets that could be linked against external crates would be useful. A
’snippet’ is pretty much the same as a doc example -
println!("Hello, World!") is a valid snippet.
runner --create 'time json regex' will create a static cache containing theose crates, which any
extern crate in snippets will link against.
There’s also a few Perl-inspired features, thanks to some useful comments on /r/reddit.
$ runner -e 'PathBuf::from("bonzo.dog").extension()' Some("dog")
and some Rust-specific, like evaluating iterators:
$ runner -i '(0..5).map(|i| (10*i,100*i))' (0, 0) (10, 100) (20, 200) (30, 300) (40, 400)
It’s installable with cargo, and any comments or suggestions are welcome.