rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

System builder syntax rework

Open keval6b opened this issue 4 years ago • 11 comments

Existing PR: #2736 Original issue: #1978

keval6b avatar Sep 02 '21 14:09 keval6b

Rendered.

Ratysz avatar Sep 02 '21 16:09 Ratysz

Are we happy to fundamentally alter the end user experience of Bevy and basically make all existing docs out of date.

Yep! This change is only going to get more painful the longer we wait.

alice-i-cecile avatar Sep 02 '21 17:09 alice-i-cecile

IMO there's an important bit of Future work that should be included: this would provide an excellent unified foundation for "label descriptors", a much-discussed future feature that would allow users to specify schedule and run criteria information on labels, which would then be dispatched to each system with that label.

alice-i-cecile avatar Sep 02 '21 17:09 alice-i-cecile

IMO there's an important bit of Future work that should be included

By included do you mean the changes required for label descriptors be made on top of this pr before merging it?

If so, might it be easier to handle 2 smaller prs rather than one massive one?

keval6b avatar Sep 02 '21 19:09 keval6b

"Future work" refers to a subsection of the RFC where you note down stuff that could happen after this RFC is accepted and implemented.

I don't think label properties are relevant here, though. It's mostly an orthogonal feature, in both API and potential implementation.

Ratysz avatar Sep 02 '21 22:09 Ratysz

Alright, I'm happy to accept @Ratysz's judgement on that.

alice-i-cecile avatar Sep 02 '21 22:09 alice-i-cecile

I have a couple of ideas about the add_exclusive(system.exclusive_system()) API:

  1. Changing it to add_exclusive(system): Yeeting .exclusive_system() since it is assumed that the system is exculsive.
  2. Changing it to add_system(system.exclusive_system()): Removing add_exclusive method and specifying the exclusiveness through the builder-like pattern.

I'm quite ignorant to that part of the codebase so I don't know if the proposed APIs are possible or the implementation effort broaden too much the scope of the RFC/PR.

Nilirad avatar Sep 06 '21 15:09 Nilirad

Changing it to add_exclusive(system): Yeeting .exclusive_system() since it is assumed that the system is exclusive.

I'd be quite happy with this, although I'd prefer add_exclusive_system for clarity. @DJMcNab, you ran into some issues with yeeting .exclusive_system though right?

alice-i-cecile avatar Sep 06 '21 18:09 alice-i-cecile

@DJMcNab, you ran into some issues with yeeting .exclusive_system though right?

That was a while ago, I've fixed that. This breaks it again; haven't had the time to try and fix it yet.

Ratysz avatar Sep 06 '21 18:09 Ratysz

I didn't even try to get rid of .exclusive_system - to be honest, my PR was mostly just about recognising the for<'a> &'a mut F: FnMut(...) was the way to remove needing .system

DJMcNab avatar Sep 06 '21 18:09 DJMcNab

So how's this going. Has cart's prerequisite stuff been merged?

keval6b avatar Oct 08 '21 17:10 keval6b

Fixed by #45.

alice-i-cecile avatar Feb 06 '23 01:02 alice-i-cecile