Closed fgmccabe closed 4 years ago
The way the deferred/defer-scope combination is designed it is not specifically tied to freeing linear memory. This allows for other kinds of cleanup action to take place. Also, we need to make sure that the 'small-step' semantics remain smooth; this was the reason I originally proposed the current structure.
In fact, there is another issue that you hinted at with the lazy expression. The semantics of memory-to-string are not clean: the returned value is not a string but a promise of a string; that complicates the semantics considerably.
Example scenario walkthrough
Initial draft