Accord Project - Ergo+Overview
Ergo Overview
Language Goals
Ergo aims to:
- have contracts and clauses as first-class elements of the language
- help legal-tech developers quickly and safely write computable legal contracts
- be modular, facilitating reuse of existing contract or clause logic
- ensure safe execution: the language should prevent run-time errors and non-terminating logic
- be blockchain neutral: the same contract logic can be executed either on and off chain on a variety of distributed ledger technologies
- be formally specified: the meaning of contracts should be well defined so it can be verified, and preserved during execution
- be consistent with the Accord Project Template Specification
Design Choices
To achieve those goals the design of Ergo is based on the following principles:
- Ergo contracts have a class-like structure with clauses akin to methods
- Ergo can handle types (concepts, transactions, etc) defined with the Concerto Modeling Language (so called CML models), as mandated by the Accord Project Template Specification
- Ergo borrows from strongly-typed functional programming languages: clauses have a well-defined type signature (input and output), they are functions without side effects
- The compiler guarantees error-free execution for well-typed Ergo programs
- Clauses and functions are written in an expression language with limited expressiveness (it allows conditional and bounded iteration)
- Most of the compiler is written in Coq as a stepping stone for formal specification and verification