lf-lang / playground-lingua-franca

:rocket: Try Lingua Franca now!
Other
16 stars 13 forks source link

Preamble moved inside of reactor to avoid multiple definitions #81

Closed lhstrh closed 1 year ago

lhstrh commented 1 year ago

FurutaPendulum.lf surprisingly wasn't compiling. We need to check our CI and find out why this wasn't flagged as such.

The problem is that even though building failed,lfc exited with 0, which is why the error isn't being picked up by action-check-lf-files. This was because the build script was masking the failure. This script has been patched in this PR.

lhstrh commented 1 year ago

It will break other things. But I agree, we can wait with this PR.

cmnrd commented 1 year ago

I am a bit confused by the title of this PR. The preamble is not private (as in using the private keyword), but nested within the reactor scope. This wording confuses me, because there is a clear meaning for private and public preamble in the C++ target. Are we overloading this terminology with a different meaning in the C target?

lhstrh commented 1 year ago

Things declared in a preamble of a reactor (as opposed to a file) do not leak into the scope of files that import them, hence the use of the term "private." Should I be calling it something else?

cmnrd commented 1 year ago

I am not sure. It seems that with recent changes in the C target the mechanisms for how preambles work in C and C++ have diverged significantly and now the terminology is ambiguous.