Design Annotations - Glow-Lang/glow GitHub Wiki
How best to enrich the core lambda calculus with annotations for the multi-party computation and/or economic aspects of the language?
Indeed, some entities, like participants and assets, are treated specially by the compiler's code generator and logic model generator.
- Right now, we have a single annotation on the function definition,
but it gets more and more parameters that grow more complex as we add features:
@interaction({participants: [Buyer, Seller], assets: [Price]) let Closing = (Buyer, Seller, Price) => - We could instead have one annotation on the function definition per parameter,
and that might make things maybe simpler, e.g.:
@participant(Buyer) @participant(Seller) @asset(price) let Closing = (Buyer, Seller, Price) => - Or we could instead annotate the individual arguments of the function:
let Closing = (@participant Buyer, @participant Seller, @asset Price) => - Or we could instead annotate the types of the arguments of the function:
let Closing = (Buyer : @participant Address, Seller : @participant Address, Price : @asset Asset) => - Or we could have special magic types for participants:
let Closing = (Buyer : Participant, Seller : Participant, Price : Asset) =>
Whichever way we define interactions, what is the syntax for calling them? Do we use annotations, too?
How do we distinguish between the open and closed cases? How do we quantify over a participant in the open case? What if, in an open interaction, there are many participants who entered with a given role, e.g. many bidders in a sealed auction? How do we express guards on participants, e.g. "must have participated in that other interaction", "must be registered as having done their KYC", etc.?