news.volyx.in

Ruby: A great language for shell scripts (lucasoshiro.github.io)

442 points by lucasoshiro · 780 days ago · 353 comments on HN

Article summary

The article discusses the use of Ruby as a language for writing shell scripts, highlighting its features such as calling external commands, status code, typed language, functional constructions, regex matching, easy threads, and built-in file and dir operations. The author argues that Ruby is a great alternative to Bash for complex shell scripts. The article also compares Ruby to Python and Perl, noting that Ruby's ecosystem is not as large as Python's. The author concludes that Ruby is a suitable language for shell scripting, especially for personal use.

Main themes

  • Ruby for shell scripting
  • Comparison to Bash and Python
  • Language ecosystem
  • Scripting language choice
  • Language suitability for large projects

What commenters say

  • Ruby is a suitable language for shell scripting due to its features and ease of use, making it a great alternative to Bash for complex scripts.
  • The choice of scripting language depends on the project's requirements and the developer's personal preference, with some preferring Ruby over Python or Perl.
  • Ruby's lack of explicit typing and global namespace can make it difficult to manage large projects, leading some to prefer other languages like Go or TypeScript.
  • Despite its potential drawbacks, Ruby can be a great language for large projects when used with discipline and proper engineering practices.
  • The presence of a language in a Linux distribution's default installation is not a guarantee of its suitability for a particular task or project.
  • Some developers prefer Ruby for personal use due to its ease of use and beautiful code, but may choose other languages for larger projects or when working with others.
  • The importance of a language's ecosystem and labor pool should not be underestimated, with some languages like Python having a larger and more established community.
  • The suitability of a language for large projects is not solely determined by the language itself, but also by the team's experience, discipline, and engineering practices.