A grand vision for Rust
63 points by lffg
63 points by lffg
Oh man, this blog post is great and I sincerely hope they succeed in bringing these enhancements to Rust's type system. Yes, Rust is already a lot, but on the occasion that I have use for the things covered here, they're incredibly helpful. Having worked on embedded systems with MTBF of 10 years, writing panic-free Rust is not particularly easy (mostly because of all the places you forget can panic, like addition). The refinement types would be really helpful for building complex datastructures on top of plain arrays.
Oh wow, very good timing, I've been working on a very similar post for the upcoming blog carnival (albeit with dependent instead of refinement types).
On substructural types: don't forget uniqueness types! Unique references in a concurrent setting give you the particularly nice guarantee that you can treat data in a single-threaded manner, without fear of data races (see the paper Data Race Freedom à la Mode from the OxCaml team).
How are uniqueness types different from what's already provided by ownership and the borrow checker? Genuinely asking
What's the status of the work on pattern types? The post mentions they are "experimenting" with them. Are they on track for stabilization?
You could do these in ATS2 for a decade :)
Quippy responses like these are perhaps better suited to Reddit/HN than to Lobste.rs? It would've been a different thing had you written "For folks interested in playing with these kinds of features, highly recommend checking out ATS2 <elaboration>"
If any of the stated features were added to Rust, there's an implicit expectation that the overall usability of the language (e.g. the famed error messages) should not degrade as much as possible. No such expectation exists for research languages like ATS2.
You are right… much better framing. Yes, you can test out there these features yesterday in a language that compiles to C—so equally as “low-level”. I know I learn a lot getting something to compile with these sort of type-level features.
was going to say, ATS lets you do all this, but with really bad ergonomics. would be awesome to see these things on a language like rust or ocaml, which have had a lot more work put into developer experience.