lf-lang / lingua-franca

Intuitive concurrent programming in any language
https://www.lf-lang.org
Other
227 stars 62 forks source link

Semantics of reactions without triggers #923

Open lhstrh opened 2 years ago

lhstrh commented 2 years ago

Currently, the validator throws a warning when it sees a reaction without triggers.

While we never really pinned down the semantics of reactions without triggers, we entertained the idea of this to mean that when any trigger within scope of the reaction was present, the reaction would execute. With the introduction of hierarchical triggers (i.e., outputs of contained reactors), this scope has become even wider. I don't believe that any of the targets implements this idea correctly. The C target currently implements it incorrectly. The Rust target doesn't implement it at all.

For simplicity, it's probably better if we bury this "feature" and verify that all targets implement the same behavior. We would simply have to:

cmnrd commented 2 years ago

The C++ generator also does not implement this feature, so no update is needed.

If somewhere down the road we have a use-case for this feature, it would probably be cleaner to introduce a special trigger any.