Live data from Hacker News

Ruby 4.0.0

ruby-lang.org

111–120 of 197 posts

Re: Ruby 4.0.0

#111
post #87
post #79

Happy bday ruby! For the usual doomsdaysayers saying "ruby can't X so I left it for Y", when X is typing, RBS is becoming the accepted standard (now that sorbet supports it),and RBS inline notation next to signature/code too (for peeps complaining about separate files); when X is LSP, ruby-lsp is the standard and already supports "go to definition" (its major hole for a long time), and its plugin architecture allows…

Fairly hardcore rubyist here. Ruby-lsp is excellent. But in no way is RBS becoming standard. Maybe it will, I don’t know. But adoption is very, very low as of today. Rbs-inline is just someone’s pet project and has very little activity (though it does appear that the person who wrote it is trying to implement it directly into Rbs now, which would be great) Personally I can’t see any comment based typing system gainin…

Maybe I wasn't clear, but until now there were 2 types of type notations being debated, RBS and sorbet/RBI. Sorbet adopting RBS means that's the lowest common denominator. Typing is definitely not a standard, not yet. rbs-inline is definitely not a pet project, it's the RBS creator response to the main complaint about RbS , its the reason sorbet finally adopted it, and will be part of mainline rbs gem.

Re: Ruby 4.0.0

#112
post #79

Happy bday ruby! For the usual doomsdaysayers saying "ruby can't X so I left it for Y", when X is typing, RBS is becoming the accepted standard (now that sorbet supports it),and RBS inline notation next to signature/code too (for peeps complaining about separate files); when X is LSP, ruby-lsp is the standard and already supports "go to definition" (its major hole for a long time), and its plugin architecture allows…

It’s just inferior to Python, nobody is making a more complex argument than that. Why ever use Ruby when there’s a virtually identical system that’s faster with a bigger community.

> that’s faster

In every test I've done, Ruby has been faster than Python. In my experience that's been the case since Ruby 1.9, with the move to YARV.

Re: Ruby 4.0.0

#113

Earlier quoted context omitted.

Semantics.

Literally all those libraries are usable with Ruby. Libtorch, BLAS, LAPACK, Tensorflow, etc...

And with Java, and with Go, and with Rust, and with pretty much any language offering some form of FFI. But they're used with Python, and good luck convincing your interviewer that it should be used with Ruby.

Re: Ruby 4.0.0

#114
post #87

Earlier quoted context omitted.

Fairly hardcore rubyist here. Ruby-lsp is excellent. But in no way is RBS becoming standard. Maybe it will, I don’t know. But adoption is very, very low as of today. Rbs-inline is just someone’s pet project and has very little activity (though it does appear that the person who wrote it is trying to implement it directly into Rbs now, which would be great) Personally I can’t see any comment based typing system gainin…

As long as Matz is firmly against, inline typing should never be a part of Ruby. I started working on a large Rails codebase that adopted Sorbet and it is nothing but an impediment to progress.

> adopted Sorbet and it is nothing but an impediment to progress

How so?

I never really missed types in Ruby, even if I like them a lot in typescript, but right now I'm doing some "vibe coding" on a personal project and I was thinking about trying Sorbet. I think that it could help Claude Code avoid some mistakes it often makes which make it waste a lot of time fixing.

Re: Ruby 4.0.0

#115
post #101

Earlier quoted context omitted.

It’s just inferior to Python, nobody is making a more complex argument than that. Why ever use Ruby when there’s a virtually identical system that’s faster with a bigger community.

Ruby is a lot less awful than Python in my opinion. That is of course a very subjective opinion. The only reason I write more Python than Ruby is that ruby lacks the libraries I need. Somewhere along the line Python got all the momentum, and ruby got none and now python is better if you just want to get shit done. But man. I wish it was the other way around. I have one code snippet that summarises what I dislike abou…

[dead]

Re: Ruby 4.0.0

#116

I haven't looked at Ruby for a long time. I've moved away due to the lack of typing. Any degree of typing would be helpful. Does it support typing yet?

another early days project but pretty well thought out in that space: https://github.com/yippee-fun/empirical/blob/main/literally_...

Re: Ruby 4.0.0

#117
post #112

Earlier quoted context omitted.

It’s just inferior to Python, nobody is making a more complex argument than that. Why ever use Ruby when there’s a virtually identical system that’s faster with a bigger community.

> that’s faster In every test I've done, Ruby has been faster than Python. In my experience that's been the case since Ruby 1.9, with the move to YARV.

I don't think anyone says: "I switched from Python to Ruby" (of vice versa) for performance.

Re: Ruby 4.0.0

#118
I gave it a try a few months ago. The first thing that I searched for was the REPL. Comparing it with Python, I prefer ipython over irb. It would be nice to see some improvement on DX on the REPL side

Re: Ruby 4.0.0

#119

Ruby 4.0's parallel execution improvements are a game-changer for the ecosystem. The ruby::Box feature addresses one of the biggest pain points - GIL limitations - while maintaining Ruby's elegance. What's particularly exciting is how this positions Ruby for modern workloads. With proper parallelism, Ruby apps can finally compete with Go and Node.js in concurrent scenarios without sacrificing developer happiness. The…

from what I understand, ruby::Box has nothing to do with GIL. At least, not yet.

Re: Ruby 4.0.0

#120
post #19

Earlier quoted context omitted.

I've been doing if condition1 && condition2 ... end for ages and it seems to work find, what am I missing with this new syntax?!

I prefer the new way because if you want to remove one condition you just delete the line rather than having to edit in multiple places.

I first picked up this style from the GNU C++ style guide, and it's so handy I use it in every language that accepts it.
Post reply on HN