Live data from Hacker News

Ruby 3.2.0 is from another dimension

tomaszs2.medium.com

161–170 of 341 posts

Re: Ruby 3.2.0 is from another dimension

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

In fact, Google---back then BackRub---was originally implemented in Java and Python, long before Guido joined Google. "Huge" is obviously a subjective word but if it means "not small" then Python was already not a small language even at that time.

Re: Ruby 3.2.0 is from another dimension

#162
post #157

Earlier quoted context omitted.

The Python one looks fine to me, although I am a Pythonish person. It uses what people already know: the for something in somethings syntax of the for loop, and the if syntax. Also it's nice that this works in dictionaries, generators and lists. It also has the same narrative flow of Haskell's list comprehensions, which I think come from set theory: [x^2 | x As for your Ruby examples: I think you could argue that the…

> As for your Ruby examples: I think you could argue that the filter_map version is very readable, but not necessarily more so, but the select one looks pretty painful. The select does two passes, which makes it quite inefficient. One does not even need filter_map, since the example is essentially a reduce operation. res = (1..10).reduce([]) { |a, x| x != 5 ? a.push(x**2) : a } This works in ruby 2.5.1. Probably work…

True, although that seems less readable than the comprehension versions. I might be just biased, though.

Re: Ruby 3.2.0 is from another dimension

#163
post #37

Earlier quoted context omitted.

> 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 C…

>AI/ML already has real applications with hundreds of millions of dollars actual value created. Hundreds of billions a year probably (and that may be low) if you count online advertising and large consumer facing sites in general. If you turned off the ML behind Facebook/Google/Netflix/Amazon then you'd be lucky to only lose 50% revenue based on my personal experience of adding ML on top of such products.

That is true.

ML in recsys of Netflix and product suggestion/placement in Amazon are worth tens of billions of dollar alone, per month.

Re: Ruby 3.2.0 is from another dimension

#164
post #46

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…

I explored this topic a while ago on my blog [0] In essence, I don't think it has anything to do with elegance, syntax, or "easiness". It's more about timing + origin + corporate adoption: * Python was created in Europe, Ruby was created in Japan - when Ruby gained more recognition in English-speaking world (~2004), Python has already been present and used worldwide for a decade * Ruby was created as a personal, hobb…

I think you're spot on. Ruby actually gained wider appeal only when it gained visibility in the US (via rails). Being present in the markets which drive adoption matters more than being consistent, which python isn't ("one way of doing things" is mostly a meme nowadays, everyone touching python knows it's fake).

Re: Ruby 3.2.0 is from another dimension

#165

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…

As someone who loves both Python and Ruby, and uses them both daily, I really though they were referring to JavaScript (with node/deno et all).

[deleted]

Re: Ruby 3.2.0 is from another dimension

#166
post #70

Earlier quoted context omitted.

Revisionist history. Python was huge before Google even existed.

??? Python was huge in the 90's? News to me. No one I knew knew about it until like 2010.

Can I assume the '85' in your username indicates a birth year?

Zope was a Python project from the late 90s, and had quite a bit of attention and traction in the early cms/publishing days. That brought Python attention, and certainly gave it some mindshare in the late 90s.

Re: Ruby 3.2.0 is from another dimension

#167
post #36

Earlier quoted context omitted.

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.

`Float(str, exception: false)` returns either float or nil.

Re: Ruby 3.2.0 is from another dimension

#168

Earlier quoted context omitted.

In what situation is python the worst possible choice, while ruby which is very similar to it is the best possible choice? Unless you're doing some clever ruby metaprogramming type stuff which is totally impossible in python.

> In what situation is python the worst possible choice, while ruby which is very similar to it is the best possible choice? in no particular order, on top of my mind (there are many more): - mixed environments when you can't compartmentalize Python in a container. Python package management is one of the best examples of "poor implementation" - mixed environments, when both Python 2.x and 3.x are present. Migration t…

With all due respect, as someone that’s probably downvoted everything you’ve said on this thread, my reasons for doing so have nothing to do with your language preferences. Your comments are needlessly impassioned and vitriolic. I am not even remotely interested in the type of religious war discussion you are trying to foster.

I can honestly say with complete confidence that I’d feel this way regardless of what language you were talking about.

In addition to this though, as someone that writes Python / Django professionally and has done so for some time, my familiarity with the language gives me the necessarily insight to see where your experience is limited. I’ve seen a few inarguable factual inaccuracies (i.e. not based on opinion) in what you’ve said in a few comments. It seems obvious that when you engage with Python and Django you aren’t doing so all that willingly. But honestly your strength in your convictions puts me off getting into a back and forth with you to reach a shared understanding. The confidence with which you’re writing feels a bit misplaced.

Your overuse of hyperbole makes it hard to tell what you actually believe and what you’d genuinely argue for in a real-life professional context rather than behind a screen name on an Internet forum, so even if I wanted to engage in a back and forth I wouldn’t even know where to meet you.

This is a classic example of the loudest and most impassioned voices framing themselves as winning because people just don’t want to engage.

This is all to say before writing off downvoters are upset people on “the other team” which are lesser than you, consider the possibility that you’re probably throwing your weight around a bit too much and are creating an environment that’s generally unpleasant. I’ve enjoyed the tech community largely moving away from the “us vs them” mentality. Truth be told, none of this shit matters enough to warrant that sort of mentality. I feel like I’ve stepped back in time reading your comments. Not only are they unenjoyable to read, but I am not an iota more enlightened about the comparative benefits of Ruby vs Python. So I ask you…what’s actually your intention in commenting in the first place? The truthful answer to that question is why I’ll continue to downvote.

Re: Ruby 3.2.0 is from another dimension

#169
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?

When i learned Ruby, it wasn't really a WTF for me - I just learned that '!' methods are destructive, while non-'!' aren't.

However, the destructiveness semantic has been significantly overloaded over the time, so each Ruby (Rails) project probably interprets them in a different way, and it ends up having arbitrary semantics.

I'm used to it, but I personally think that for the reason above, it's not a good syntax/semantic to have in a language.

Re: Ruby 3.2.0 is from another dimension

#170
post #46

Earlier quoted context omitted.

I explored this topic a while ago on my blog [0] In essence, I don't think it has anything to do with elegance, syntax, or "easiness". It's more about timing + origin + corporate adoption: * Python was created in Europe, Ruby was created in Japan - when Ruby gained more recognition in English-speaking world (~2004), Python has already been present and used worldwide for a decade * Ruby was created as a personal, hobb…

Note that the Python core team started working with the scientific community very early on, the first scientific packages (as well as additions to python for scicom like extended slices) date back to the mid 90s. GvR’s background probably helped spread the word and thus get feedback, but as often Python’s overnight success was the result of years of work.

The Python core team early on was part of the scientific community. GvR worked at CWI (Centrum voor Wiskunde en Informatica), which was a part of the particle accelerator installation that Amsterdam had once upon a time until most such research went to Switzerland and the USA. CWI has, together with NikHef (the Dutch Nuclear Phyiscs Institute) done a lot of ground breaking research over the years and was the cradle of quite a few spin-off projects.
Post reply on HN