Users of Stratego/Spoofax often express confusion about the dynamic rules feature of the language. There is a reason for that, since dynamic rules are often used to simulate global variables and stateful programming. However, the feature was developed for more interesting use cases. The approach provides an elegant example of how to combine analysis and transformation, which is nicely demonstrated by the definition of partial evaluation, for example. A more important problem is that it is not clear how to make transformations with dynamic rules incremental, which is a requirement in interactive development environments. In considering new designs to realize incremental, interactive context-sensitive transformations, I think it is useful to be at least be aware of the original design goals and capabilities of dynamic rules in Stratego.
I’ll be giving a talk about dynamic rules in our Software Language Engineering Meeting at November 5 at TU Delft. For those who cannot attend, here are some pointers to papers
and a couple of slide decks (with quite a bit of overlap):