tezos-checker / checker

An in-development "robocoin" system for the Tezos blockchain
25 stars 16 forks source link

Porting to Ligo: a gradual transition strategy #16

Closed purcell closed 3 years ago

purcell commented 3 years ago

Goals

Proposed approach

Write Ocaml that approaches Ligo, with shims

Code that is to be included in the target contract is written in Ocaml, in a particular style:

Process for translation to Ligo

As an automated process, produce Ligo from Ocaml and build it with the Ligo tools, following these conversion steps:

Initial code changes necessary:

murbard commented 3 years ago

This sounds sensible. You missed two important ones IMO :

purcell commented 3 years ago
* decurryfy all functions

There's actually a Ligo merge request in the works that makes this unnecessary, at least as long as code isn't explicitly placed in modules (which are now preliminarily supported), so we've taken this into account in our planning.

utdemir commented 3 years ago

do not use continuations to make functions tail recursive, use an explicit data structure instead like a list representing the argument stack

And we already have followed this through, sorry I forgot to post an update to the channel. Now we don't use continuations on avl. I remember that change saving around 25% of generated Michelson.

purcell commented 3 years ago

Open issue: Ligo has no mechanism for originating a new contract, yet Checker will need to originate Burrow contracts. How will we do this? Presumably we will drop down to michelson for this.

purcell commented 3 years ago

To do next:

gkaracha commented 3 years ago

make build-ligo now succeeds with all entrypoints being reachable, so I think we can safely close this one.