🦀 Is rust overkill for apps that could be done quickly by NodeJS and PHP?

"not because of speed,but because of reliability.When we wrote those services in Rust,we effectively wrote them once.Our team is now moving on to new work,while other teams are still fixing...

The question was asked here
https://www.reddit.com/r/rust/comments/11uwwhy/is_rust_overkill_for_most_backend_apps_that_could/jcqom6r

#rustlang #rust #programming #python #php #golang #nodejs

Is rust overkill for most back-end apps that could be done quickly by NodeJS or PHP?

Posted in r/rust by u/HosMercury • 260 points and 158 comments

reddit
@AstraKernel this is kind of a false choice between the extremes of Rust and Python/Ruby/NodeJS/PHP. There are other languages which exist in the middle-ground between the extremes of Rust vs. dynamic scripting languages. Crystal or Nim are compiled and have the native performance of Rust, but use GC instead of Rust's Borrow Checker, and Crystal is even Strong Typed which prevents null-pointer type errors.
https://crystal-lang.org/
https://nim-lang.org/
Crystal

Crystal is a general-purpose, object-oriented programming language. With syntax inspired by Ruby, it’s a compiled language with static type-checking. Types are resolved by an advanced type inference algorithm.

The Crystal Programming Language
@AstraKernel and then came the greybeard with a single line of Perl...
@skyglobe @AstraKernel Ask people like @cstross about how effective those single lines of perl can and can’t be :-)

@AstraKernel personally I'd say: yes, rust is overkill there.

It depends the application of course but for web, there are better languages (although I do not consider PHP or JavaScript good languages)

Python, Go, potentially Nim, Ruby, or even Java are better. (yeah, I know I'm also no big fan of Java  )

Rust = low level / C / C++ replacement

@13reak
Rust is not overkill. People assume Rust is low level. I have multiple times mentioned in my earlier posts that it is not low level language. It is general purpose language. In this case, it could be perfectly a valid choice.

In my opinion, if you don't want Rust for some reason, the better alternatives(for backend dev) are Python or PHP (it is not bad as people assume it to be).

I definitely wouldn't recommend Java or ruby.

Then if you are going with Go, it is better to choose Rust. Because they are not far apart.

@AstraKernel
I agree with you that Rust is general purpose, as is C++. However, every language has strengths and weaknesses.

As I said before "it depends the application". Other languages are stronger at web than Rust.

@13reak
What i mean that it is something like python. Not just for system programming. Whether we like it or not, it will eventually take over go usage also people already using it for frontend with web assembly. There are multiple good when frameworks for Rust that makes api and Microservice development better in Rust. Also for the serverless , rust is know to be the best.

However it will be overkill for something like blogging sites.

@13reak @AstraKernel Given the context of what they are talking about regarding the scaling of the services and the number of nodes they add to meet demand I don’t think that it is overkill. I suspect they were vague about the details of the CRUD service(s) they are building but it sounds as if it gets a lot of traffic and frequent spikes

@AstraKernel We often forget the origins of the languages that we use and think that because we can build a service in Node or Python that it is a good idea.

I build services in Node but they don’t get anything like the traffic that they describe in that post. I wouldn’t want to have to deploy anything I wrote in Node for large amounts of traffic. Especially given the dependency chain in Node.

@AstraKernel I have multiple programs written in rust that run 24/7. I want to focus on one right now, since the others still get new features every now and then. This thing is stable. I think the last time it crashed was May 2022, and that was because of a very rare edge case. It has had only two commits since then, neither of which affected the code, just some information in a JSON file, which only happened because one person moved, and another person switched cell service providers.