Recently watched this video by #ThePrimeTime on #Youtube, and his hot-take 🔥 was that they were using #Ruby, and half of their pain was caused by this.
I have no experience with Ruby at all and most probably won't even recognize it if I were to read it.
If Ruby is such a bottleneck and inefficient, why did #Mastodon :mastodon: use Ruby for its implementation?
I know Ruby is often praised for servers and backends, especially APIs, but we have many solutions for this in #Python :python: , which I wouldn't recommend, but #Go :golang: and #Rust.
Does anyone have opinions or sources for this statement?
@Stark9837 this entire discussion was started by one company, BaseCamp. AFAIK, no other Ruby/Rails shops have "left the cloud". This is likely because BaseCamp has unique workloads and performance requirements which the pricing model of "the cloud" penalizes. The whole idea of "the cloud" is to cram as many tenants into one datacenter, which assumes all of those tenants have minimal usage requirements. If one tenant is a big company that requires lots of dedicated resources, that will cost $$$.
@Stark9837 I think there’s also another aspect to consider: development speed. RoR and Ruby more generally has always had a great focus on testing, and a solid Ruby dev can knock out a lot of /complete/ features in a very short amount of time.
If Mastodon hadn’t been as featureful at the exact moment it was, it may not have had the success/uptake that we’ve seen now.
The same is true for companies. Having the best, most optimised piece of code is useless if you run out of runway.
@Stark9837 i have no doubt that rewriting his project in python with the goal of making it faster made it faster. Theres always a faster language, a more efficient framework, some new database that would be perfect for your needs. The question is whether refactoring your codebase is a better use of your time than adding new features and i dont think mastodon is there yet. I think the developers should stay wherever theyre happiest.
@badrs@Stark9837 Rewriting to Python means outsourcing performance to C. I would expect a performance improvement if you don't write hot loops yourself.
But it is still a very questionable decision. Why not rewrite it directly to a compiled language even without GC?
I like #Rust and #Go :golang: for backends. For simple personal prohects, #Python :python: and #Flask are great. The development process is fast, I can push it out under hours. But I wouldn't use it for mission critical systems!
@Stark9837@mo8it@badrs have a look at FastAPI for python backends, it leverages Pydantic a lot, making types really useful in development and thus harder to avoid and build a broken system.
@mo8it@Stark9837 im not sure if its intentional but this is exactly what im talking about. If they switch to a "better" language everyone will just start talking about some other language thats even more efficient or streamlined.
@Stark9837 IMHO there is no right or wrong here. You can write efficient Ruby code to scale an app up to IPO in case of Shopify which is written in Rails. Or you can write shitty complied code and consume endless hardware resources.
Add comment