svenkeidel/sturdy

The implementation of While loops can be shared code.

Closed this issue · 0 comments

Currently the implementation of while loops is implemented as operation, rather than shared code:
https://github.com/MDBijman/sturdy/blob/lambdajs/lambdajs/src/SharedConcrete.hs#L357-L361

However, you can implement while loops in the shared interpreter by desugaring them to conditionals:
https://github.com/svenkeidel/sturdy/blob/master/while/src/SharedSemantics.hs#L87-L88

The benefit of this is that we have one operation less to worry about when we want to prove soundness.