News for hackers. Stuff that matters.
Re:Never patterns, exhaustive matching, and uninhabited type... by dom96 on Saturday August 18, 2018 @11:29AM (#17788913)
I actually often wonder why so many web developers are drawn to Rust. Satisfying a borrow checker just doesn't seem like a worthwhile task when writing web apps. Are there things about Go that you feel are bad enough to warrant a switch to Rust?
Re:Never patterns, exhaustive matching, and uninhabited type... by smolder on Saturday August 18, 2018 @11:49AM (#17789008)
For me, I have a fairly complex application sitting behind a http api. Rust allows me to keep the system requirements for an instance of the app low for better economy. (Memory use especially)

I actually like the ergonomics of it a lot and have learned to satisfy the borrow checker. I would use it over Java for almost anything.

The biggest downside to me is the long iteration times when making a change, compiling, and testing repeatedly.

Re:Never patterns, exhaustive matching, and uninhabited type... by mpartel on Saturday August 18, 2018 @11:55AM (#17789037)
Performance is not the only benefit. You also get freedom from data races, and (arguably) the borrow checker imposes structure that makes the program easier to read and reason about, because it's clearer who "owns" (and can mutate) what, and what is shared.

I've missed this property when writing Java and JS even before Rust was a thing, and Go has felt the same.

Re:Never patterns, exhaustive matching, and uninhabited type... by Thiez on Sunday August 19, 2018 @03:51AM (#17793113)
Exactly, the clear ownership in Rust allows you to skip the defensive copying that so often happens in Java. Of course you get this property in most languages that do not use garbage collection, but I few restrict mutable aliasing.
Re:Never patterns, exhaustive matching, and uninhabited type... by leshow on Saturday August 18, 2018 @12:45PM (#17789296)
The type system is one of the main draws for me.