TIL that a relatively small hello world with a few subcommands using http://crates.io/crates/structopt … is about *100x faster* than an equivalent app using http://npm.im/yargs and I just don't want to write CLI tools in Node ever again, y'all.
-
Show this thread
-
All the parsing and type conversion and loading and stuff that structopt does, and it's still 25x faster than asking node to print the number 1.pic.twitter.com/6GsP1jHrCo
5 replies 4 retweets 30 likesShow this thread -
for context, I've had to do fucking BACKFLIPS with Yargs-based apps to lazy-load all the different commands that aren't getting used just to save time+ram. I don't seem to have to worry about this *at all* with Rust. I can just load every damn command and all its code??
1 reply 0 retweets 14 likesShow this thread -
(which is good. I'm pretty sure I can't pull any stunt like that to lazy-load in Rust)
1 reply 0 retweets 5 likesShow this thread -
Anyway for y'all
#entropic enthusiasts out there, here's a PR for what I'm thinking of doing as far as laying out and executing commands in dstopic:https://github.com/entropic-dev/ds/pull/25 …2 replies 0 retweets 5 likesShow this thread
I really want to find the time to RFC paw into the stdlib. Maybe next year. Would allow passing args to main
#[derive(StructOpt)]
struct Opts { port: u16 }
fn main(opts: Opts) {
println!("port is {}", opts.port);
}
https://docs.rs/paw/1.0.0/paw/
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.