Live data from Hacker News

Ruby 3.4.0

ruby-lang.org

161–170 of 282 posts

Re: Ruby 3.4.0

#161
post #147

Earlier quoted context omitted.

“Node makes it impossible to write blocking code” reminds me of this classic and hilarious piece by Ted Dziuba: http://widgetsandshit.com/teddziuba/2011/10/node-js-is-cance...

Heh, he's so right in every regard although I use Node. Worst of all, they made npm packages dead easy, so most of them don't even have a readme file, not to mention inline docs like POD or RDoc. This is how you end up with spam pacakges, malware in npm and lpad disasters.

> most of them don't even have a readme file

Given the popularity of Github, and the fact that a readme file is the first thing you see when pulling up a project on Github, most projects these days do in fact have readme files.

> inline docs like POD or RDoc

JSDoc is relatively popular.

Re: Ruby 3.4.0

#162

Earlier quoted context omitted.

> You will need to sign the Oracle Contributor Agreement (using an online form) for us to able to review and merge your work. Read my lips: N. O. Read the CLA. This is a trap, do not get yourself or your company caught in it. It is open-source for now, until it gets enough traction. Then the rug will be pulled, the code will be relicensed as well as any further development or contributions. This is insane , I cannot…

Oh wow! Thanks for the clarification! Is the case same with JRuby?

JRuby -- no CLA.

Java is problematic though. See my other comment.

Re: Ruby 3.4.0

#163

Earlier quoted context omitted.

No wait, I know Oracle has a bad rep which is deserved, but TruffleRuby and GraalVM is truly open-source, not open-core. They actually did something great this time. Someone pointed this out https://news.ycombinator.com/item?id=42323293

> You will need to sign the Oracle Contributor Agreement (using an online form) for us to able to review and merge your work. Read my lips: N. O. Read the CLA. This is a trap, do not get yourself or your company caught in it. It is open-source for now, until it gets enough traction. Then the rug will be pulled, the code will be relicensed as well as any further development or contributions. This is insane , I cannot…

For what it worth, in France so called moral rights are "innaliénables", so you legally can't get rid of them, and I wouldn't be surprised this holds in most Roman civil law countries (most countries in the world). Just like you can't decide to get rid of all your civil rights and become a slave of the nice company that promised to treat you well and free you of the hurdle to take decisions by yourself. So IANAL but this contract is not only ignominious but is actually trying to require authors to make promises that they can not legally make.

https://en.m.wikipedia.org/wiki/Civil_law_(legal_system)

Re: Ruby 3.4.0

#164

I want to try Ruby since the news of Rails 8 came out, but it's been so difficult that I just gave up. Installing Ruby on Mac and Windows and actually getting the 3.3 version required for Rails 8 was a huge mission and test of patience because every installer defaulted to older versions of both Ruby and Rails even one month after the release. And yes, even Docker required tweaking to get the versions and I had issues…

Use asdf ( https://asdf-vm.com/ ) to manage your Ruby versions. You should be able to do $ asdf plugin add ruby $ asdf list all ruby (you'll see 3.4.1, the latest is available) $ asdf install ruby 3.4.1 And now you can use Ruby 3.4.1 with no issues. Follow that up with $ gem install bundler $ gem install rails $ rails new ...

Or mise, https://mise.jdx.dev/

Re: Ruby 3.4.0

#165

Earlier quoted context omitted.

It's the language with the highest ratio of (useful work / LOC), so it's the least verbose language. This makes it very suitable to write and understand complex scripts, because the reduced boilerplate means less cognitive overhead for the programmer. As a result, experienced programmers can be extremely productive with it. The well-known Rails framework uses this to great effect, however, some people argue that the…

>It's the language with the highest ratio of (useful work / LOC), so it's the least verbose language Why doesn't clojure fit the bill here?

)))))))))))))))))

Re: Ruby 3.4.0

#166

I want to try Ruby since the news of Rails 8 came out, but it's been so difficult that I just gave up. Installing Ruby on Mac and Windows and actually getting the 3.3 version required for Rails 8 was a huge mission and test of patience because every installer defaulted to older versions of both Ruby and Rails even one month after the release. And yes, even Docker required tweaking to get the versions and I had issues…

Use rvm to install ruby. Ruby dev sucks on Windows, mac only.

What sucks about it?

Re: Ruby 3.4.0

