-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better system chaining / piping #11571
Comments
If this is acceptable, I would like to work on the implementation. |
Not a fan of using operator overloading like this. This doesn't behave how I would think a right shift operator should work. |
Chaining and piping fundamentally don't work the same way. Piping is a "merging" of systems: they become one single unit, and are evaluated as a single system. Chaining is a set of .before / .after ordering; the systems retain their identity, their accesses stay disjoint and other systems can run in between them For more context, consider checking out bevyengine/rfcs#46 (atomic sets, as an extension of that "join systems together" idea) and #8715, for the latest in several attempts to extend system piping to more complex arrangements. |
I'm not sure I completely understand. But would it help if the suggestion was optional, and everyone could choose whether to use 'chain' and 'pipe', or '>>'? After playing around with it I found it quite intuitive and easier on the eyes. |
I'm aware that chaining and piping is different internally. But in my opinion, the difference in implementation should not necessarily reflect a different API for each. Under the hood '>>' will 'chain' systems with no output/ input, and it will 'pipe' systems with. What do you think about adding this as an option, and not as a replacement? |
Syntax wise I'm not sure the |
That's true. I didn't realize that. |
What problem does this solve or what need does it fill?
There are many different methods to control the execution flow of a system set. I think many of them could be unified into an easy and intuitive API. For example, "piping" and "chaining" systems is essentially the same thing: you could look at "chaining" as piping
()
. Ideally, these two concepts should be merged into a nice and consistent API.What solution would you like?
I think we can achieve a really nice looking API by utilizing the
Shr
(orShl
) traits.For example:
Simple chaining
Simple piping
Complex chaining + piping
What alternative(s) have you considered?
Keep the API as is
Additional context
The text was updated successfully, but these errors were encountered: