top | item 19009726

(no title)

inherentFloyd | 7 years ago

I have never done anything in Rust. Are there any benefits? Any drawbacks?

discuss

order

gnuvince|7 years ago

If you don't mind a bit of a re-education, Rust allows you to write programs that are as fast as those written in C or C++ and you'll be more confident that they don't have strange memory bugs. (Reason: the ownership model of Rust prevents a lot of bugs that are found in C or C++, but this model also rejects many correct programs, so you need to re-learn how to write some programs.)

wwright|7 years ago

One thing people (like me ) often say is that it forces you to “learn to write better.”

One way you can think of it is this:

- Rust rejects some programs that are truly wrong (`“2” + 3` style)

- Rust rejects some programs that really are just fine. They are actively improving this with stuff like “Non-lexical lifetimes.”

- Rust rejects some programs that are fine _how they are now_, but which are hard to keep fine when you change them. This is part of why linked lists are hard to write in Rust :-)

bytematic|7 years ago

It is a great language. You will fight with the compiler, it will do its best to tell you whats wrong, and finally when it fully compiles with no errors, you pretty much never have to worry about the program in runtime.

jeffdavis|7 years ago

One cool thing is that you can use it almost anywhere -- an OS kernel all the way up to a game compiled to WebAssembly to run in the browser.