Live data from Hacker News

Ruby 3.2.0 is from another dimension

tomaszs2.medium.com

31–40 of 341 posts

Re: Ruby 3.2.0 is from another dimension

#31

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…

You are obviously referring to Python and so I would like to note a few things. (I have nothing against Ruby) > Ruby ... its combined attributes of brevity, expressive power, and feature consistency. > [Python] lacks the elegance and consistency First I would argue Python is very consistent in its design, it aims to only have one obvious way to do things and so it's easy to guess how apis will work. It also aims for…

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 the time.

Has this improved since? I know print was changed in Python3 to make it not-special.

Re: Ruby 3.2.0 is from another dimension

#32

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…

You are obviously referring to Python and so I would like to note a few things. (I have nothing against Ruby) > Ruby ... its combined attributes of brevity, expressive power, and feature consistency. > [Python] lacks the elegance and consistency First I would argue Python is very consistent in its design, it aims to only have one obvious way to do things and so it's easy to guess how apis will work. It also aims for…

I think the elegance here is "lacking" of parenthese in function call. Also block.

Ruby code has no parenthese.

Re: Ruby 3.2.0 is from another dimension

#33

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…

> the other comparatively-unpleasant language > one that lacks the elegance and consistency upvoted for perfectly concise description of that language. it is even more sad knowing that high quality alternatives for the most popular libraries exist, but inertia is simply too high. @work I've tried to introduce Ruby to my colleagues that are very bad at programming, but good at science. They ditched it with reasons lik…

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.

Re: Ruby 3.2.0 is from another dimension

#34

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…

> one that lacks the elegance and consistency but which has a larger ecosystem. ... and decent first party docs, actual code modules rather than “execute every source file in the global namespace”, a first party Windows build, etc., etc., etc. If the Ruby community can't acknowledge the real things holding it back compared to other available options, well, that makes it that much harder to catch up.

They did apparently manage to make their interpreter figure out where mismatched "end" statements are most likely to be, which was one several serious pain points for me with the language.

I don't think the execution model you mention, which results in the absurdity of C style transitive includes polluting the global namespace, will ever be changed though.

Re: Ruby 3.2.0 is from another dimension

#35
post #29

Earlier quoted context omitted.

You are obviously referring to Python and so I would like to note a few things. (I have nothing against Ruby) > Ruby ... its combined attributes of brevity, expressive power, and feature consistency. > [Python] lacks the elegance and consistency First I would argue Python is very consistent in its design, it aims to only have one obvious way to do things and so it's easy to guess how apis will work. It also aims for…

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.

Revisionist history. Python was huge before Google even existed.

Re: Ruby 3.2.0 is from another dimension

#36

About the regex speedup, it looks like Ruby 3.2 is now doing this https://swtch.com/~rsc/regexp/regexp1.html

Yeah, now i can confidently use this to check a string is float def is_float?(fl) fl =~ /(^(\d+)(\.)?(\d+)?)|(^(\d+)?(\.)(\d+))/ end

Floats are pretty hard, especially if you're accepting exponentiation:

- 1.4

- -1.4

- .4

- -.4

- 1.

- -1.

... plus exponents, also you don't need a decimal point if there's an exponent

Won't Ruby parse a string into a float? I would just use that and check for an error unless your requirements are different.

Re: Ruby 3.2.0 is from another dimension

#37

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…

> Maybe like blockchain, once the AI/ML fantasy hype dies down

Two minutes of silence for the poor sods who still thinks that AI/ML is pure hype.

(Granted, there is hype. But there is much real stuff.)

And, also, blockchain and ML/AI are nothing similar, except for Twitter bottom-feeders trying to milk each.

AI/ML already has real applications with hundreds of millions of dollars actual value created. And just like CS itself, AI/ML will perpetrate more and more fields in the coming days.

There may not be an AGI soon, or ever, but mark my words, AI/ML will continue to have growing real applications in different fields.

Blockchain had only hype. ML has substance + hype (AGI, silver bullet to all problems, etc.).

I will not engage in language wars like GP here, because those are stupid.

I work all day with Python, and I also enjoy coding in Ruby sometimes in hobby projects.

Re: Ruby 3.2.0 is from another dimension

#38
post #29

Earlier quoted context omitted.

You are obviously referring to Python and so I would like to note a few things. (I have nothing against Ruby) > Ruby ... its combined attributes of brevity, expressive power, and feature consistency. > [Python] lacks the elegance and consistency First I would argue Python is very consistent in its design, it aims to only have one obvious way to do things and so it's easy to guess how apis will work. It also aims for…

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.

That's a fairly Silicone Valley focused argument. I don't subscribe to the theory at all that Google closed internal use of Python was instrumental in its adoption.

Django was released in 2005 and RoR in 2004. I suspect my journey was similar around then (late 2005), I had used PHP, classic ASP and a little Perl. I was looking for something better, read the tutorials for both Django and RoR. Had a look at what desktop GUI toolkits were available for both Ruby and Python (I wanted to lean one new language), Python had a few more options and so went with Python and Django.

At the same time Python was gaining significant traction in the scientific community with NumPy (2006/1995) and SciPy (2001). Ruby I don't believe had an answer to that back then. I was vaguely aware of that and it somewhat influenced my decision.

Ultimately it was the two pronged (web + scientific) development of the ecosystem that pushed Python ahead of Ruby.

Re: Ruby 3.2.0 is from another dimension

#39
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.

Revisionist history. Python was huge before Google even existed.

...for some value of "huge" that others might take issue with.

From my perspective, python was just starting to gain real popularity in the mid 2000s, more than half a decade after Google was founded...

Re: Ruby 3.2.0 is from another dimension

#40

Earlier quoted context omitted.

> one that lacks the elegance and consistency but which has a larger ecosystem. ... and decent first party docs, actual code modules rather than “execute every source file in the global namespace”, a first party Windows build, etc., etc., etc. If the Ruby community can't acknowledge the real things holding it back compared to other available options, well, that makes it that much harder to catch up.

They did apparently manage to make their interpreter figure out where mismatched "end" statements are most likely to be, which was one several serious pain points for me with the language. I don't think the execution model you mention, which results in the absurdity of C style transitive includes polluting the global namespace, will ever be changed though.

> I don't think the execution model you mention, which results in the absurdity of C style transitive includes polluting the global namespace, will ever be changed though.

There is a proposal at https://bugs.ruby-lang.org/issues/19024 to change this but, as you can see from the comments, it’s a bit tricky to get right while preserving backwards compatibility. (Whether that conversation makes you more or less optimistic about the chances of it ever being changed is up to you.)

Post reply on HN