If Java is a Ford F-150 pickup truck – mainstream, ubiquitous, utilitarian – and Ruby is a Mazda Miata – great handling, and just a little 'out there' – then Erlang is a Porsche 911 GT2 – incredible engineering, but probably not for everyone. Written at Ericsson in the mid-eighties and open sourced in 1998, Erlang is a functional language and runtime environment designed for highly concurrent, fault-tolerant services, the more '9's the better. Originally intended for telephony systems, it's now seeing wider use in a variety of distributed applications such as CouchDB, RabbitMQ and SimpleDB.
Ian Brown, not the former lead signer of The Stone Roses, but an R&D manager at salesforce.com, dropped me a note on Chatter the other day to say that he's been moonlighting on ErlForce, an Erlang client library for the Force.com API*, and would I like to take it for a spin? How could I refuse!? With the Erlang getting started guide in hand, I managed to cobble together a working sample in just a couple of hours – my first Erlang app, test.erl:
There's a bit of housekeeping to load various required components, then I use the sfdc module's login function to get a session ID and API endpoint, execute a query to retrieve my Account IDs and names, and print them out. Running this in the Erlang interpreter gives very familiar results:
Ian describes ErlForce as 'pretty beta', so I wouldn't bet your business on it quite yet, but certainly go check it out. If you're already an Erlang fan, you'll be able to easily access your data in Force.com; if not, this is a great excuse to broaden your horizons and try a little functional programming 🙂
* For the record, this is Ian's own personal project and is no way affiliated with, supported or endorsed by salesforce.com. Except that it's cool technology that leverages the Force.com platform, and we're all for that!