#167
post #10

Shopify strategy aka the story of YJIT If I cannot refactor my services, I shall refactor Ruby instead.

During their black friday / cyber monday load peak, Shopify averaged between ~0.85 and ~1.94 back-to-back RPS per CPU core. Take from that what you will. Reference: https://x.com/ShopifyEng/status/1863953413559472291

Just to reiterate stuff said in the other comments because your comment is maybe deliberately misrepresenting what was said in the thread.

Their entire cluster was 2.4 million CPU cores (without more info on what the cores were). This includes not only Ruby web applications that handle requests, but also other infrastructure. Asynchronous processing, database servers, message queue processing, data workflows etc, etc, etc. You cannot run a back of the envelope calculation and say 0.85 requests per second per core and that is why they're optimising Ruby. While that might be the end result and a commentary on contemporary software architecture as a whole, it does not tell you much about the performance of the Ruby part of the equation in isolation.

They had bursts of 280 million rpm (4.6 million rps) with average of 2.8 million rps.

Re: Ruby 3.4.0

#168
post #6

Earlier quoted context omitted.

Agreed. Parser generators are a magic black box. Parsing is not too difficult, there is some actual computer science in some spots, but I think parsing should be a core complacency of a programming language to unlock full potential.

A very very long list of CVEs disagrees with that parsers are "not too difficult".

Agreed, but there are different things being prioritized with each approach.

Re: Ruby 3.4.0

#169

Earlier quoted context omitted.

During their black friday / cyber monday load peak, Shopify averaged between ~0.85 and ~1.94 back-to-back RPS per CPU core. Take from that what you will. Reference: https://x.com/ShopifyEng/status/1863953413559472291

Just to reiterate stuff said in the other comments because your comment is maybe deliberately misrepresenting what was said in the thread. Their entire cluster was 2.4 million CPU cores (without more info on what the cores were). This includes not only Ruby web applications that handle requests, but also other infrastructure . Asynchronous processing, database servers, message queue processing, data workflows etc, et…

> It does not tell you much about the performance of the Ruby part of the equation in isolation.

Indeed, it doesn't. However, it would be a fairly safe bet to assume it was the slowest part of their architecture. I keep wondering how the numbers would change if Ruby were to be replaced with something else.

Re: Ruby 3.4.0

#170

Earlier quoted context omitted.

Just to reiterate stuff said in the other comments because your comment is maybe deliberately misrepresenting what was said in the thread. Their entire cluster was 2.4 million CPU cores (without more info on what the cores were). This includes not only Ruby web applications that handle requests, but also other infrastructure . Asynchronous processing, database servers, message queue processing, data workflows etc, et…

> It does not tell you much about the performance of the Ruby part of the equation in isolation. Indeed, it doesn't. However, it would be a fairly safe bet to assume it was the slowest part of their architecture. I keep wondering how the numbers would change if Ruby were to be replaced with something else.

Since we're insinuating, I bet you that Ruby is not their chief bottleneck. You won't get much more RPS if you wait on an SQL query or RPC/HTTP API call.

In my experience when you have a bottleneck in the actual Ruby code (not speaking about n+1s or heavy SQL queries or other IO), the code itself is written in such a way that it would be slow in whichever language. Again, in my experience this involves lots of (oft unnecessary) allocations and slow data transformations.

Usually this is preceded by a slow heavy SQL query. You fix the query and get a speed-up of 0.8 rps to 40 rps, add a TODO entry "the following code needs to be refactored" but you already ran out of estimation and mark the issue as resolved. Couple of months later the optimization allowed the resultset to grow and the new bottleneck is memory use and the speed of the naive algorithm and lack of appropriate data structures in the data transformation step... Again in the same code you diligently TODOed... Tell me how this is Ruby's fault.

Another example is one of the 'Oh we'll just introduce Redis-backed cache to finally make use of shared caching and alleviate the DB bottleneck'. Implementation and validation took weeks. Finally all tests are green. The test suite runs for half an hour longer. Issue was traced to latency to the Redis server and starvation due to locking between parallel workers. The task was quietly shelved afterwards without ever hitting production or being mentioned again in a prime example of learned helplessness. If only we had used an actual real programming language and not Ruby, we would not be hitting this issue (/s)

I wish most performance problems would be solved by just using a """fast language"""...

Post reply on HN