Having worked at a few of the top ones, many of them are now investing huge $$$ to rearchitect their tech platform to Java and services. I understand that Ruby allowed them to grow fast, but I am wondering if starting with Java to begin with would have allowed them to avoid massive investment to address tech debt at the expense of growth and profitability at a late stage.
You only get to have the problem of rearchitecting for scale if you're successful. You can't worry about that too much when you're still trying to find product/market fit.
Perhaps they should switch over to Elixir instead. It's somewhat similar to Ruby, but the performance of the Erlang VM (BEAM) is second to one for multithreaded and multiprocessed workflows, as is usually the case for many clients on a server for a web app. Of course, Elixir is not as fast as say Rust or perhaps even Java for raw computational work, but I'd say the tradeoff is worth it.
This is why languages such as D and Nim are interesting. They support both styles of development. You can always use the RAD style to get to something people like, optimize the fast paths, and still use RAD style on experimental features.
The prebuilt libraries are the main advantage Ruby and Python have. A converter for them to new languages would negate that, though.
Types, among the most performant garbage collected languages out there, very mature dev tooling that can speed you up in many ways, large library set, history of being more open than C#. Also many data libraries are made with it and interface well with it, such as kafka, hadoop, etc.
And there are many good engineers who are well versed with the language.
Scala has bad build times and a compiler that people have a hard time understanding AFAIK, so it's future development is more suspect. And it has as reputation of large companies moving away from using it: https://en.wikipedia.org/wiki/Scala_(programming_language)#C...
While something like kotlin has a small learning curve and gives you a lot of the benefits of scala. And it's backed by google, jetbrains & the investment that goes into android. Most people understand ADTs, nullable types, lambdas and data classes fairly readily.
I think it basically comes down to a company making a system out of a dynamically typed garbage collected language of either php, javascript, python or ruby, and suffering the perf issues (~8x slower than C/C++) and lack of type safety that it gives. Also those languages typically have ecosystem issues as far as the robustness of their libraries go (like javascript).
A more mature company settles into a typed GC language (Java, C#, Golang) and a typed static language for perf benefits when needed (C++, Rust). Yes there are typed versions of various dynamic languages now, but you don't get the speed benefits that the typing gives you, and a large part of the library ecosystem that you will interact with will still be untyped under the hood.