When writing #Rust code as if it were a high-level language, what is your biggest annoyance/roadblock?
Put another way, what is the biggest thing that gets in the way of Rust feeling like Python or Swift to you?
#RustLang

@ekuber

  • -Z script
  • AFAIK cargo add doesn’t work with -Z script files
  • need to specify fn main()->Result in order to get ? in main (and writing the error type requires at least one import)
  • Ok(()) wrapping everywhere
  • clap’s api requires a lot more boilerplate for “trivially small” parsers than argparse so i will often just do things with std::env::args myself (this is probably telling on myself that i use bash too often lol)
  • everything is so so so verbose. BTreeMap doesn’t even support [] syntax for inserting. inherent methods can’t be renamed on import (and writing wrapper functions requires tons of type-level boilerplate). doing things the “right way” with BufRead.lines() is a lot more annoying than just using read_to_string.
  • refactoring anything type-related is tedious because the generics on all the impl blocks need to be updated
  • various rustfmt gripes that i don’t have about gofmt
@jyn @ekuber `cargo add` does work with scripts. Just like everything else, it requires a `--manifest-path` flag.
@epage @jyn @ekuber
Shouldn’t cargo add with a script just add the crate to the embedded cargo toml in the script file?
cargo/tests/testsuite/cargo_add/script_bare at master · rust-lang/cargo

The Rust package manager. Contribute to rust-lang/cargo development by creating an account on GitHub.

GitHub