@lxkota@lemmy.ml

This profile is from a federated server and may be incomplete. Browse more on the original instance.

What are the recommended scripting languages for complex shell scripts beyond bash?

I’ve been struggling with a rather complex shell script, and it’s becoming apparent that Bash might not be the best choice for this particular task. While I usually gravitate towards statically typed languages like Go or Rust, I’ve noticed that many people recommend alternative languages such as Lua or Python for scripting...

lxkota,
@lxkota@lemmy.ml avatar

For years my go to (after Bash) was Python. However, in the last few years I’ve switched to Rust for any kind of shell command wrapper or CLI tool.

TL;DR I think Rust is best suited to more complex CLI work.

lxkota,
@lxkota@lemmy.ml avatar

I personally don’t have any real experience with Go. Lots of smart folks I work with love it. In general, most of what I have read suggests that Rust is better suited to CLI tooling. For my use case it came down to:

  • Rust’s cargo system
  • The clap crate (which supports building out bash shell completion scrips via a Rust build script. Basically means I can generate a completion script at compile time and include this in the package I distribute to users)
  • Rust’s out of the box performance
  • The heavy lifting done by the borrow checker in bringing safety
lxkota,
@lxkota@lemmy.ml avatar

I personally don’t have any real experience with Go. Lots of smart folks I work with love it. In general, most of what I have read suggests that Rust is better suited to CLI tooling. For my use case it came down to:

  • Rust’s cargo system
  • The clap crate (which supports building out bash shell completion scrips via a Rust build script). Basically means I can generate a completion script at compile time and include this in the package I distribute to users)
  • Rust’s out of the box performance
  • The heavy lifting done by the borrow checker in bringing safety
  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • uselessserver093
  • Food
  • aaaaaaacccccccce
  • test
  • CafeMeta
  • testmag
  • MUD
  • RhythmGameZone
  • RSS
  • dabs
  • KamenRider
  • Ask_kbincafe
  • TheResearchGuardian
  • KbinCafe
  • Socialism
  • oklahoma
  • SuperSentai
  • feritale
  • All magazines