Converting Atom to JSON (recipes from Sam Ruby)
I finished testing the Erlang program by Sam Ruby to convert atom files to JSON. I ran it a number of times on the atom part of the repository for the wiki/blog I’m converting from JSPWiki to mombo, and I mostly got two interesting lessons:
- It feels fast, competing with perl, python, ruby, ..., I’m not sure how the numbers would look when compared with a java or C# solution on such a problem. I should look for some benchmarks about Erlang vs scripting languages such as python or ruby, or against OO-VMs like java or C#.
- The CPU use spiked vertically to 100% , which means two cores, and then back down to 0. I’m using a SMP erlang, and
erl -smp auto, which is the default in 5.5.5 in spite of the man page saying otherwise, really fills my Core 2 Duo processing files in parallel up to 1122 atom files or so. I’ve rarely seen java get more than 150% parallelism with dual processors.
I saw recently the mig21 is looking to Sam, too. Nice to see people in Spain interested in the world beyond the CLR and the JavaVM. I’m sure Sam is here for a long term bet, and the reasons why he and a lot of other clever people is looking at Erlang is manyfold:
- I’m guessing that the 25 years passed since the language was first developed is enough for it to be relatively patent-safe, which is not a small thing nowadays. I’d like to be enlightened in this area.
- hot replacement of code is a great thing, something actually needed if we want to stay into the high reliability realm seriously.
- zero-sharing architecture, with no shared state.
- distributability of code, makes for very nice and cheap to maintain horizontal scalability.
- Object Oriented programming is getting in the way of getting things done. Much like structured programming back when, OO programming is leading to a maintenance nightmare, where the mix of function and state encapsulated in small units is making server side programming difficult to understand and change in a world of relatively coarse grained resources and D(ocument)B(ases)
- while python and ruby are great for writing scripting code, both have serious shortcomings when dealing with concurrency. In fact most traditional computer languages have issues, except a few functional ones. Here Erlang rules

Add your comment