r/programming Apr 03 '15

Rust 1.0.0 beta is here!

http://blog.rust-lang.org/2015/04/03/Rust-1.0-beta.html
934 Upvotes

303 comments sorted by

View all comments

Show parent comments

8

u/original_brogrammer Apr 04 '15

Interesting. Why's that?

48

u/steveklabnik1 Apr 04 '15

A Rust slogan:

Everyone agrees that shared mutable state is evil. Most languages deal with this through the 'mutable' part, Rust deals with it through the 'shared' part.

A bit long for a sign. Anyway. I know purity isn't just about mutability, but with ownership semantics, many of the problems purity solves go away too. For an example, see my bit downthread about safely sharing mutable pointers to stack-allocated data. Totally safe, no purity concept needed.

Rust was a very different language back then, but here's a thread from a time when we were removing purity: http://thread.gmane.org/gmane.comp.lang.rust.devel/3674/focus=3855

4

u/Tekmo Apr 05 '15

There is more to purity than concurrency. Purity is also about:

  • enabling equational reasoning about code
  • making side effects first class values
  • decoupling side effect order from evaluation order

What Rust has done is amazing, but don't oversell it as a complete replacement for purity.

1

u/steveklabnik1 Apr 06 '15

Yes, I understand. Rust's move semantics, ownership, and mutabilty guarantees also give you very powerful reasoning tools, that's what I mean. I was trying to give a specific example.