Voalté and Erlang
As Benjamin King pointed out in a recent blog post “Is Erlang Right for Healthcare Communication?”, Voalté uses erlang extensively and loves it! Erlang gives us the right balance of resiliency, flexibility, and maturity needed to solve the demanding problems we face on a daily basis.
What I find truly amazing, despite erlang's age, is that the community is active and vibrant. Better tools are developed, new frameworks are created and improvements to the core are happening constantly. An increase in public activity over the past few years has lead to what I perceive as the "Erlang Renaissance".
I love participating in this community. I especially enjoy publishing tools we create as open source in hopes that others will find them as useful as we did.
Erlang Factory 2011
A couple of weeks ago, I presented at the Erlang Factory Conference in San Francisco on a tool I created called
“emetric - Getting Useful Metrics From Your Erlang Node” (a blog post will follow soon on the topic). You can access the slide deck, but it probably won't make too much sense out of context. The Erlang Factory promised to publish the conference videos to vimeo.com in the near future.
I have attended this conference every year since it started, but this was the first time I presented. It was a special opportunity, and I thank The Erlang Factory for offering it to me. It also allowed me to hang out with old friends, meet new people, learn fresh ideas, share thoughts and talk “shop”.
One of the major themes for the conference was all the support tooling that’s now available to us erlang developers. Kostis and his team have created fantastic tools which appear to perform acts of magic. As Jack Moffitt pointed out in his talk “Erlang Gives You Superpowers”.
Here’s a quick recap of what I found to be the highlights of the event:
Distributed Social Networking
The folks at Process One have started working on fixing the social networking problem. (Putting all your personal information into a single corporation and letting them sell it is a Bad Idea[tm]). Their solution to this problem holds a lot of promise, though it won't be available until later this year when ejabberd 3.x is out. The possibilities for Voalté are very exciting given this new open standard form of communication.
Proper
Proper is an open source property checking test tool. You can use it to do 'random' based testing on various properties of your modules. It is extremely useful in finding edge case bugs in your code. You should be using this.
Tidier
Tidier is a tool that does automatic refactoring. It transforms common anti-patterns or old styles into modern best practices and simpler statements. The best part is that due to erlang's functional nature, semantics are preserved.
Example from their presentation:
lf(X, List) ->
lists:filter(fun (Y) ->
if X =:= Y -> true;
true -> false
end
end, List).
to
lf(X, List) -> [Y || Y <- List, X =:= Y].
There are plenty more examples of this magic in the slide deck.
Dialyzer
Dialyzer is a static analysis tool. While erlang may be dynamic-typed (non-static typed depending on how pedantic you are), there is a facility to provide a type specification for your functions. This is more like formal documentation that the compiler checks rather than a static interface declaration or anything even remotely close to haskell's type system.
Dialyzer uses formal documentation hints to determine if there is any incorrect code, unreachable code, etc… everything a mature static analyzer can do.
Softlab has a public results page for open source projects. See the warnings on ejabberd…they’re quite illustrative.
Rebar
The erlang community is rapidly standardizing on rebar as the build tool. Even in a 20+ year old language, there is still room to innovate on build tools.
What dizzyd managed to do is take all the complexities of building erlang systems and wrap it up into a tool that uses convention over configuration. No longer is it necessary to mangle large complex makefiles if you are following OTP principles in your erlang projects. You no longer have to create large and arcane tuple littered files to configure a baroque release system. Rebar assumes you are following OTP and does most of the heavy lifting.
All of this is provided in a single escript file, too. There are no dependencies outside of a base erlang install.
Rebar has been a godsend to those who are managing large projects.
CUDA (NVIDIA’s parallel computing architecture)
Kevin Smith has written an erlang library for interfacing with CUDA called pteracuda. For me, this is a solution in search of a problem. I don't mean to imply that CUDA is not useful, far from it. There are tons of use cases: routing table lookups in O(1), biotech, stock analysis, etc. The problem is that I am not currently working in any of those fields where CUDA could be used. For now, I just get to fantasize about using a 1024 core system.
Voalté using the cool stuff
The Erlang Factory Conference gave me the opportunity to get a closer look at lots of new tools and random geek drool items. What does this mean for Voalté and our code? Lots of exciting stuff!
We have already moved our build system to rebar. This allows us to reduce makefile size, delete code and get the same results…always a Good Thing[tm]. Rebar is also very hackable—a huge win all around.
Proper, dialyzer and tidier will also be going our build process soon. These tools provide so much benefit that it would be foolish for us not to utilize them. I am especially looking forward to all the rewriting that tidier will do.
What feature are you most excited hearing about? We’d love to hear your thoughts.