• MonkderVierte@lemmy.zip
      link
      fedilink
      arrow-up
      0
      ·
      edit-2
      20 days ago

      Rewrite it in Rust.

      I tried. Building a simple cli tool to get a feeling for it for a bigger project. But then the “Rust by example” starts with installing clap as argument parser, which pulls 10 dependencies and LSP complains about not being able to build, because it doesn’t find a matching version, unless i do the implied version, but then it can’t derive features.

      Now trying argparse, that was intuitive in python. And else getops. And else i try Safe-C or something.

      • thingsiplay@beehaw.org
        link
        fedilink
        arrow-up
        0
        ·
        20 days ago

        Right now I am working on a Rust cli tool with clap and have no issues with the LSP in Neovim. It might be a configuration error. Clap is used by many and is the defacto standard cli parser in Rust. As a fan of argparse in Python, I think clap is even better. argparse being implemented as standard library is the biggest pro over clap. I wouldn’t even use getops anymore, unless it is a Bash script. And even so, Bash has its own builtin argument parser that I use for scripts.

        If you really wanted to try Rust, you should sort of that issue. Clap works great and lot of users use it. Who knows, you may even end up liking it and Rust.

        Edit: BTW which example do you refer to exactly? I looked at the official ones and couldn’t find: https://doc.rust-lang.org/stable/rust-by-example/