News for hackers. Stuff that matters.
Re:Ruby Methods Are Colorless by newZWhoDis on Tuesday July 23, 2024 @06:38PM (#41051736)
Ruby/rails is full of shortsighted crap like this.

I feel stuck, our whole backend is legacy rails and I can’t escape.

Re:Ruby Methods Are Colorless by goatlover on Tuesday July 23, 2024 @07:26PM (#41052087)
Bit of a strong claim when the Erlang/OTP was designed to handle massive concurrency without colorful methods. Given that both Erlang and Ruby are inspired by the message passing semantics of Smalltalk.
Re:Ruby Methods Are Colorless by lmm on Wednesday July 24, 2024 @12:06AM (#41053523)
Unicoloured languages are great as long as your code doesn't have to actually do anything (which is lots of modern code, to be fair). Try writing a physics simulator or 3D renderer in Erlang and see how that goes.
Re:Ruby Methods Are Colorless by pmontra on Wednesday July 24, 2024 @04:15AM (#41054722)
Erlang is not great at math performance, also because it uses arbitrary length integers. There is a nice comparison between several languages, including Erlang at https://stackoverflow.com/questions/6964392/speed-comparison...

It all depends on how the code is written. Eventually somebody managed to make the Erlang code faster than the baseline C, then someone else made the C version 8k % faster, which proves your point. However, how is that related to using sync/async vs message passing?

Re:Ruby Methods Are Colorless by lmm on Wednesday July 24, 2024 @09:17PM (#41063881)
> Eventually somebody managed to make the Erlang code faster than the baseline C, then someone else made the C version 8k % faster, which proves your point. However, how is that related to using sync/async vs message passing?

If you want to write high-performance code then you need to be able to write synchronous code and have control over what your yield points are. If you take the "all calls are potentially async, runtime does what it wants" approach (i.e. "no function colouring") then you just will not be able to do that.

Re:Ruby Methods Are Colorless by igouy on Wednesday July 24, 2024 @01:11PM (#41059286)
> … Erlang … inspired by the message passing semantics of Smalltalk.

What makes you think that?

Re:Ruby Methods Are Colorless by goatlover on Thursday July 25, 2024 @04:18PM (#41072927)
The Wikipedia entry says Smalltalk was one of it's influences and Joe Armstrong, co-developer of Erlang, mentions message passing as the fundamental aspect of OOP that Erlang gets right.
Re:Ruby Methods Are Colorless by igouy on Thursday July 25, 2024 @07:03PM (#41074361)
The Wikipedia "Influenced by Lisp, PLEX,[2] Prolog, Smalltalk" seems to be un-sourced !

> … Joe Armstrong … mentions message passing …

Where?

Re:Ruby Methods Are Colorless by igouy on Friday July 26, 2024 @12:48PM (#41080096)
Here's something Joe Armstrong's PhD thesis does reference in the context of message passing:

"4.5 Programming Notations Based on Message Passing" p33

"Concepts and Notations for Concurrent Programming", Gregory R. Andrews and Fred B. Scheider, Computing Surveys 15(1) March 1983, pp 3 - 43

[pdf] https://www.cs.cornell.edu/fbs/publications/LangSurv.pdf

Re:Ruby Methods Are Colorless by rco8786 on Tuesday July 23, 2024 @09:41PM (#41052871)
Legacy codebases that are a joy to work with are few and far between, in any language.
Re:Ruby Methods Are Colorless by segfaltnh on Tuesday July 23, 2024 @10:03PM (#41052996)
Rails doesn't scale well in my experience. Or maybe rails devs don't scale well.

The language and framework are both centered around developer happiness, which in my experience drops off around 10,000 lines. That's about when projects start getting difficult.

Re:Ruby Methods Are Colorless by pmontra on Wednesday July 24, 2024 @03:34AM (#41054482)
A Rails project I'm working on has this LOC

  Ruby 12169
  ERB   2339
  Vue  24895
  Js    4526
The Vue frontend is indeed more complex than the Rails backend, and in my experience Vue is much simpler than React. My customer organized the Rails app with models, controllers, api/v1/controllers, jobs, services (naming only the most important stuff). It's not bad to work with.
Re:Ruby Methods Are Colorless by norman784 on Wednesday July 24, 2024 @05:29AM (#41055179)
I also work on a legacy Ruby/Rails codebase, what I dislike is Ruby as a dynamic language, I'd prefer typed languages, but overall Rails didn't changed too much in the last 14 years that I know it (I didn't used too much in the past), but the concept is still the same to this day, few changes to the API/syntax, but otherwise if you know Rails, if you know Rails, it is most likely that you find very easy to work on any Rails app.