Live data from Hacker News

Ruby 3.3

ruby-lang.org

211–220 of 277 posts

Re: Ruby 3.3

#211

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…

There's always this rift between the "language is slow" crowd and the "but it's not the bottleneck" crowd. I think this comes from the types of applications you work on and their scale. I work at what a company that's not particularly large. Our original API is a Django monolith that serves about 1000req/s. While you could argue Python isn't the bottleneck, Django often is. I hear the same feedback from colleagues th…

It's 'resource usage' rather than 'speed'

Re: Ruby 3.3

#212
post #183

Earlier quoted context omitted.

Hi-tech are cyclical. Ruby got nothing else bigger than Rails unfortunately no matter how people in that community is hyping Ruby out. It's okay if Ruby and Rails on a downward trend it might pick up again in the future. C'mon now, we all know that our industry is like a Fashion industry. The only reason why Rails is making a comeback is because we're in tough time: no more VC money to hire tons of Engineers to build…

Correct. But now there is another complication to an eventual reemergence of ruby on rails: the competition defeated the initial comparative advantage - i.e. the simplicity - of the RoR platform. The premises that justified RoR in the past are too weak today in my opinion. The framework was sold on how easy and no-nosense it was setting it up and start prototyping your commercial solution in a time where the competit…

I think you should take a look at the Rails 7 - that includes by default Hotwire.

IMO, it is proposing another way to build web apps that goes back to the original proposal of Rails: simplicity and convention over configuration.

Rails 7 makes building modern web interfaces easy in the same way Rails 2 made building modern web pages easy.

Re: Ruby 3.3

#213
post #162
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…

>Maybe Ruby is not at the level where is was in 2007-2009 but it is also NOT in a downward trend. It's not only that ruby and ruby on rails are trending down, this has been the case for at least 10 years. https://berk.es/2022/03/08/the-waning-of-ruby-and-rails/ This is only an article, but you will find the same point of view in many other places. The decline of ruby and RoR is obvious for anyone doing web developmen…

There are some points from that article that are false: there are podcasts, there are collection of good Ruby gems, and analysis the unicorn companies that were started with Ruby (or Rails) is a biased analysis.

So, if you decide to switch, it is only logical for you to believe that the Ruby community does not bring anything new to the table. I am not saying it as a bad thing. I decided to stay with Ruby, so of course, I am looking for clues that my decision is still reasonable.

One point about your last phrase: the market for Ruby developers - especially seniors - is active. At least in my own corner of the internet.

Re: Ruby 3.3

#214
post #207
post #117

Earlier quoted context omitted.

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

Here's some advice. If you want to make a point, make it clear and direct. No one knows what point you are trying to make here.

Re: Ruby 3.3

#215
post #209
post #147

Earlier quoted context omitted.

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…

> What is wrong with accepting a simple ground truth

Where am I denying that? Saying that one of the most dynamic language is slower than Java or Go it's such a truism it's pointless.

What annoys me is the figures quoted. I can craft you benchmarks were Ruby is barely any slower than these two, or benchmark where it's 1000x slower. So which is the correct number to quote?

> For Rails I often compare to it another CRUD app, StackExchange [1] using ASP.net

This makes zero sense. You said:

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

So somehow you are blaming Rails for making Ruby 10 times slower whatever that means. That is a stupid statement that you took out of your hats and that doesn't reflect any reality. Please stop doing that, it's really unnerving for the people who maintain these projects.

Re: Ruby 3.3

#216

Earlier quoted context omitted.

What's wrong with Django's orm? Does it have something particularly bad compared to others?

I think the poster is specifically referring to using inheritance in Django ORM, where if you had e.g. a model Book and then a model Novel that inherits from it. In python these are modeled as a class inheritance hierarchy, and Django (at least, by default) creates a database table per class in the hierarchy. If you have 3-4 levels of inheritance, that's 3-4 extra joins per query.

Oh, got it thanks

Re: Ruby 3.3

#217
post #127

Earlier quoted context omitted.

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)?

Your assumption that humans consume this data is wrong. It's actually machines that need it.

Re: Ruby 3.3

#218
post #127

Earlier quoted context omitted.

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)?

Many plots contain thousands of data points. Eg: 10 x 100 heatmap which supports sorting by various metadata. This is a common visualization for biological data where your data matrix is samples x proteins, so potentially much larger than 1000 data points.

Re: Ruby 3.3

#219

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 not first class (procs are, and procs are the closest thing Ruby has to functions, and a method definition can bind convert the block passed to the function to a proc if a first-class value is needed.)

Blocks are a syntactically special single argument to a method that can either be yielded to (a Ruby construct similar to a function call but which only applies to the block passed to the current method) or converted to a proc (but the latter only as part of the method definition, since they aren't first class and thus cannot be manipulated or referred to directly.)

Re: Ruby 3.3

#220

Earlier quoted context omitted.

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

No, blocks are lambdas.

No, in Ruby lambdas are lambdas (and are a special type of proc); the longhand way to create a lambda is to call Kernel#lambda and pass it a block (though modern Ruby has a special shorthand syntax for lambdas, as well.)

Blocks are sort of like anonymous function literals that are not first class, one (but no more than one) of which may be attached to a function call.

Post reply on HN