Why Haskell?

That’s probably the most intriguing question you might want to ask. In this article, we’ll answer it and more questions too:

  • Why have we chosen Haskell for Enecuum blockchain?

Why have we chosen Haskell for Enecuum blockchain?

Haskell has a long story as a programming language. It has been proved that programs in Haskell have many advantages over other languages, and all of them came from the nature of the language: high level, statically and strongly typed, functional, nearly mathematical, with very powerful and safe idioms inside.

  • High stability. It’s much more easy to achieve stability in Haskell comparing to all the mainstream languages.

What achievements were made?

In Haskell, we have developed a framework, a domain-specific language to build our blockchain project. Designing this eDSL, we were pursuing several goals:

  • Make implementing of blockchain business logic as simple as it can be (reduce accidental complexity of the project).

So let me present you some test node script that deals with transactions in the graph. As long as this script for test aiming to show some graph work, it only contains transactions organized as linked list. The script also works with node’s specific state.

Notice several things here.

  • First of all, this is a part of node behavior serving some RPC call. That said, when the acceptBalanceChange handler is called, it attempts to update the graph checking if it’s even possible to add such transaction on top of others. It might be the new change makes the balance negative, so the transaction is invalid and will be rejected.

What’s next?

Our next goal is to create Enecuum blockchain v2 on top of this framework. We have a clear view how to create blockchain network nodes with configurable behavior, and we expect the business logic code to be highly accessible and provably error-free from the start.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store