top | item 38691355

(no title)

imnotreallynew | 2 years ago

There’s a lot of praise for Rust in these comments.

I always understood Rust to be for low level “close to the metal” sort of software. Is it at a point where it’s suitable for writing web applications?

I know it’s “possible” with frameworks like Rocket, but I’d like to know if Rust is at a point where it can compete in the web app space with Rails, Go, Node/Express, etc.

discuss

order

drdaeman|2 years ago

It sure can, but you can't be as sloppy as you can be with Ruby, Python or JavaScript or Go.

It's a high-level language, it just has its own rules that encourage correctness and prohibit sloppiness (which is a de-facto standard in the webdev industry, especially when prototyping rapidly by throwing shit at the wall and then letting whatever stuck live in production until it's no longer manageable).

For better or worse, Rust simply doesn't forgive a lot of things that are easy to do elsewhere, like not caring about less probable scenarios.

And, again, for better or worse, you also have to satisfy the borrow checker, where in other languages there's simply no such thing. Which is sometimes easy as calling clone() (not always a good idea), but sometimes can be quite a headache thinking about value lifetimes and how you just can't have something somewhere else (which can be super subtle so you wouldn't normally think about it in other languages with GC).