Erlang, Elixir and LFE

For the last 6 months I have been working as an Erlang developer. At this moment I am coding a messaging server for Whisper using ElasticSearch for storing the messages and Cowboy to create the webserver endpoints.

I really like Erlang, even if I think its ecosystem leaves a lot of room for improvement. I am not a big fan of its Prolog based syntax. I don’t think it’s complex or difficult but the use of comma ‘,’, semicolon ‘;’ and period ‘.’ as terminators is cumbersome (you need to change the terminator almost every time you move a line) and doesn’t have any real benefit:

The excitement of Elixir:

Erlang’s syntax does away with nested statement terminators and instead uses expression separators everywhere. Lisp suffers the same problem, but Erlang doesn’t have the interesting properties of a completely uniform syntax and powerful macro system to redeem itself.

It is not a real problem anyway. If you follow one of the three ways to read Erlang code explained on the post called On Erlang’s Syntax, you will get it really fast. In general, I agree with Erlang syntax again … and again … and again …:

While I can understand people may dislike the syntax of a certain language, even I dislike some syntaxes, I don’t understand people who say “I was going to learn Erlang but the syntax was so strange I quit”.

If you know that there are really awesome areas where Erlang BLOOMS, you will learn the language even if it’s different from your main language.

My point is that the syntax is the easy part of learning a new language, just look it up in the manual. It is learning the semantics of the new language and how to use it efficiently to solve your problems which are the major difficulties. How do I structure my solution to best make use of the language and its environment? This is where major rethinks will occur. This is what takes time to learn and understand. Not in what it looks like.

I want to use Elixir on a daily basis not only because I think it has a better syntax:

Elixir: It’s Not About Syntax:

The great thing about the Elixir standard library is that with each release it can provide features that Erlang developers clamor for everyday. We have Erlangers, Clojurists, Haskellers, Rubyists, and Pythonistas trying to incorporate useful features into Elixir every day. Elixir isn’t afraid of introducing functionality that improves the lives of Elixir developers, and everything is on the table: new data structures, real Unicode support, anything. […] Elixir isn’t the CoffeeScript of Erlang just as Clojure isn’t the CoffeeScript of Java. Just like Clojure, Elixir is more than a pretty face. Elixir is the power of it’s tooling, the expressiveness of it’s metaprogrammability, and the expansive feature set of it’s standard library while maintaining complete compatibility with—and heavily leveraging—OTP. Once again I have yet to adequately scratch the surface of what makes Elixir special, but I have more Elixir to write!

I have only played with Elixir for a few hours before learning and really using Erlang. I plan to use Dynamo and Ecto instead of using Nodejs with Express or Erlang with Cowboy to create my next REST system. I will let you know if I find a real benefit of using it instead of Erlang.

At last I wanted to mention my latest discover: Lisp Flavored Erlang (LFE)

Nothing Quite Compares to the taste of Erlang, aged in the oaken barrels of Lisp, served at a temperature of perfect hotness.

I think this doesn’t need any more clarification. After learning Lisp I will give LFE a try. Check out its awesome guide.

R programming language

A few months ago I bought a book called Exploring Everyday Things with R and Ruby. I saw its table of contents and I knew I wanted to read it.

If you’re curious about how things work, this fun and intriguing guide will help you find real answers to everyday problems. By using fundamental math and doing simple programming with the Ruby and R languages, you’ll learn how to model a problem and work toward a solution. Here are some of the questions you’ll explore: - Determine how many restroom stalls can accommodate an office with 70 employees - Mine your email to understand your particular emailing habits - Use simple audio and video recording devices to calculate your heart rate - Create an artificial society—and analyze its behavioral patterns to learn how specific factors affect our real society

I bet now you want to read it too. But that’s not all. A guy that I really respect, called Zed Shaw, wrote Programmers Need To Learn Statistics Or I Will Kill Them All. At the end of the post he encourages you to learn R. I only know basics of statistics, so I will try to kill two birds with one stone:

Learning to use R will help you also learn statistics better.

A few weeks ago I started a course on coursera about Machine Learning. Apparently, R is also very useful if you are into Machine Learning. There also an interesting book from O’Reilly called Machine Learning for hackers that uses R. Check them if you are interested.