Live data from Hacker News

Ruby 3.3

ruby-lang.org

201–210 of 277 posts

Re: Ruby 3.3

#201

Earlier quoted context omitted.

Having tried to use Ruby for text processing specifically, I'm not sure I agree it beats Python at that particular task. Maybe I'm just used to the Python way of doing things, but I found it difficult to work with the lack of first-class functions and iterators/generators, as well as the general iteration protocol.

> but I found it difficult to work with the lack of first-class functions and iterators/generators, as well as the general iteration protocol. Ruby has iterators/generators. It doesn't have first-class functions because it doesn't have functions at all , but blocks/procs serve the same purposes.

I don't know Ruby, but it kinda sounds like Ruby just calls first-class functions blocks.

Re: Ruby 3.3

#202

Earlier quoted context omitted.

> but I found it difficult to work with the lack of first-class functions and iterators/generators, as well as the general iteration protocol. Ruby has iterators/generators. It doesn't have first-class functions because it doesn't have functions at all , but blocks/procs serve the same purposes.

I don't know Ruby, but it kinda sounds like Ruby just calls first-class functions blocks.

No, blocks are lambdas.

Re: Ruby 3.3

#203

Earlier quoted context omitted.

Ruby is basically a less popular but more elegant Python. It’s a solid general purpose language, but especially good at shell scripting, data munging, etc. If you’re fluent in Node and Python it should be quite easy to learn. The downside is it’s not going to do anything fundamentally new for you coming from those languages. The upside is mostly aesthetic, Ruby offers and encourages really beautiful ways of expressin…

Having tried to use Ruby for text processing specifically, I'm not sure I agree it beats Python at that particular task. Maybe I'm just used to the Python way of doing things, but I found it difficult to work with the lack of first-class functions and iterators/generators, as well as the general iteration protocol.

I think you may just be used to Python still relying on functions for string processing, where Ruby has methods on the String class for manipulating strings.

It seems to me that Python still has these holdovers from when it was not fully object-oriented, where a lot of string and data structure manipulation is done with language-level functions rather than methods on the objects, which can be quite confusing.

Re: Ruby 3.3

#204
Looks good. There's a new IRB, the interactive Ruby interpreter, with better autocompletion and debugging. Most of the Ruby 3.3 changes will lead to improved developer tooling. The language API is largely unchanged and consistent with previous releases. I wrote a guide [1] for the update to Ruby 3.3, with notes for each of the various version managers.

[1] https://mac.install.guide/ruby/update.html

Just curious, which version manager would you recommend? Previously I recommended asdf, frum, or chruby.

Re: Ruby 3.3

#205
post #193

Earlier quoted context omitted.

What a bizarre take. Ruby is primarily used in web applications, where round-trip http requests, database queries, and other 10s-of-ms things are commonplace. Ruby is very rarely the bottleneck in these applications. Choosing to make your job significantly more challenging in order to maximize the performance of a small portion of the total response time of a web application is not, in my estimation, a smart decision…

You're literally the exact person I'm talking about. No serious application developer who's interested in speed is working in Ruby. This isn't my opinion. I don't care personally, it's just a fact if you care about reality. When Netflix announces that they use Ruby because it performs faster than Node.js, I'll change my opinion, because my opinion is based on facts and not feelings. I didn't make Ruby, so whether it…

Nobody is pretending Ruby is the fastest interpreter. Who are you arguing against? Rubyists generally consider Ruby “fast enough”. Which it is, for many applications.

For every engineer insisting Ruby is fast enough in a situation where it is not, there are 1000s in environments where Ruby absolutely is more than sufficient, insisting it’s too slow.

Re: Ruby 3.3

#206
post #102
post #66

Earlier quoted context omitted.

I worked with ruby, ruby in rails(RoR) more specifically, a bit more than ten years ago(2011-2013). At that time it was already the afterglow of RoR, the framework for web development that had come to life in 2005 and raged between 2007 and 2009. The latest-technology-addicted crowd was jumping into the boat of node.js, that was crazy fast compared to anything done RoR, and API oriented development with angularjs. In…

