Live data from Hacker News

Rust 0.5 released

mail.mozilla.org

41–50 of 54 posts

Re: Rust 0.5 released

#41
post #40

I'd hoped that rust would have a lot of powerful tools for typing and exposing invariants and contracts— tools to help create provably reliable software. As sexy as new programming tools are, the big problem in software today is that we simply can't manage the complexity of it and as a result _everything_ is full of bugs and unintended behavior. Addon layers like ACSL are hard to use and messy because they work at od…

I assume you're referring to typestate. One of the reasons that typestate was removed is that practically everything you can do with typestate can be done with session types instead. Constraints can be modeled as unique types with a trusted transition function from state to state. The unique type system used for memory management in Rust nicely doubles as a session type system. This is actually done today with the pipes compiler—it uses unique types to statically ensure that you can't violate a communications protocol, just as typestate can.

One of our focuses for 1.0 is on aggressively pruning features that overlap, to reduce language complexity and to avoid committing ourselves to language features we might not need. However, future versions of the language might add more static analyses as they prove useful.

Re: Rust 0.5 released

#42
post #6

Really glad to see the REPL!

I wonder whether anyone here knows how it is meant to work. All my inputs fail with the following message: > rust: task failed at 'no mode for lval', /home/tyl/files/cloud/rust/rust-0.5/src/librustc/middle/liveness.rs:1573

Just fixed this. I'll see if we can push out a Rust 0.5.1.

Re: Rust 0.5 released

#43
post #40

I'd hoped that rust would have a lot of powerful tools for typing and exposing invariants and contracts— tools to help create provably reliable software. As sexy as new programming tools are, the big problem in software today is that we simply can't manage the complexity of it and as a result _everything_ is full of bugs and unintended behavior. Addon layers like ACSL are hard to use and messy because they work at od…

I assume you're referring to typestate. One of the reasons that typestate was removed is that practically everything you can do with typestate can be done with session types instead. Constraints can be modeled as unique types with a trusted transition function from state to state. The unique type system used for memory management in Rust nicely doubles as a session type system. This is actually done today with the pi…

Do you have any code examples of where this is used that I can look at?

Like nullc my interest is in the area of types being used to enforce contracts and safetly (hence my interest in the ATS language).

Typesafe was my initial interest in Rust and I'd love to see examples of how this is being approached in Rust as it is now.

Re: Rust 0.5 released

#44
post #43

Earlier quoted context omitted.

I assume you're referring to typestate. One of the reasons that typestate was removed is that practically everything you can do with typestate can be done with session types instead. Constraints can be modeled as unique types with a trusted transition function from state to state. The unique type system used for memory management in Rust nicely doubles as a session type system. This is actually done today with the pi…

Do you have any code examples of where this is used that I can look at? Like nullc my interest is in the area of types being used to enforce contracts and safetly (hence my interest in the ATS language). Typesafe was my initial interest in Rust and I'd love to see examples of how this is being approached in Rust as it is now.

Probably the best place to look at the moment is this presentation: https://air.mozilla.org/intern-presentation-message-passing-...

Re: Rust 0.5 released

#45
post #27

Earlier quoted context omitted.

It seems to me that any answer that stated specifically what those different niches and wildly different goals actually were would be a more productive exercise. If there's room for more than one of them in this town, in which part of town would each reside?

[Disclaimer: I've written only a tiny amount of Rust code, and no real Go code. I work for Mozilla but not on the Rust team.] From what I've seen Go is designed with emphasis on ease of programming, performance, and concurrency; Rust is designed with emphasis on safety, performance, and concurrency. (Of course these are broad generalizations, and neither language is limited to only these concerns.) Go is a simpler la…

Thanks.

Re: Rust 0.5 released

#46
What is the intended audience for this language?

"[Rust] supports a mixture of imperative procedural, concurrent actor, object-oriented and pure functional styles. Rust also supports generic programming and metaprogramming, in both static and dynamic styles."

IMO, Rust tries too much (norrowed pointers, managed boxes, owned closures, ...). I am convinced that the language(s) of the future will be simple and safe.

Re: Rust 0.5 released

#47
post #38
post #36

Earlier quoted context omitted.

How is D or OCaml more Rust-like than Go? Can you explain?

Rust is basically ML + C's lovechild. Sophisticated type inference, mostly pure variables, pattern matching lambda functions, a few other FP goodies. But it's also a fairly clean imperative language if you care to use it like that. Generics, mutable variables, {}; syntax, pointers, etc. Also, more fundamentally, I see D, OCaml, and Rust as occupying a "let's be clean" kind of space. I see Go as occupying a "let's be…

I'll have to check Rust then, seems interesting. Although I see Go as a clean language: A "better" C and D as a "cleaner C++".

Re: Rust 0.5 released

#48

What is the intended audience for this language? "[Rust] supports a mixture of imperative procedural, concurrent actor, object-oriented and pure functional styles. Rust also supports generic programming and metaprogramming, in both static and dynamic styles." IMO, Rust tries too much (norrowed pointers, managed boxes, owned closures, ...). I am convinced that the language(s) of the future will be simple and safe.

If I understand correctly, they are aiming at things that usualy get built with C++ nowadays. Its hard to get a sinple and elegant language here because a big part of the appeal is having very tight control over memory layout, execution order, etc.

Re: Rust 0.5 released

#49
post #43

Earlier quoted context omitted.

Do you have any code examples of where this is used that I can look at? Like nullc my interest is in the area of types being used to enforce contracts and safetly (hence my interest in the ATS language). Typesafe was my initial interest in Rust and I'd love to see examples of how this is being approached in Rust as it is now.

Probably the best place to look at the moment is this presentation: https://air.mozilla.org/intern-presentation-message-passing-...

Perhaps I missed where it was explained— but I don't see how rust enforces the type predicates (e.g. acquire vs wait state) there without typestate.

Re: Rust 0.5 released

#50
post #49

Earlier quoted context omitted.

Probably the best place to look at the moment is this presentation: https://air.mozilla.org/intern-presentation-message-passing-...

Perhaps I missed where it was explained— but I don't see how rust enforces the type predicates (e.g. acquire vs wait state) there without typestate.

Say I have a protocol that transitions from A -> B -> C. Since the pipes compiler creates the only constructor for type B, there's no way for you to construct a value of type B (in the safe language) without giving up your one value of type A. The uniqueness typing system prevents you from copying your single value of A, and you must surrender all your references to it at the time you transition to state B.
Post reply on HN