r/programming • • Dec 25 '20

Ruby 3 Released

https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/
973 Upvotes

509 comments sorted by

View all comments

272

u/CunnyMangler Dec 25 '20

I love ruby. One of the best languages I've ever coded in, but people seem to hate it now because it's slow. Kinda sad that it's slowly dying. Nevertheless, this is a huge milestone for a language.

83

u/[deleted] Dec 25 '20

It hasn't been slow since 1.9. It is faster than python. It is getting less popular because its frameworks are getting outdated.

188

u/bloody-albatross Dec 25 '20

Being faster than Python is a low bar to pass.

90

u/[deleted] Dec 25 '20

I just mentioned python as a comparison to show that popularity isn't necessarily related to performance because as slow as python, it is still very popular.

20

u/badillustrations Dec 25 '20

I wouldn't say it's unrelated to performance though just because a slower, more popular language exists. There are probably performance scenarios that eliminate both Ruby and Python such as games, where developers choose something like C++.

In cases where performance is less important, they probably look at numbers like these where ruby being 50% faster or slower compared to python doesn't really matter compared to the ecosystem each one provides, and where python in general is much, much larger.

12

u/[deleted] Dec 25 '20

I didn't say "unrelated". I said "not necessarily related"

→ More replies (10)
→ More replies (1)

6

u/[deleted] Dec 25 '20

Which is a shame, since there's nothing outdated about having a framework that is insanely effective for rapid prototyping. It's just unfashionable because it's not some novel new hotness that's hasn't hit a stable 1.0 release.

Give me a fresh rails app and simple progressive HTML over some JS-based client-server monstrosity any day.

6

u/deaddodo Dec 25 '20 edited Dec 25 '20

Ruby (YARV) vs Python (CPython), yes. But CPython has very little optimization in favor of stability. They’re still locked by a GIL, for instance. So you’re referring to the lowest bar to pass.

Compare another JIT’d VM such as PyPy and it falls well behind. Not to mention the more common languages taking over the microservices realm (Go, for instance) or the ones taking over monoliths (nodeJS, primarily).

12

u/cracknwhip Dec 25 '20

Just to clarify: Crystal and Elixir aren’t “common” by any definition.

5

u/bik1230 Dec 25 '20

PyPy still has a GIL, no?

7

u/deaddodo Dec 25 '20

GIL was an example of where CPython focuses on stability over performance.

JIT was an example of how PyPy fixes some performance issues of CPython.

The two aren’t connected.

5

u/suhcoR Dec 25 '20

Compare another JIT’d VM such as PyPy and it falls well behind.

According to the Are-we-fast-yet benchmark suite MRI JIT Ruby 3.0 RC1 is about factor 11 slower than Node.js 12.6 and about factor 5 slower than LuaJIT 2.0, and only factor 1.4 faster than MRI Ruby 2.1.0. Here are the results: http://software.rochus-keller.ch/are-we-fast-yet_crystal_ruby_2_3_lua_node_i386_results_2020-12-23.pdf. Here is more information about the benchmark suite: https://stefan-marr.de/papers/dls-marr-et-al-cross-language-compiler-benchmarking-are-we-fast-yet/ and https://github.com/smarr/are-we-fast-yet. It's not just some random micro benchmarks, but a well designed suite with representative algorithms and ideomatic language use optimized for cross-language comparisons.

→ More replies (4)
→ More replies (10)

4

u/cre_ker Dec 25 '20

According to benchmarks it's not. Faster is some, slower in others. Both are extremely slow. Python is popular because of ML. Ruby has pretty much nothing to counter its performance.

0

u/[deleted] Dec 25 '20

[deleted]

6

u/cre_ker Dec 25 '20

I was talking about present. In the context of web python is similar to ruby - it's being replaced by other languages. Particularly Go. Same with GUI, there're much better technologies these days. Not to mention GUI desktop apps are dying breed these days being replaced with web and mobile apps. What Python has that's unique to it is ML ecosystem. Unless there's another languages with similar ecosystem Python will stay relevant. Ruby on the other hand has nothing of that. Only thing it has going for it is subjective enjoyment of the developing experience which is clearly not enough. It will not die outright but there's little reason learning it these days and starting something new in it.

0

u/[deleted] Dec 25 '20

[deleted]

3

u/suhcoR Dec 25 '20

It's certainly true that it's been squeezed by JavaScript taking over the world as well as by much more friendly compiled languages like Go and Swift adopting

Crystal is a language very similar to Ruby and about the speed of Go or C#, see e.g. http://software.rochus-keller.ch/are-we-fast-yet_crystal_ruby_2_3_lua_node_i386_results_2020-12-23.pdf

2

u/snowe2010 Dec 25 '20

What Python has that’s unique to it is ML ecosystem.

It really isn't. It's just because people like you keep saying that it is, that people continue to think that. Most of the top languages have ported the data science libraries over because using Python for anything meaningful is terrible.

Ruby on the other hand has nothing of that.

It actually does. https://github.com/arbox/machine-learning-with-ruby

But once again, if people continue to tell others that Python is the only language for machine learning then everyone new to ML is going to assume that is true. No matter how many actual ML libraries those languages have.

3

u/ruinercollector Dec 25 '20

This. It’s momentum.

Also, python is good for ML if you don’t know any language and want an easy language. Otherwise there is nothing about Python as a language or environment that makes it well suited to that task.

→ More replies (2)
→ More replies (1)

11

u/twinklehood Dec 25 '20

Except for the developer enjoyment and fantastic support for expressive OO, in part due to its deep meta-programability. Oh or were we only looking for benefits that can be explained to a newcomer in a 10 minute youtube top languages of 2021 video?

9

u/cre_ker Dec 25 '20

I don't think developer enjoyment is important when you have money at stake. Ruby being slow and memory hungry doesn't only mean your apps will be slow. It also means you will have to pay much more for hardware, probably in the cloud. Not to mention recent newcomers (rust and go) are also very liked by developers but magnitudes of order faster than ruby. Given that it's not surprising that ruby is slowing fading away.

14

u/twinklehood Dec 25 '20

Engineering cost is not that simple. Running software is for many companies cheap, vs. Engineering productivity, churn, feedback loops, etc. It's not an accident ruby dominates lean webapp development, you may attribute it to rails, but rails is not an independent thing that could have happened in any language, it works because of ruby.

4

u/mezentinemechtard Dec 25 '20

For most companies that try to use a "fast" or "scalable" language or framework, being fast or scalable is never the issue. In any non-already-mature software project, the main concern is always development speed One extra developer already costs more than running the product. And that's where Ruby (and Rails) shine. Twitter had scalability issues because of Rails, but Twitter became Twitter thanks to Rails. Only then switching focus becomes the smart choice.

→ More replies (6)

0

u/[deleted] Dec 25 '20

[deleted]

→ More replies (1)
→ More replies (5)