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

Translation back to Scilla AST #45

@vaivaswatha

Description

@vaivaswatha

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions