Live data from Hacker News

Ruby 3.2.0 is from another dimension

tomaszs2.medium.com

191–200 of 341 posts

Re: Ruby 3.2.0 is from another dimension

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

I don't know anything about Rails but after having built a fairly large production web app with Django about a year ago, nothing about it felt cutting-edge to me:

- Async support was second class back then, not obvious how to implement fully.

- REST APIs are a library add-on instead of first-class. An excellent library, but still.

- The package ecosystem sometimes reminded me of the wild-west that is Node.js

- Dependency management is a complicated story (arguably caused by Python, rather than Django itself)

- Django Models are cool and expressive, but nowadays I would rather express my models in something like a dataclass, or a Pydantic model, or just a regular class...

Maybe Rails has these problems and more, I don't know. I'm not saying I'm never going to use Django again, but there's a large chance I will look elsewhere for a batteries-included framework next time I need one.

Re: Ruby 3.2.0 is from another dimension

#192
post #74
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…

Be that as it may, what does it matter? You are chronicling ancient history at this point. These languages are more alike than they are different. Or at least they are similar enough that one pulled ahead and subsumed the other. Like a twin eating his brother in the womb. Maybe it could have gone the other way and we would have ended up pretty much in the same place. Or maybe it is a case of worse is better. But not…

> These languages are more alike than they are different.

I agree with this point. I learned python years before I learned Ruby and I found them to be very similar. Ultimately I dropped ruby because I didn't care much for the syntax and I like whitespace.

Re: Ruby 3.2.0 is from another dimension

#193

Earlier quoted context omitted.

> There’s no need for adding say, len, to every object that needs a len function. I’d argue that is consistent. Python's len works by calling the __len__ method, which must be added to every class that needs a len function. Since you're already defining a method with a standard name on every class that needs it, Ruby just has you call that method directly as opposed to the absurdity of intentionally obfuscating the m…

It's almost like they have become memes in themselves. "There is only one way to do it" -> except for those cases where there is a multitude, including the base choice of major release of interpreter, package manager, and so on. Python is very usable but it definitely isn't perfect and the only way you get to improve on stuff is to recognize its shortcomings.

I'd agree that __len__ is a fairly trivial example, but it is used for truthiness in Python too. It seems like a reasonable choice to mark these blessed methods that the language is using deeply as part of the runtime in a special way but I'll happily concede that it could have been X.len() instead.

`sorted`, `list`, `set`, are more interesting cases where they all work with the underlying __iter__ protocol. You don't also want to add X.sorted(), X.as_list(), X.as_set() etc too. Again, you could have X.as_iterable() to implement these, or you could mixin sorted, which will call the __iter__ function. But honestly, it's really neither here nor there.

For the full avoidance of doubt - I'm not arguing for these other "memes" and, in particular, "There is only one way to do it" has never made that much sense to me.

I am arguing that Pythons `sorted` api is reasonable, consistent and not worth worrying about.

Re: Ruby 3.2.0 is from another dimension

#194

Earlier quoted context omitted.

Map/filter are considered inferior in Python to list comprehensions. res = [x**2 for x in range(10) if x != 5]

