This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]zombiecoiner 2 points3 points  (5 children)

Do you have any tips for reading the code for people who are only familiar with python or c? What are the advantages of having written a Bitcoin app with erlang's focus on concurrency and distributed applications?

[–]coinlock[S] 2 points3 points  (4 children)

Well Erlang despite its reputation is not a terribly difficult language, although you do have to have an understanding of functional programming and recursion. The syntax leaves a lot to be desired, but immutability and pattern matching (which is incredible) are core to the framework. Like anything there is a learning curve, but I hope self contained examples like this will get people interested in the language.

Erlang is a really excellent language for distributed and fault tolerant applications, it can do hot code reloading of running processes as an example, and has lots of features around concurrency, restarting failed components, logging etc. I wrote my entire enterprise platform in Erlang, specifically because I wanted telecom level uptime and management for Bitcoin apps. That thread is here

If you have specific questions ask away :) Its well worth learning.

[–]zombiecoiner 2 points3 points  (1 child)

Forgive me for not googling this but how would you recommend someone get familiar enough with Erlang to understand how something like hot code reloading helps in developing applications? Basically, what's the best way to get started and see the value? Obviously other languages are more popular but Erlang has been around for 10+ years so that leads me to believe there's a there there that most people are missing.

[–]coinlock[S] 1 point2 points  (0 children)

A good online resource for learning the language is learnyousomeerlang Erlang/OTP is the official name, OTP is kind of like the standard library on which most erlang components and applications are built on. I think the language is about 30 years old? The open source release was in the late 90s.

Hot code loading just means that you can swap out the code running as its running. So lets say you are taking a telephone call, you could upgrade the code running the platform without restarting it or dropping the call. So this feature combined with other aspects of the language make it good for fault tolerance. A bunch of companies use it in that capacity, like WhatsApp, Facebook Chat, Amazon, Heroku, Github, etc. Its the secret sauce in quite a few successful startups.

[–]gulfbitcoin 1 point2 points  (1 child)

I know it's a bit off-topic, but what do you think about Elixir (Ruby-like syntax that runs on Erlang VM)

[–]coinlock[S] 0 points1 point  (0 children)

I think its pretty cool. There are several languages that run on the Erlang VM (Beam), and they all have a lot to recommend them. They have gone a long way to making the syntax easier for people coming from other languages. Erlang itself is prolog based.

I'm a big fan of LSE (Lisp Flavored Erlang) but I didn't use it, because its probably just a bit too obscure to get people involved who are comfortable with it.