wg icon indicating copy to clipboard operation
wg copied to clipboard

Tracking: Rust All-Hands 2020

Open Wodann opened this issue 5 years ago • 8 comments

Leading up to the Rust All-Hands 2020, I'd like to compile a document of proposals that we as the gamedev wg would like to raise - whether we are able to attend in person or not.

This issue is intended to outline what topics are currently under discussion, links to relevant information, and who are working on the topics.

  • [ ] Integration of the alloc-wg into nightly. (@TimDiekmann @Wodann)
    • [ ] Evaluate APIs [#71]
    • [ ] Allow std::Box<T> and alloc_wg::Box<T, A: AllocRef> to coexist
  • [ ] Placement new [#48] (@aclysma)
  • [ ] Branch prediction hints [#49] (@aclysma)
  • [ ] Fast floats [embark#2] (@repi)
  • [ ] ...

Wodann avatar Jan 17 '20 10:01 Wodann

What do you mean by coexisting both Box types from std and (probably) alloc_wg (you wrote alloc)? A few days ago we had a small discussion at zulip about implementing From traits for the alloc_wg types for convenient and typesafe conversation.

TimDiekmann avatar Jan 17 '20 12:01 TimDiekmann

If I understood correctly, the reason that we cannot easily try the alloc-wg's traits in nightly, is because a generic parameter such as A: Alloc cannot only be added on nightly. It will also have to be added on stable.

@Lokathor proposed making a clone of the standard library in which we use the alloc traits where possible (e.g. Box, Vec). On nightly you'd then be able to also use the "cloned" standard library (e.g. using a syntax like temp_alloc::Box::new(...). In that sense the non-alloc and alloc versions of the std would coexist.

edit: changed syntax in the original comment to temp_alloc to avoid confusion with rust's alloc library.

Wodann avatar Jan 17 '20 18:01 Wodann

There is an open PR https://github.com/rust-lang/rust/pull/65083 which allows unstable annotations to generics. This is basically the one thing blocking the alloc WG to push upstream.

TimDiekmann avatar Jan 17 '20 18:01 TimDiekmann

Yeah, that's been open for 4 months though :P

Lokathor avatar Jan 17 '20 18:01 Lokathor

note though that std::Box is an alias for alloc::boxed::Box

we'd need to make alloc2 or some other temporary crate

Lokathor avatar Jan 17 '20 18:01 Lokathor

+1 that sounds like a great idea! I'd also like to see these discussed:

  • #48 - Placement New
  • #49 - Branch Prediction Hints
  • https://github.com/EmbarkStudios/rust-ecosystem/issues/2 - Fast floats

However custom allocator support is more important in my opinion, and we don't really have a specific proposal for these three, although we could work towards that in the next month or two. (Fast floats I think we'd get quite far with a global switch that allows specifying using fast float by default instead of safe floats. It's not a perfect solution, but it is a proven solution since C++ does it that way.)

We could also seek opinions from industry professionals who don't usually engage in this wg to make sure they have a voice.

Maybe a good thing to bring up at our next Wednesday meeting.

aclysma avatar Jan 19 '20 15:01 aclysma

Those are good topics to discuss next Wednesday. I've added them to the list.

It's a good idea to ask for their opinions too. I'll reach out to the industry devs that I connected with previously.

Wodann avatar Jan 19 '20 22:01 Wodann

The Rust All-Hands was cancelled, but I'd still like to push forward in this direction. Maybe we can combine this work with the results of the Rust Gamedev Survey and create a Roadmap for 2020?

Wodann avatar Jan 30 '20 16:01 Wodann