4 ms·
> it always baffles me that most people seem to be using Rust to write ... web services? I think it's the whole x-rewritten-in-rust-now-faster hype train. Alth
by fhd2 5y ago
> it always baffles me that most people seem to be using Rust to write ... web services?
I think it's the whole x-rewritten-in-rust-now-faster hype train. Although those limitations you mention, what's easy and hard to do, do have a more or less automatic impact on performance, fueling that train.
I think of it like this:
Programmer level 1: Makes something work in a higher level language
Programmer level 2: Makes something work in a lower level language
Programmer level 3: Makes something fast in a lower level language (in most cases just a few simple optimisations on top of #2)
Programmer level 4: Makes something fast in a higher level language (object pooling, understanding how the GC and VM works to avoid GC pauses at the wrong time and all that)
So with Rust (or yes, C++, though it's a bit more of a foot gun IMHO), level 2/3 people can write code that's efficient. What I think is somewhat unique about Rust is that it keeps programmers from making lots of common mistakes working with lower level languages - like it's designed for level 1/2 folks.
- natded 5y agoWriting web-services in Rust is easy and I don't understand the OP's confusion about it. Web-services are highly concurrent and benefit from async, both of which are areas where Rust excels at - and Rust looks like JavaScript most of the time when writing these so it is pretty clear what to do here if you need scale and performance. Then there's the plethora of other advantages you get from its great type system and inference etc.
- flooow 5y agoI agree completely, it's a very strange objection - Rust is one of the very best languages for web servers. I wish I could use it at work instead of Django. I think some C/C++ devs take a perverse pride in their language not being suitable to write web servers, because webdev is not real programming anyway (excepting the 'systemsy' parts like nginx). Well, Rust is great at systems, great at web servers, pretty good at one-off script, even pretty usable for frontend. Every time I hear someone pigeonhole it as just a systems language, I think - you're missing out.
- moth-fuzz 5y agoIt definitely wasn’t meant as a criticism - I think Rust is uniquely suited to writing web applications as well. I just find it funny that writing web apps is easy enough in Rust that it almost minimizes its opinionatedness, since you don’t really need to worry about difficult lifetimes or ownership when it’s JSON in, JSON out, and the database is just an externality, and you don’t have hard performance requirements despite Rust being made for performance. It seems like an impedance mismatch but it works out.