Reify tasks in DML #286
Labels
3 medium
Issue of medium importance
in: DML
issues related to the macro language
is: feature
Issue proposes a new feature
Currently, DML has syntax for performing actions sequentially:
and in parallel:
The parallel block ends when all of its statements have finished unless one of them propagates an
EvaluationError
, in which case that's immediately propagated. (Other unfinished statements continue to execute.)With the addition of
future
values (#283) and better support for paths (#282), you can now say something likeThis creates
d2
but waits for it to get a value before moving. The problem is that because thefuture drop
initialization includes the notion of waiting within it, I suspect that it will seem reasonable to do this inside of a sequential block, but the initialization statement ford2
doesn't end until the injection is done.Without injections in the initialization, it would have to be written as
which more clearly needs to be done in parallel, but I sort of like the ability to not have to pre-declare.
What I'm thinking of here is the ability to have a basic
T task
notion to sayDo this in the background and give me the ability to wait for it
. This would allow background tasks to be spawned in sequential blocks, and would make it easier to decide that some don't need to be waited for. The syntax I'm thinking of is something like(Normally, I would use
wait for
, but I already use this in the sense ofpause
.) Tasks would be first class objects, typed to the value of their expressions, but they wouldn't be assignable. You would be able to ask for the task's value (if it was finished) and whether or not it was finished. I would probably also want a notion oftask group
for when we don't want to have to individually name tasks or when they might be created in a loop, asI don't think you can do that with the current syntax.
One other thing we might want to do is have a task be specified to be
delayed
, meaning it doesn't actually start until you sayt : start
orgroup : start
. (An alternative would be to have each one explicitly wait on a barrier (#284).)Migrated from internal repository. Originally created by @EvanKirshenbaum on Jul 06, 2023 at 2:01 PM PDT.
The text was updated successfully, but these errors were encountered: