Skip to content

New design for code generation and contract typing/kinding

Rémi requested to merge ajob410@entrypoints-v2 into dev

Motivation and Context

Make code generation easier after type-checking (entry ; dyn_entry) see #2008 (closed)

Description

New:

  • Ast_core.E_contract (contract_of)
  • Ast_core.T_contract_parameter (Parameter constructor hack)
  • Modules now have an associated sort (Ss_module or Ss_contract (parameter,storage))
  • Self_ast_typed pass is now as standalone pass (i.e. is executed on all programs whether or not it is a contract, a view, or else)

Weird handling of single-entrypoint:

  • compile parameter /path/to/file (with no -e) will assume a single-entrypoint
  • entrypoint has no associated annotation in the michelson target type

Future:

  • update doc on entrypoints
  • make Self_ast_aggregated a standalone pass as well (probably by lifting it to Self_ast_typed)
  • Clean Test library types

closes #2008 (closed), #2020 (closed)

Component

  • compiler
  • website
  • webide
  • vscode-plugin
  • debugger

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement (non-breaking change that improves performance)
  • None (change with no changelog)

Changelog

Deprecate main contracts. Single entry-point contract will now require a [@entry]/@entry annotation

Checklist:

  • If a new syntax has been introduced, put a message on slack ligo-lsp
  • Changes follow the existing coding style (use dune @fmt to check).
  • Tests for the changes have been added (for bug fixes / feature).
  • Documentation has been updated.
  • Changelog description has been added (if appropriate).
  • Start titles under ## Changelog section with #### (if appropriate).
  • There is no image or uploaded file in changelog
  • Examples in changed behaviour have been added to the changelog (for breaking change / feature).
Edited by Rémi

Merge request reports