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

23

u/pure_x01 Dec 25 '19

Where is ruby mostly used nowdays? Ex: clientside, console, desktop, serverside etc

Excellent news btw. Good work!

17

u/[deleted] Dec 25 '19

Also gitlab.

I've never been a Ruby user but my impression from co-workers and friends is that there are a fair bit of companies out there who have locked themselves into Ruby and there is nothing wrong with this. Once you're knee deep in that ecosystem you can do pretty much anything.

That said though, I chose Python when I abandoned Perl about 7 years ago and I'm happy with my choice.

20

u/tjpalmer Dec 25 '19

Fair assessment. Personally, I prefer Ruby over Python, so I wish Ruby had made headway in scientific computing 15 years ago. Then, I could be using it at work these days instead of Python, but oh well.

4

u/Hero_Of_Shadows Dec 26 '19

so I wish Ruby had made headway in scientific computing 15 years ago.

Those are exactly my thoughts as well

7

u/AlexKotik Dec 25 '19

I think that Julia will eventually eat up a lot of Python's machine learning and scientific computing people.

12

u/tjpalmer Dec 25 '19

Julia's cool, and I can believe in a universe where that happens, but so far it doesn't seem to be turning out that way. Try turning on just Julia here, for example: https://madnight.github.io/githut/#/pushes/2019/3

2

u/ObnoxiousFactczecher Dec 29 '19

And if you turn on R in the same chart, you will find almost an identical line for this behemoth of statistics. What does that say about R? Likewise for Matlab.

→ More replies (2)

51

u/Atsch Dec 25 '19

As unfortunate as it is, the primary use of Ruby these days is for maintaining large applications that were started around 2005-2010 when ruby was at the peak of it's growth. I understand this was largely because "Ruby on Rails" was so far ahead of most other web frameworks. Frameworks for other languages copied the RoR ideas quickly, and there hasn't really a lot of reasons to learn it since then, besides personal taste.

It's being used for new projects mostly by fans who really appreciate it or people who understandably just don't want to re-aquite years of expertise for another language when ruby works fine.

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.

→ More replies (2)

24

u/[deleted] Dec 25 '19

[removed] — view removed comment

35

u/HorizonShadow Dec 25 '19

Pfft. Real programmers only use new, unstable software.

13

u/Minimum_Fuel Dec 25 '19

Yeah, no they’re not. In virtually every single metric out there, Ruby is decidedly and sharply falling out of use.

13

u/FancierHat Dec 25 '19

Both these can be true. You could have a steady 1000 projects per year on ror. And if every year the number of new stuff doubles the share in ruby would decline.

5

u/myringotomy Dec 25 '19

Rails is mature, battle tested, complete, well documented, and has an immense community. It’s still the best choice for a lot if not most scenarios.

8

u/PurpleYoshiEgg Dec 26 '19

I and a coworker inherited a Rails project having not known it beforehand. I don't find it well documented at all. It has documentation, sure, but you have to know what to look for, and just knowing Ruby really isn't enough. Too much magic, like name_path and name_url being generated at runtime, as we were about pulling our hair out wondering where those symbols were defined. Turns out you need to search for name to figure out where you need to change something.

Rails might be the right choice when you start, but it is not intuitive if you happen to inherit the mess.

→ More replies (3)

6

u/Atsch Dec 26 '19

I'm not convinced that it's really worth learning ruby just for Rails over the other options in 2019. Rails really doesn't beat the other frameworks in any of those things clearly enough to justify learning a new language in a world where most people already know some Python or JS, and once you exit the Rails ecosystem, ruby is pretty weak compared to the other options.

7

u/myringotomy Dec 26 '19

Ruby is a great language, much more pleasant to code than python or god forbid javascript

→ More replies (4)
→ More replies (3)

5

u/Kimbernator Dec 25 '19

It's used in some popular devops applications. I use it with chef, but puppet is another that uses it.

4

u/[deleted] Dec 25 '19

Well github is written in ruby for one. They made a ton of gems (libs). But as most programming language, you can do almost anything with it. Its slightly faster then python except when the py. lib has native extensions. Python has a lot of them since its slow as fuck. The most common use of ruby is rails framework. Around 9 years ago almost all startupps in europe (Berlin, Paris, Prague etc) started with Rails since its super convenient for an MVP.

10

u/AlexKotik Dec 25 '19

In my experience Python is slightly faster than Ruby in general. However both of these languages should have a proper JIT implementations like 10 years ago.

2

u/xtreak Dec 26 '19

Python has PyPy.

→ More replies (3)

3

u/myringotomy Dec 25 '19

Rails is still intensely popular and that’s where the bulk of Ruby is used.

→ More replies (3)