I really wish Ruby would grow up and deprecate method_missing
Ruby 3.0 Preview 1
11–20 of 207 posts
Re: Ruby 3.0 Preview 1
#12JavaScript has a similar pattern with Workers, and it makes concurrency for hot code impractical. Serializing/deserializing objects is a lot slower than just not doing that. In JavaScript’s case, you can also use SharedArrayBuffer, but Safari hasn’t re-enabled it.
Re: Ruby 3.0 Preview 1
#13I really wish Ruby would grow up and deprecate method_missing
method_missing is a deliberate and principled part of a message-passing approach to object orientated programming that gives you powerful options for composition and delegation.
You can say you don't prefer this style of programming, but it's not well-informed to say it's down to immaturity or ignorance of alternatives on their part.
Re: Ruby 3.0 Preview 1
#14Re: Ruby 3.0 Preview 1
#15I love Ruby and great to see Ruby love on hacker news. Just curious on how popular it is in the hacker news community ?
Seems to be well represented by successful companies here.
Re: Ruby 3.0 Preview 1
#16Re: Ruby 3.0 Preview 1
#17This is exactly the kind of stuff I hated when I had to work with ruby in my last gig and why I will never accept a job using it again - soo many pointless and inconsistent ways to do the same thing ... they have method aliases for collection operations like map/filter in standard library ! .NET went with non-standard SQL-like names (select/where) and I'm not a fan but at least they made their choice and stuck with it. And it's inconsistent all over the place - like '!' postfix means "operation mutates the object" in std lib BUT in rails it means the operation will raise an exception and not return an error code.
Now they add a pointless operator that means completely different thing in other languages to throw off even more people.
It's just a hell of a language to maintain someone else's code in.
Re: Ruby 3.0 Preview 1
#18Earlier quoted context omitted.
puma, the default webserver when using rails, is most-likely what would be using ractors
Here's schneems, a Puma maintainer, talking about Ractor, Rails, and Puma https://old.reddit.com/r/ruby/comments/ivasiq/we_made_puma_f...
I wonder if this will create a chicken-egg situation. Without significant Ractor adoption it will be hard to get libraries to adapt. Without essential pieces like Puma supporting (and benefiting from) Ractor there is less reason to for apps to use Ractor.
I am reminded of the difficulties faced by Rubinius, which if I understand correctly, was hampered by too many MRI-compatible libraries not working to get people to switch.
Re: Ruby 3.0 Preview 1
#19Does message passing mean it copies objects you send between threads / fibers, rather than sharing memory? JavaScript has a similar pattern with Workers, and it makes concurrency for hot code impractical. Serializing/deserializing objects is a lot slower than just not doing that. In JavaScript’s case, you can also use SharedArrayBuffer, but Safari hasn’t re-enabled it.
However you can always just open a shared memory region and write bytes back and forth. You don't get ruby types but if you are worried about performance that probably isn't much of a concern.