create account

Why Functional Languages Should Be Used for Blockchain Development by nphacker

View this thread on: hive.blogpeakd.comecency.com
· @nphacker · (edited)
$11.24
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*
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 19 others
properties (23)
authornphacker
permlinkwhy-functional-languages-should-be-used-for-blockchain-development
categoryfunctional
json_metadata{"tags":["functional","blockchain","tezos"],"image":["http://i.imgur.com/VP3wkBn.png"],"links":["https://ocaml.org/","http://www.erlang.org/","https://www.haskell.org/","https://tezos.com/","https://github.com/tezos/tezos"],"app":"steemit/0.1","format":"markdown"}
created2017-05-13 18:59:27
last_update2017-05-13 21:38:12
depth0
children2
last_payout2017-05-20 18:59:27
cashout_time1969-12-31 23:59:59
total_payout_value8.506 HBD
curator_payout_value2.735 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2,429
author_reputation9,918,008,820,689
root_title"Why Functional Languages Should Be Used for Blockchain Development"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id3,385,865
net_rshares4,367,557,920,439
author_curate_reward""
vote details (83)
@woz.software ·
I would take it a step further, the future of programming should be functional programming :)

You can see its influence already. C++ 11, Java 8 and C# 3.5 was when these languages started to pull in lambda. C# is pushing more functional features with each release.
👍  ,
properties (23)
authorwoz.software
permlinkre-nphacker-why-functional-languages-should-be-used-for-blockchain-development-20170710t063608723z
categoryfunctional
json_metadata{"tags":["functional"],"app":"steemit/0.1"}
created2017-07-10 06:36:09
last_update2017-07-10 06:36:09
depth1
children0
last_payout2017-07-17 06:36:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length265
author_reputation2,321,910,395,519
root_title"Why Functional Languages Should Be Used for Blockchain Development"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id7,954,561
net_rshares0
author_curate_reward""
vote details (2)
@yaalu ·
I agree.

What do you think of Clojure? and status.im using ClojureScript?

This http://blog.syrinx.net/the-resurrection-of-lll-part-1/
talks about a LISP like language called lll for writing smart contracts.
properties (22)
authoryaalu
permlinkre-nphacker-why-functional-languages-should-be-used-for-blockchain-development-20170625t164130074z
categoryfunctional
json_metadata{"tags":["functional"],"links":["http://blog.syrinx.net/the-resurrection-of-lll-part-1/"],"app":"steemit/0.1"}
created2017-06-25 16:41:15
last_update2017-06-25 16:41:15
depth1
children0
last_payout2017-07-02 16:41:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length208
author_reputation0
root_title"Why Functional Languages Should Be Used for Blockchain Development"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id6,064,006
net_rshares0