By who? I always have to stare at list comprehensions very closely to understand operation being done. The source of the data is in the middle, where it should logically come first. The filter is at the end, where logically it should come after the source. The mapping is at the start, where logically it should come at the end. I find the monadic, additive style of Ruby much easier to understand: 10.times.select { |x|…

> By who?

By the Python developers and its wider community. As Python doesn't have anonymous function blocks in the same way as Ruby (only lambda expressions), tutorials, lessons and the Python docs steer users toward list comprehensions instead.

I'm not saying the ruby syntax is not elegant (it is), I'm saying in Python list comprehensions are recommended over filter/map functions.

On the composable front, personally I prefer to breaks these down into smaller chunks with descriptive variable names rather than chaining.

Python also has the sister "generator" (() rather than []) syntax which also ensures it remains efficient as it pipelines the whole sequence of generators. (Lazily rather than eagerly as you say)

Re: Ruby 3.2.0 is from another dimension

#195
post #183

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 also explored why Ruby is so hard to learn for people like me on my blog [1]. I totally agree with you. I had to use Ruby at work and I really struggled to grok it. I've picked up many programming languages in my career but Ruby was one of the hardest to really understand. [1] https://wbk.one/article/a463c360/the-ruby-tutorial-i-wish-i-...

To me, Python felt like R. Designed by an academic - possibly without computer science knowledge. In a manner where humans bow to how a computer does things. Whereas a similar language of the time, C++ was a more properly designed language.

Ruby more like a philosophy major designing an OOP language - getting done and enjoying getting there were the goals. I took to Ruby more because i never cared about the "engineering" part of languages - just using them as tools to get things done.

Re: Ruby 3.2.0 is from another dimension

#196
post #145

Earlier quoted context omitted.

One funny anecdote (and unfair one) is that what Twitter wasn't able to do (rails scale), Mastodon did.

I recall several discussions of it at the time, and I don't think it's so much that they weren't able to, as that they'd made lots of disastrous architecture decisions (building it around a monolithic database etc.) that required a rewrite, and whomever doing it used it as an opportunity to blame it on Rails as an excuse to switch to their preferred stack. After all, sharding message distribution via federation (even…

Normally such decisions come from "Senior developers", which are experts in other domains than ruby on rails. How often you see them wanting to write raw sql in rails, "because its faster" and/or "much easier".. this summarizes a lot that problem https://daedtech.com/how-developers-stop-learning-rise-of-th...

Re: Ruby 3.2.0 is from another dimension

#197
post #193

Earlier quoted context omitted.

It's almost like they have become memes in themselves. "There is only one way to do it" -> except for those cases where there is a multitude, including the base choice of major release of interpreter, package manager, and so on. Python is very usable but it definitely isn't perfect and the only way you get to improve on stuff is to recognize its shortcomings.

I'd agree that __len__ is a fairly trivial example, but it is used for truthiness in Python too. It seems like a reasonable choice to mark these blessed methods that the language is using deeply as part of the runtime in a special way but I'll happily concede that it could have been X.len() instead. `sorted`, `list`, `set`, are more interesting cases where they all work with the underlying __iter__ protocol. You don'…

Language design is a hard problem. You have to make so many compromises to get it to the point where it works for a large variety of use cases that the degree of ugliness is almost directly proportional to the breadth of application and adoption. The only languages that manage to stay clean are the ones that nobody uses.

I don't think that's avoidable. Mistakes made early on have a habit of compounding over time and calcification makes it harder and harder to deal with them decisively and in a non-breaking way. Python made a couple of bad decisions but on the whole the language came out relatively unscathed, most of the original design constraints are still satisfied. As opposed to say PHP or Java which ended up very far removed from where they started out.

Case in point: Python's GIL must have seemed like a good idea at the time, a quick fix for an urgent problem. And now that quick fix is the albatross that we can't seem to get rid of.

Re: Ruby 3.2.0 is from another dimension

#198
post #10

Perhaps the official release info is of more interest. This blog post is quite 'inspired' by it. It does mention the source but I do not see the added value of the blog post over the official release info: https://www.ruby-lang.org/en/news/2022/12/25/ruby-3-2-0-rele...

Agreed. The author is surprised by a major Ruby release on Christmas day (tradition for many years) and uses a lot of superlatives for no reason.

Re: Ruby 3.2.0 is from another dimension

#199
post #182

Earlier quoted context omitted.

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

Oh, I didn't realize until now that Guido worked there. So we got at least two major contributions from the CWI. One is Python and the other one is the game of Hack. :)

There are many more:

The father of A*:

https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm

ALGOL 60 and ALGOL 68

First node on the Internet outside of the USA

Python

Various contributions to the improvement of encryption.

CWI has a long, long history of quietly contributing to all kinds of stuff the world over and has a pretty good reputation.

https://en.wikipedia.org/wiki/ALGOL_60

Re: Ruby 3.2.0 is from another dimension

#200

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…

If this comment is indicative of the general attitude of the Ruby / RoR community then I can’t exactly say that I’m jumping up and down to get involved. I feel like I’ve been transported 10-15 years back in time with this ridiculous negativity. Django and RoR are much of a muchness. Ruby and Python are too, to a lesser extent. This whole thing stinks of narcissism of small differences and sour grapes. To imply that e…

> If this comment is indicative of the general attitude of the Ruby / RoR community

It really isn't. On the whole I've rarely found a tech community that is kinder and more welcoming than Ruby's.

Post reply on HN