Lorentz and Indigo

Lorentz and Indigo are two programming languages invented by Serokell for Tezos platform to streamline the programming of Michelson contracts.

Brief description

Having completed Morley, we were invited to continue working on other components of Tezos. In particular, we decided to expand our work with Haskell eDSL to create two new languages.

Lorentz is a Haskell eDSL that provides a more convenient way to write Michelson contracts.

Indigo is a higher-level language based on top of Lorentz. It has variables and eliminates the burden of manual stack management. Lorentz and Indigo are the tools that could make Tezos a convenient development platform.

What was done

Lorentz code can be compiled to Michelson, and as long as the Haskell compiler considers Lorentz code valid, it is valid in Michelson as well. Lorentz greatly reduces development efforts for the following reasons:

MICHELSONLORENTZ
01

One can use Haskell features such as imports and functions. A Michelson smart contract contains just one code block and lacks any modularity. Lorentz inherits this modularity from Haskell. Modularity is invaluable for large contracts.

02

There are numerous tools for Haskell since the language is widespread. All of them can be used for Lorentz because Lorentz is embedded in Haskell.

Using Lorentz, one can insert documentation directly into the contract code. This documentation can be rendered to markdown, and we statically ensure that it matches the code it describes. It is ignored when compiling to Michelson.

The development of Indigo

Lorentz was a good improvement over vanilla Michelson, but manual stack management was still quite painful. To eliminate it, we made another eDSL based on Lorentz. It is called Indigo.

The main merit of Indigo is the introduction of variables. With variables, you don’t have to think about stack management anymore and code looks much clearer. This should eliminate some of the difficulties users encounter today when using the platform and make the process of development much more intuitive and user-friendly.

Serokell Solutions: L&I

Result

Serokell invented two programming languages that complement each other and streamline the programming of Michelson contracts. Implementing a programming language is a non-trivial task that demands deep expertise and understanding of the Tezos platform.

At Serokell, the team was able to think outside of the box to design these language solutions to deliver better tooling and increase adoption.

Let’s Have a Chat

We would be happy to discuss your project and propose solutions.

Contact us