Most coveted Rust features

I'm wondering what are the most coveted Rust features, that aren't currently in Rust?

Things like Higher Kinded Types, default parameters, etc. You can use the hear near post to give your +1 to an idea.

4 Likes

From the top of my head (my wishlist):

  • HKT: no RFC
  • Default type params: RFC accepted, AFAIK need someone to implement it
  • Implied bounds: Planned, I think Niko is working on it
  • Negative bounds: RFC in discussion
  • Send doesn't need 'static: RFC accepted, already being worked on
  • Nonzeroing dynamic drop: RFC accepted, being worked on
  • Abstract return types: RFC closed for further revision
  • Abstract associated types: no RFC, same idea as abstract return types though
3 Likes

I kinda wanted one wish per post :stuck_out_tongue: so it's easier to see which is most
coveted.

I'm gonna go with Higher Kinded Types (HKT). The list of problems they
solve is staggering, but as I understand they are too complex and they
interact badly with inheritance. It's possible I'm wrong on this account.

4 Likes

Inheritance/code reuse.

4 Likes

My most coveted Rust feature is having the most comprehensive cross-compilation story in the world.

Other than that I want Rust to slow down and bake the features it already has.

25 Likes
  • non-lexical borrows (SEME regions)
  • type constructors (HKT)
  • trusted iterator lengths
  • generics over integers
  • allocator API
  • inherent trait impls
  • ways to disable unwinding at a scope or application level
  • unsafe operators?
8 Likes

I'm not sure what is missing here. We have trait inheritance, I don't see struct inheritance as interesting.

What kinds of code reuse are missing?

3 Likes

Lazy evaluation/assignment (like in Haskell).

I want to look at an assert!(n < 0) and not read it as assert(!n < 0) or assert(!(n < 0)). Friggin annoying.

Highlighting helps a lot here.

In my editor the assert! is highlighted in red, so there's no question as to what the ! part belongs to.

3 Likes

I don't see how that fits into the predictability of Rust code.

1 Like

I think that he would like one of the following "efficient inheritance RFCs" to be accepted :

1 Like

Further improvements to rustfmt and rustfix.

4 Likes

Keyword arguments and default argument values.

7 Likes

I think anything that has more types able to implement PartialEq and Debug either automatically or at all would be great. I think there is an RFC for auto derivation so that is a start. I use these traits for testing and its annoying when I randomly end up with something that can't be compared or output by assert_eq.

That and fixing some of the ICEs around compiler weirdnesses around traits would be great :smile:

3 Likes

Mine (vim) does that too, but 16 years or so of being trained that '!' is very, very special can't be changed by some color. I think @assert(), $assert(), or macro.assert() would be less frustrating. When asserts trip, the 'impossible' has happened so you don't need any extra cognitive load when chasing them down. Also in python2 assert is a keyword so assert!(x) means something very, very different.

Parameterized modules a'la OCaml's.

3 Likes

Could you elaborate what are parameterized modules? Are they related to HKT?

I think he means:

mod something<T> {
  fn do_something(value: T) { /* ... */ }
}

Although I don't see why it's really that useful...

For me, it would probably be integer-based generics. This would fix various annoyances, such as the arbitrary limits on the length of arrays for which standard traits are implemented.

1 Like