-
-
Notifications
You must be signed in to change notification settings - Fork 649
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
### Problem The "complex" `Selector` types used to select `@rule` inputs for subjects other than the current subject of an `@rule` have proven to be entirely too complicated. Additionally, their lack of flexibility meant that we needed to introduce many intermediate types to provide links between `@rules` in cases where imperative logic was needed for filtering or conditionals. The only remaining motivating factor for these complex selectors was that they allow for closed-world compilation of the `@rule` graph, which avoids the need for error checking in rule bodies and provides for easier composition of sets of `@rules`. ### Solution After experimenting with using coroutines (ie: functions containing `yield` statements that receive a result on their left hand side), it became clear both that: 1. Coroutines were universally easier to understand than the Selector DSL 2. The dependency requests made by coroutines could still easily be statically checked via a small amount of runtime introspection. And so, this change removes all usage of `SelectProjection` and most usage of `SelectDependencies` in favor of `@rule` coroutines. It does not yet remove the implementation of those `Selectors` (although doing so will shed a massive amount of complexity from the codebase). ### Result `@rules` are still statically checked, but are now much easier to write. Performance is unaffected.
- Loading branch information
Stu Hood
authored
Apr 6, 2018
1 parent
766bffa
commit 99c2a50
Showing
21 changed files
with
787 additions
and
423 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.