August 2007
M T W T F S S
« Jul   Sep »
 12345
6789101112
13141516171819
20212223242526
2728293031  
Chris Donnan

Create Your Badge

Chris Donnan : Programming – Brooklyn Style

software, trading, family, fun

Erlang musings

I have been reading the prag progammers Programming Erlang – Software for a Concurrent World. I have been looking casually @ Erlang for a few months. The thing that initially interested me about Erlang was the “concurrency thing”. Erlang is beyond concurrency friendly – it is built into the language core. Erlang is all about concurrent programming on 1-N CPUs/ machines.

I have been a casual to semi-serious ruby lover for some time. I have not been able to use it 9-5 (except for the odd task I need to script – like aggregating unit test statistics across an enterprise, etc.). I have more recently gotten to giving python (yeah – the iron variety) a go. These languages are great – they are also inherently “object oriented”.

Erlang is not object oriented. This both repulsed and attracts me at once to it. It repulses me because I have baked in the OO-isms to my core.

Erlang is a general-purpose concurrent programming language and runtime system. The sequential subset of Erlang is a functional language, with strict evaluation, single assignment, and dynamic typing.

(wikipedia)

The fact that you have no classes, variables are declared in upper case and you deal primarily in functions is amazing and radically different than OO. Variables are “single assignment” (once you set X – you cannot change it). Again – I say – there are no classes!! I am really interested in working from a totally different perspective. The functional sequential portion of erlang is very interesting. I will have to post another time about pattern matching and how method lookup works – it is interesting.

Erlang is all about concurrency.

Erlang’s main strength is support for concurrency. It has a small but powerful set of primitives to create processes and communicate between them. Processes are the primary means to structure an Erlang application. Erlang processes are neither OS processes nor OS threads, but lightweight threads somewhat similar to Java’s “green threads“. Their estimated minimal overhead for each is 300 bytes, so many of them can be created without degrading performance.  (a benchmark with 20 million processes was tried)

(wikipedia – again)

I wll have to make another post about how you send/ receive/ spawn in erlang to communicate between processes – but it is very interesting.

In short – erlang is really a cool language that is pushing my brain to consider real – different alternatives to “the way I have been working for years more or less”.

Consider this post - Ralph Johnson thinks Erlang could even be “the next java” (something that apparently everyone is looking for – many in ruby, some in erlang, haskel, etc).

Keep watch – there is interesting stuff out there!

-Chris


You can leave a response, or trackback from your own site.