r/programming • • Dec 25 '19

Ruby 2.7.0 released

https://www.ruby-lang.org/en/news/2019/12/25/ruby-2-7-0-released/
72 Upvotes

46 comments sorted by

View all comments

Show parent comments

14

u/Kache Dec 25 '19 edited Dec 25 '19

I wish Ruby would focus more on covering its weaknesses -- it sounds like 3.0 is supposed to get there, but it's been a long time already.

Strengths: I really like Ruby's "semi-functional" syntax and the API of the core types (definitely Enumerable). They provide clean & useful abstractions for building, i.e. write your workhorse/business logic without "low-abstraction cruft". (You might not even need to write a "low-abstraction" layer at all.) I think Ruby does this better than any other popular language.

Weaknesses: Performance and over-metaprogramming. There are many crazy runtime hacks in Ruby that are possible but unnecessary. I'd willingly give up all the dynamic metaprogramming for template metaprogramming because I'd get back tons more in performance and maintainability. Python got generators correct -- Ruby copies memory left and right.

The newest generation of languages (like Rust, I've heard) have adopted those strengths without exposing those weaknesses. If Ruby doesn't "step up", it's going to be left in the dust.

9

u/ScientificBeastMode Dec 25 '19

I’m not sure Ruby can fix those glaring issues without huge breaking changes to the language.

6

u/[deleted] Dec 26 '19

I often wish for the Crystal equivalent for a Python.

And no, Nim is nothing like Python while Crystal is literally a slimmed down, consistent and de-“run-time metaprogramming” Ruby.

1

u/ObnoxiousFactczecher Dec 29 '19

I'd willingly give up all the dynamic metaprogramming for template metaprogramming because I'd get back tons more in performance and maintainability

How do you picture a difference between the two in a Smalltalk-like language?

1

u/Ameisen Dec 30 '19

Ruby's JIT implementation is just silly.