Why Functional Languages Should Be Used for Blockchain Development

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@nphacker·
0.000 HBD
Why Functional Languages Should Be Used for Blockchain Development
# Introduction
Current blockchain protocols such as the Bitcoin and Ethereum blockchains use C++ and Go to implement their features. These languages at the end of the day are stateful languages and I believe that there is a lot to gain by building blockchains with functional languages such as [OCaml](https://ocaml.org/), [Erlang](http://www.erlang.org/) and [Haskell](https://www.haskell.org/). 
http://i.imgur.com/VP3wkBn.png
*Functional programming is built on principles of lamda calculus*

# Benefits of Functional Programming Languages
## Immutability
Blockchain technology is built around the concept of immutability, the fact that you can't change a transaction, but most blockchain implementations are built using stateful languages. This can lead to a multitude of possible vulnerabilities and unintended side effects. Thankfully functional languages do not have mutable variables and once you set a value it cannot be changed. 
## Fault tolerance
Fault tolerance is the ability for a system to continue running even in the event of  a failure. Erlang was used in the 1980s to handle millions of telephone call switches to ensure maximum availability, in a highly distributed large scale scenario Erlang ensured the Ericsson telecommunications company had 99.99% uptime per year. Languages such as C++ and Go do not provide fault tolerance which seems like a no-brainer for a blockchain implementation.
## Easily parallelized, highly distributed
Functional programming enables one to create highly parallelized and distributed systems, partly because the aspect of immutability leads to a number of compiler optimizations. Coupled with built-in functions for iteration such as map and reduce there seems to be very little reasons to use C++ or any other stateful language for blockchain development. 
# Market validation
[Tezos](https://tezos.com/) which is having their upcoming ICO, built their blockchain from the ground up and heavily use OCaml which is a popular functional language. The whole idea behind Tezos is a self-governing blockchain. You can learn more about their project and view the countdown to their ICO at their official site [here](https://tezos.com/). You can view their project's [GitHub source code here](https://github.com/tezos/tezos).
# Conclusion
I strongly believe that the future of blockchain development should be in functional programming. I hope you enjoyed this post.
*Cheers*
*~Np*
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,