Ruby and Ruby on Rails are not in a downward trend. There were maybe some year where the interest was decreased but in the last 2 years a lot of things happened: Ruby has a lot new features, Rails 7 is out and comes with a new approach to web apps like for example Horwire with the just released Turbo 8. And there is a lot more: new conferences, new books and new gems. (Shameless plug: I curate a newsletter called Sho…

Google trends says there's a decline. Admittedly this is interest from the general public, not the feature set or the active developer community, but still, it reflects something.

https://trends.google.com/trends/explore?date=all&q=Ruby%20o...

Re: Ruby 3.3

#207
post #117
post #100

Earlier quoted context omitted.

Not op but compared with Python it's heavier in the syntax department. You would have an easier time going in the other direction and encounter less situations where you have to stop and think about what to use in which situation while learning.

Python has far more custom syntax than Ruby. In Ruby an elegant syntax like blocks solves many problems, in Python each problem has custom syntax.

Quick, which language is this written in?

a = [1,2,3,4]

for b in a

  print(b)
end

Re: Ruby 3.3

#208
post #127

Earlier quoted context omitted.

But you could return the 1000 objects (or less? 1000 records sounds like a lot for any UI to show at once) of 1kb size and allow the clients to request specific pages with a request parameter. There may be applications where you need to ship the full 1M records I guess, but that seems like very much an edge case as far as web apps go.

1,000 records is absolutely not a lot on modern computers or connections. On a business LAN, this request should take well under a second full latency. On an average mobile connection, it’s maybe a second or so.

You’re right. It’s not a lot for a machine. The point isn’t the speed capability. It’s why? What UI has 1,000 rows in, e.g., a table all at once (much less 1M)?

Re: Ruby 3.3

#209
post #147
post #122

Earlier quoted context omitted.

If you compare pure Ruby without Rails to fast language like Rust, Go and Java. It is probably closer to 10-20x. The 100x to 200x mainly comes from Rails.

Can we stop with these useless comparisons? 10x-20x, 100x, 200x out of context means absolutely nothing. All these micro-benchmarks shootouts means nothing either. Is anyone running a mandelbrot or pi-digits SaaS company? I'd think not. Similarly saying Rails is slow out of context, means nothing, Rails is "slower" than Ruby micro-frameworks X because it does useful things the other doesn't like CSRF protection etc.…

On the other hand, why is it wrong to say Ruby or Rails is slow? Especially in the context of Java or Go? What is wrong with accepting a simple ground truth that is compiled language is and will always be faster than an interrupted language, even with JIT.

For Rails I often compare to it another CRUD app, StackExchange [1] using ASP.net And the easiest real world comparison with Rails App would be Cookpad. Are we not seeing at least 10x difference if not more.

Is Rails fast enough? That depends on the context. Everyone's business model is different. It is almost definitely fast enough for most SaaS cases.

[1] https://stackexchange.com/performance

Re: Ruby 3.3

#210
post #206
post #102

Earlier quoted context omitted.

Ruby and Ruby on Rails are not in a downward trend. There were maybe some year where the interest was decreased but in the last 2 years a lot of things happened: Ruby has a lot new features, Rails 7 is out and comes with a new approach to web apps like for example Horwire with the just released Turbo 8. And there is a lot more: new conferences, new books and new gems. (Shameless plug: I curate a newsletter called Sho…

Google trends says there's a decline. Admittedly this is interest from the general public, not the feature set or the active developer community, but still, it reflects something . https://trends.google.com/trends/explore?date=all&q=Ruby%20o...

I admit that Google Trends shows a decline from 2004-2007 era.

It could be my optimism, or it could be that I am biased, but I have seen at least a flat line since 2022 in that graph.

As I said, I see an increase when I look at the number of conferences, books, or gems started. That is a strong signal for me that the community is growing, or at least the community thinks it is growing.

Post reply on HN