have you ever considered adding a new type of node (some kind of "SubSchedule") that would allow bunching some statements together, ie. something deeper/smaller than a Schedule instance? eg. multiple loops from splitting one, or in reverse-mode AD lots of statements actually belong together.
what I mean is something that would in effect "split" a Schedule by adding a optional and transparent "block of statements" node in the AST so that not everything ends in one single Schedule().children list.
it's not by far essential nor does it maybe make sense from a compiler point of view (?) but it could sometimes be useful in some transformations in my opinion.
Obviously, we need to carefully consider what will break if we implement this and any additional checks/validation that will be required in Transformations.
Julien asks:
Obviously, we need to carefully consider what will break if we implement this and any additional checks/validation that will be required in Transformations.