Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

It feels like Rust is now 'stable'. Are there any major language related things in the pipeline?


The biggest one in the near future is async/await; you’ll see the precursors land in the next few releases. There will also be a blog post soon outplaying overall plans for the year, but const generics, GATs, and specialization are the likely big-ticket items.

In general, this year of Rust will be about governance refactoring, finishing off long-desired features like the ones above, and general polish. There isn’t a lot of big plans for big new things coming anytime soon, more of finishing what we’ve started and improving what we have.


> GATs

Oh, fantastic! I realize I'm probably in a very specific minority here, but I've been waiting on this one for literally years.


For people confused like me: GAT in this case means "Generic Associated Types"

https://rust-lang.github.io/rfcs/1598-generic_associated_typ...


This RFC has an explanation of Higher-Kinded Types that enabled me to understand what is meant by HKTs for the first time. Unexpected & awesome! Thanks for linking!


Huh... Safari on iOS crashes on that page


Interesting, it doesn’t crash for me!


I have ran into a couple places I needed GATs while writing abstractions, without realizing beforehand it'd lead to needing GATs. This is especially true with lifetimes, which I'm not used to thinking about as part of an abstraction.. I think it will naturally open up doors for everyone without anyone necessarily realizing it apriori.


To help people follow along, GAT stands for Generic Associated Types.


I think another big item is const fn and compile time function evaluation.


That’s under “const generics”, but yes. Technically const fn is already stable, it’s just expanding what it can do, generally, so we tend to talk about them as one thing.


I think it's not a good idea to talk about them as one thing and the use cases also differ. `const fn`s are deterministic ("pure") functions that can be evaluated at compile time if all arguments provided also can. `const A: B` generics are about compile-time value dependent typing. The former is important for the expressiveness of the latter but they are ultimately independent. Moreover, the implementation effort is also mostly independent (different people are doing the effort). Even having them in the same WG might not be a good idea.


In my mind const generics and const fn is a completely different feature. Proof: you can use const fn without any const generics.


Sure. They rely on the same internals, which is why they tend to be wrapped together when talking about them as a feature, that’s all I’m saying.

That also doesn’t change that const fn is stable today, so saying “it’s coming this year” muddies the waters a bit. You have to explicitly say “the capabilities of const fn will be expanded”, or you risk the wrong impression.


You mean expanding and improving const fn? Because the basis of const fn are already in stable since 1.31 and improved in 133.


Steve Klabnik's comment has already mentioned async-await, "const" generics (much like template parameters in C++, expected to be especially useful for numerics-like code), generic associated types/GAT (related to higher-kinded types as found in e.g. Haskell) and specialization (allowing narrower, more specific trait implementations to override broader ones; a not-so-ad-hoc, more elegant approach to the overall, broad issue of implementation inheritance).

On a different level, a lot of work has been planned to address compiler performance, improve IDE integration, and provide better support of special workflows e.g. for embedded development, or for WASM and the like. Work is also still ongoing on writing high-quality reference documentation for the language, and moreover for a better understanding of how exactly unsafe code should be expected to work, which in turn will enable a more formal approach to the Rust language as a whole.


Async/await is probably the next "big" feature.


We are really waiting for it in Prisma and might need to start working with the unstable soon until it lands.


Is Prisma releasing a client library for Rust?


We'll build the server first with Rust. Hopefully me or somebody else has time to do the library later. Would be fun, but right now all focus is on the server rewrite.


^ this.


There have been steady improvements for the FFI and macro system and I hope that continues. Both of those are important for C integration.


My main interest is Polonius borrow checker and two-phase borrowing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: