1. 39
  1.  

  2. 8

    Here are some of the smaller changes in this release that I really like:

    Add an exception: option to Kernel#system which causes it to raise an exception on failure instead of returning false. [Feature #14386]: when I write small scripts with Ruby I always would write (or copy-paste) a wrapper around system like must_system for commands that need to succeed to show command name and exit status then abort. Now this is built in. A big ergonomic improvement for me!

    RubyVM::AbstractSyntaxTree.of returns AST nodes of the given proc or method.: I found this one hiding in the NEWS file. This, combined with the new built-in AST, sounds like a really fun way to build a macro system, or to do other kinds of tricky/fun/scary analysis at runtime (the Ruby way). The previously available gems need a lot more “doing” to get going with Ruby syntax analysis/mangling.

    Hash#merge, Hash#merge!, and Hash#update now accept multiple arguments. [Feature #15111]: a quality-of-life improvement I’ll certainly appreciate that brings parity with Javascript’s Object.assign(), if not object spread syntax.

    1. -10

      Are people still choosing languages like Ruby and Python?

      I used them in the years before however have moved on to superior ones (eg: Rust, Haskell). I fail to see why anyone would choose Ruby or Python for newer projects for reasons other than a) libraries and b) existing team knowledge/inertia.

      1. 21

        a) libraries and b) existing team knowledge/inertia.

        Well if you immediately discount the two most important factors of language selection in corporate settings, sure, you win the argument.

        1. 1

          It is curious that everyone replying to me automatically assumes I’m exclusively referring to people in the corporate world while purposefully excluding others.

          1. 3

            Why keep it to corporate, when the same reasons apply everywhere? I like Rust well enough, but if I need to write a new website, I’m still reaching for Rails, because the Rust Crate ecosystem for web development is hopelessly immature compared to Rails, which has a reliable and well-tested gem for almost anything you could want to do.

            Rocket is the only decent thing I’ve found for web development in Rust, and it’s still way, way behind Rails.

        2. 10

          Haskell is older (or the same age, depending how you count) as Ruby and Python, and related ML-family languages are much older. So people choosing Ruby and Python now are doing it for the same reasons they always have. “No strongly-typed high level compiled language exists” has never been one of those reasons.

          1. 5

            If only technical superiority of a language translated directly into business advantage…

            Theoretical beauty of a language affects availability of coders, libraries and tooling only indirectly (maybe quality is affected more). From the business point of view, availability of coders and libraries is much more valuable and quality requirement are lax enough for most projects to use whatever/whomever does the job.

            1. 1

              Flagged for being strictly incorrect. The ivory tower of language purity often just doesn’t matter for getting real work done.

              reasons other than a) libraries and b) existing team knowledge/inertia.

              Counterpoint: Logstash, which is jruby 9000-based. You lose out on a number of libraries with C extensions that only work with MRI, and Logstash has its own language to define data processing pipelines. Yet, people use it because it’s useful, makes great use of the JVM, and is easily extensible because of Ruby.

              1. -1

                Flagged for being strictly incorrect. Try again after you’ve worked in an environment where the ivory tower of language purity doesn’t matter for getting real work done.

                Heh. I’ve used a wide spectrum of languages in my programming career. Right now I use Haskell and clearly see the benefits of working with a helpful type system. Nevertheless my comment was not meant to apply uniquely to corporate world (where presumably “real work” get done); but any or all programming activity in general.

                I think all these “incorrect” and “troll” downvotes are meaningless. If none of you dare to have an actual discussion on this topic that’s fine. :-P

                1. 4

                  Okay. I even gave you a counterpoint. Want to have a discussion on that? I gave you a reason I flagged your comment instead of just downvoting like a Reddit user, and included a jumping off point for more discussion. Seriously, the floor is yours.