Skip to content
This repository has been archived by the owner on Oct 28, 2022. It is now read-only.

Translation back to Scilla AST #45

Open
vaivaswatha opened this issue Jul 13, 2020 · 0 comments
Open

Translation back to Scilla AST #45

vaivaswatha opened this issue Jul 13, 2020 · 0 comments

Comments

@vaivaswatha
Copy link
Contributor

As an aid to testing and other experiments, it would be useful to translate monomorphized AST (and possibly closure converted AST) back into the original Scilla AST (i.e., executable via the reference interpreter).

Possible complications:

  • The Uncurried semantics has functions with multiple arguments, as against exactly one argument in the original Scilla AST. But since we don't have the actual Uncurrying optimization yet (Uncurry optimization #24 : but just a pass that translates the AST to Uncurried semantics), this is not a problem right now.
  • TFunMap and TFunSel AST nodes (i.e., dynamic dispatch of monomorphized code based on the type) after monomorphization. A TFunMap could possibly be translated into a list of (monomorphized) expressions, and the TFunSel into an operation that selects the right item from this list. This won't typecheck, but should still execute fine.
  • The pattern match simplification pass introduces jump statements. These can be eliminated by just (code) duplicating (transitively) the jump target into where the jump exists syntactically.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant