If you haven’t done so, now it is a good time to get yourself familiar with Haskell, the underlying programming language of the Cardano blockchain used by Plutus and Marlowe.

Haskell

Haskell is a functional programming language. Functional programming languages are designed on the concept of mathematical functions that use conditional expressions and recursion to perform computation. Functional programming languages don’t support flow Controls like loop statements and conditional statements like If-Else and Switch Statements. They directly use the functions and functional calls. Like object oriented programming languages, functional programming languages support popular concepts such as Abstraction, Encapsulation, Inheritance, and Polymorphism. Some other well known functional programming languages are: Python, Erlang, Clojure, Scala (combination of functional and object oriented programming language that is used by IOHK for its enterprise blockchain Atala)

Some advantages of functional programming languages are:

  • bug free code
  • efficient parallel programming due to a non mutable state
  • programs consist of independent units that can run concurrently, as such programs are more efficient
  • lazy evaluation, expressions are only evaluated once needed, this avoids repeated evaluations and as such increases the performance

The efficiency of a Haskell program is dependent on the knowledge and experience of the developer. Like in any programming language you can write efficient and inefficient code. This is often dependent on how a program is organized (flow) and the algorithm used to solve the problem. Next to coding efficiency, there are other factors that play an important role in the efficiency of a program . Examples of these are: the hardware and the operating system, the compiler speed, the way a program is logically structured and the algorithms used to solve the problem.

Haskell has a long history since the Haskell Language Report was published in 1990. The language has grown in popularity since. It is has a diverse range of use commercially, from aerospace and defense, to finance, to web startups and hardware design firms.

Goguen

The purpose of Goguen is to deliver functionality to be able build decentralized applications (DApps) on the Cardano blockchain. Or with other words Goguen will deliver the libraries and tools to write smart contracts on the Cardano blockchain.  A smart contract is a computer protocol to facilitate, verify or enforce the negotiation or performance of a contract. Smart contracts are self-executed automated contracts that make it possible to exchange money, property, shares, or anything of value in a transparent conflict-free way avoiding the services of  a middleman and manual intervention.  Compare this with our traditional economy where most of these transactions involve a notary, financial advisor, bank etc. and paperwork contracts. This is a costly process since we are not allowed to bypass these intermediates to create a legal and binding contract. Smart contracts allow the performance of credible transactions and legal binding (via a trusted entity, the smart contract) without third parties. Decentralized systems like Cardano make it possible to cut out the middleman which saves time and conflicts and as such makes transactions cheaper. Due to the use of cryptography and decentralization transactions are more secure than in traditional systems. Traditional systems are more vulnerable for fraud and hacking due to their centralized character and limited data protection, hence we see every day articles in the media about hacks by cybercriminals.

Plutus

Plutus is the smart contract development platform for Cardano blockchain that is relying on the Haskell platform or the most common used freely available implementation of Haskell, known as the Glasgow Haskell Compiler. Plutus is a smart contract language developed by IOHK on basis of Haskell. The Glasgow Haskell compiler provides an interpreter (ghci) for easy prototyping, simulating, learning and testing in an interactive way and a compiler (ghc) to actually build programs. Many people contributed to this platform, from which many worked at the University of Glasgow hence the name Glasgow Haskell Compiler.

Marlowe

Marlowe is a domain specific language (DSL) for modelling financial instruments and smart contracts. Business engineers or domain experts can create smart contracts in Marlowe with limited or no programming knowledge. Business people can develop smart contracts by composing functional building blocks in a workflow via drag and drop. The final result is a representation of the traditional business contract but now completely automated via a smart contract. Smart contracts for fixed-duration financial products can be created via Marlowe such as hedging, fixed-term deposits, credit swaps, and crowdfunding. You can start by getting yourself familiar with Marlowe by visiting the playground https://alpha.marlowe.iohkdev.io/#/

Study

There are many free resources available on the internet to learn Haskell, below we are providing two sources you could use to extend your programming skills:

Further you can find some paid Haskell courses on Udemy.com that won’t cost you a fortune.

Enjoy learning something new and get ready writing smart contracts on the Cardano blockchain.

Cheers till next blog, Ron