To enable us to do better statical analysis of the code base further down the road, I think we should make the core statements more fine-grained. As much as possible should be explicit.
I have a few suggestions right now:
I suggest we remove NewRef and instead compile that into a sequence of a new statement CreateRef, followed by the existing statement SetRef.
We should remove the implicit yield from Fork & Wait by adding a Yield :: SSMStm statement.
We should split Wait :: [Reference] -> SSMStm into the two statements Sensitize :: Reference -> SSMStm & Desensitize :: Reference -> SSMStm.
If we apply the last two changes we can e.g write an optimization pass which translates
While c
Code1
Sensitize a
Yield
Desensitize a
Code2
into
Sensitize a
While c
Code1
Yield
Code2
Desensitize a
This should be a separate issue, but just for some motivation. This issue only concerns making the core syntax more fine-grained.
To enable us to do better statical analysis of the code base further down the road, I think we should make the core statements more fine-grained. As much as possible should be explicit.
NewRef
and instead compile that into a sequence of a new statementCreateRef
, followed by the existing statementSetRef
.Fork
&Wait
by adding aYield :: SSMStm
statement.Wait :: [Reference] -> SSMStm
into the two statementsSensitize :: Reference -> SSMStm
&Desensitize :: Reference -> SSMStm
.If we apply the last two changes we can e.g write an optimization pass which translates
into
This should be a separate issue, but just for some motivation. This issue only concerns making the core syntax more fine-grained.