Skip to content

Cicero v0.5.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@mttrbrts mttrbrts released this 02 Aug 14:26

Momentum is building πŸ“ˆ ! We're really starting to see the benefits of the stack now.

This week's release includes support for Cicero in the browser, support for module import in Ergo, and an external contribution from @dlkconsultancy to provide a contract Car Rental template in Turkish, teşekkΓΌr ederim! πŸ‡ΉπŸ‡·

Note that we plan to support multi-locale templates (with legal text in multiple locales, backed by a common data model and logic) in a future release. See issue #174.

πŸ’” Beware that we have some breaking changes in this release on the Ergo side, but don't worry, the migration is pretty simple (accordproject/ergo#326)

Install the latest release of the Cicero command-line tool with
npm i -g @accordproject/cicero-cli

Features

Cicero

πŸ– Cicero is escaping from the server into the browser! This opens up all sorts of fun possibilities, Cicero Template editing online, client-side validation of templates. We're really excited to see where this leads. HT @mttrbrts

<script src="https://unpkg.com/@accordproject/[email protected]/umd/cicero.js"></script>

See the following minimal repos for examples that use the webpack'd library.

Ergo

πŸŽ‚ Ergo is now at v0.2.0.

🍸 Delegate!! Ergo 0.2.0 supports modularity: you can create your logic in multiple Ergo files or import libraries! For instance:

// In money.ergo:
namespace org.accordproject.ergo.money
define function compoundInterest(annualInterest : Double, numberOfDays : Double) : Double {
    return (1.0 + annualInterest) ^ (numberOfDays / 365.0)
}

// In logic.ergo:
import org.accordproject.ergo.money.*
...
  clause check(request : Payment) : Result throws ErrorResponse {
    let compounded =  request.amount * compoundInterest(contract.interestRate, numberOfDays);
...

Language

Compiler

  • Brand new inlining phase (contribution @kach)
  • Revisions/bug fixes to namespace resolution and context management
  • Compiler and REPL share common compilation pipeline
  • Automatically reorders input CTOs and Ergo modules based on dependency
  • Initial compiler support for type checking

Tooling

  • new ergodep command line tool calculates dependencies

REPL (contribution @kach 🌯, @jeromesimeon)

  • Interface improvements (multiline input, better error reporting, handles empty input gracefully)
  • Support for state changes
  • Support for match, set contract and call
    REPL now checks/infers types (alpha)

Document Object Model

🐢 Eating our own dog-food... @dselman has published a DOM (document-object model) to describe the structure of a Cicero template. This formal structure gives us much more power to parse, generate and manipulate templates within the engine and using Ergo code.

Get a sneak peek of what's to come at https://models.accordproject.org/cicero/dom.html and by following the issue #171.

Templates

πŸš— Car Rental Agreement (in Turkish) via @dlkconsultancy. This is the first non-English template, great job Umut and Serkan!

Documentation

See the latest version of the documentation at https://docs.accordproject.org/

Fixes

🐞 Something screwy happened with our version numbers but @jeromesimeon & @penguinbroker put us back on track! (215e3da)

🐞 The cicero-core API now exposes the TemplateLibrary class properly (2469c1d)