Live data from Hacker News

Ruby 3.2.0 is from another dimension

tomaszs2.medium.com

81–90 of 341 posts

Re: Ruby 3.2.0 is from another dimension

#81

Earlier quoted context omitted.

How is "I don't like it" not a good reason for not using something? Ruby in science is the path of most resistance; if your work isn't already hard enough, here's a way to make it harder. That's because everyone is using Python. Think of it like writing scientific papers in English even though you like Esperanto better. Everyone uses English, so you have to too. That's Python's current state.

> How is "I don't like it" not a good reason for not using something? Don't ask me... > Ruby in science is the path of most resistance; if your work isn't already hard enough It actually isn't that hard, honestly. Very few people do cutting edge work that requires analyzing massive amounts of data and, from my experience, other languages are not much better. They still rely on C (or Rust) bindings, because they aren'…

> Ruby just got out of fashion

Adoption-wise Ruby is a new Perl. Such a shame really, Ruby is one of the best scripting languages yet available, if Linux distributions had it by default it would dominate over py and shell-scripts.

Re: Ruby 3.2.0 is from another dimension

#82
post #42

Earlier quoted context omitted.

> reason for a company to choose Ruby is if they want Rails And that there, is the whole "Problem" of Ruby. Ruby is a beauty. Rails isn't. It's nice, productive (for certain niches) and has a long track-record. But Rails is also often the root of problems such as maintainability, long-term-productiveness, hosting (performance, scaling), and lock-in. There are far better solutions for simple CRUD-apps today than writi…

[dead]

Honestly I don’t agree. In my experience Rails easily becomes a rat’s nest of magical code that is nearly impossible to read. A bajillion imports leads to code being pulled in from who knows where.

Re: Ruby 3.2.0 is from another dimension

#83
post #59

Ruby is my favorite language, and often it is a joy to use because of its combined attributes of brevity, expressive power, and feature consistency. It's disappointing that there are so many more jobs for another popular language - one that lacks the elegance and consistency but which has a larger ecosystem. As far as I know, the only well known reason for a company to choose Ruby is if they want Rails (and obviously…

I'm sorry, I agree it is a beautiful language. But Ruby is slow. Performance matters. In a world when everything seems to run in cloud servers, efficiency matters. If you can have 20 times more simultaneous users in the same cloud server by using a different tech stack, there's no reason to keep using Ruby. For the record, I also think Python is generally slow, but it has improved in the latest version, and the impor…

I guarantee the language is not the limiting factor in a web scaling problem.

Re: Ruby 3.2.0 is from another dimension

#84
post #59

Ruby is my favorite language, and often it is a joy to use because of its combined attributes of brevity, expressive power, and feature consistency. It's disappointing that there are so many more jobs for another popular language - one that lacks the elegance and consistency but which has a larger ecosystem. As far as I know, the only well known reason for a company to choose Ruby is if they want Rails (and obviously…

I'm sorry, I agree it is a beautiful language. But Ruby is slow. Performance matters. In a world when everything seems to run in cloud servers, efficiency matters. If you can have 20 times more simultaneous users in the same cloud server by using a different tech stack, there's no reason to keep using Ruby. For the record, I also think Python is generally slow, but it has improved in the latest version, and the impor…

And then there is PHP... which is also insanely fast now compared to even 5 years ago, it is stateless by default, but you can also run application servers in long threads for even more performance. For 2023, the PHP community is seriously committing resources to making this long running scenario more efficient and performant.

Except for the ML/AI use case, Laravel has more batteries included I would argue than Django. A ton more features when compared to Rails. All of them are first party solutions for things like Auth/Queues/Monitoring/Payments/Testing/Local Development and even some starter kits.

If you're building a new web based company that isn't focused on building the next AI avatar generator, Laravel should be on your radar if you're also considering Rails or Django.

Re: Ruby 3.2.0 is from another dimension

#85
post #65

Earlier quoted context omitted.

Personally I think the Python syntax make its more explicit which is an in-place sort vs returning a sorted copy. And also what's a method call vs an attribute access. Someone new to Ruby will be WTF is the ! for?

How does having a function instead of a method indicate that it's out-of-place? Every Ruby tutorial explains that an exclamation mark means in-place, and this convention is consistent across Ruby libraries, unlike Python.

It's a convention, quite a nice one, but not all libraries are consistent and it does have different meanings too (! is sometimes used for "raise an error instead of returning a boolean").

In the Python case, `list.sort()` operates on the object, so you can kind of expect it to do mutation (but there's no convention / guarantee). Though it only makes sense as a function that the list object itself implements.

`sorted` is a general function that gives you a sorted list from any iterable, and because working with iterables is such a common thing in software, Python has a bunch of standard functions like that. It's nice because you learn them once and they apply absolutely everywhere.

Ultimately you learn the behaviours of a language and they become second nature. I find both Ruby and Python very clean and easy to read.

Re: Ruby 3.2.0 is from another dimension

#86
post #62

Earlier quoted context omitted.

When I looked at Python vs Ruby many years ago, I found the opposite: Why does Python have (special) functions like len() and map(), instead of 'properly' supporting both OOP (len should just be a method on objects) and/or FP (support multi-line lambdas so I can actually use map/filter etc). I never understood how this can be considered consistent at all, and those IMHO language design warts made me look into Ruby at…

Those functions take any object that supports the iteration protocol. There’s no need for adding say, len, to every object that needs a len function. I’d argue that is consistent. Sure, multi line lambdas might be nice, but equally you can define functions wherever you need them so it’s not really all that different.

> There’s no need for adding say, len, to every object that needs a len function.

fwiw, Ruby does the same thing, but using the Enumerable mixin rather than a free floating function.

> I’d argue that is consistent.

I don’t understand this argument. It’s convenient and more efficient to write, yes. But how is it more consistent to have two different calling conventions?

The claim that there’s one way to do something irks me as well. There’s one way to find the length of something, but that introduces two ways of querying an object. It’s a good guiding principle, but when people use it to make stronger claims, it ends up superficial.

Re: Ruby 3.2.0 is from another dimension

#87

Ruby is my favorite language, and often it is a joy to use because of its combined attributes of brevity, expressive power, and feature consistency. It's disappointing that there are so many more jobs for another popular language - one that lacks the elegance and consistency but which has a larger ecosystem. As far as I know, the only well known reason for a company to choose Ruby is if they want Rails (and obviously…

> But that other language also has a popular (and comparatively clumsy) web framework

Django is today more elegant, more complete, and better documented than Rails ever was. 10 years ago you would have been correct. 5 years ago they were about evenly matched. Today it's not even close. Python is eating the world, and web frameworks are no exception.

Re: Ruby 3.2.0 is from another dimension

#88
post #52

Earlier quoted context omitted.

One aspect in which Ruby is much more consistent than Python: sorted(arr) arr.sort() versus arr.sort arr.sort!

Personally I think the Python syntax make its more explicit which is an in-place sort vs returning a sorted copy. And also what's a method call vs an attribute access. Someone new to Ruby will be WTF is the ! for?

Newcomers to Python will have many more WTFs, many of which are syntactically invisible.

Re: Ruby 3.2.0 is from another dimension

#89
post #87

Ruby is my favorite language, and often it is a joy to use because of its combined attributes of brevity, expressive power, and feature consistency. It's disappointing that there are so many more jobs for another popular language - one that lacks the elegance and consistency but which has a larger ecosystem. As far as I know, the only well known reason for a company to choose Ruby is if they want Rails (and obviously…

> But that other language also has a popular (and comparatively clumsy) web framework Django is today more elegant, more complete, and better documented than Rails ever was. 10 years ago you would have been correct. 5 years ago they were about evenly matched. Today it's not even close. Python is eating the world, and web frameworks are no exception.

Django might be better but Ruby as a language is way better thought out than Python. Python feels like it's cobbled together compared to Ruby. There is a certain elegance with the language, that is hard to find elsewhere.

Re: Ruby 3.2.0 is from another dimension

#90
post #56
post #29

Earlier quoted context omitted.

Python gained traction because of Google (Google used it initially then Guido worked for them for a decade+, vs. Matz at Heroku/salesforce) and then because it's the easiest way to use ML libs. That's it. It's slower than Ruby, has worse package management and less consistent syntax but if you want to use Tensorflow, PyTorch, etc..., it's the default.

> It's slower than Ruby. Any reference/numbers to back this up ? Just genuinely curious about this.

In all the language comparisons I've found over the years, Python consistently comes out slightly slower, for example:

https://github.com/kostya/benchmarks

Bearing in mind these are probably not even using YJIT, which makes Ruby considerably faster in some scenarios.

Post reply on HN