After ruminating on this a bit, I definitely see your point.
The solution proposed in this PR seems nice, but isn’t generally applicable due to the Send + Sync
constraint. It’s nice in the sense that it allows the System to remain technically stateless, although being technically stateless comes at the expense of making System-specific data available to other systems, the consequence of which is that some other system could in theory read another system’s events (or modify any other system-specific data shared as a resource).
So, I don’t think the goal should be to make things technically stateless, which in effect really just encourages making system-specific data shared, while still not solving for state that isn’t Send + Sync
.
I think a good start would be to find a nice way to distinguish things that are technically state from things that are stateful in the sense that they break the abstraction, if only for communicating the distinction and discouraging the latter.