Powered by Twitter Tools.

August 2008
M T W T F S S
« Jul    
 123
45678910
11121314151617
18192021222324
25262728293031

Chris Donnan : Programming - Brooklyn Style

software, trading, family, fun

Erlang vs Ruby

Erlang vs Ruby

Great post on 2 of my favorite languages.


Erlang on OSX

Getting setup with Erlang on OSX was simple - ./configure, sudo make install, etc.

I tried the Eclipse Erlang plugin… not so hot - they are trying - but it is not really there yet.

I found a Textmate bundle for Erlang. make a text file, chmod so you can execute it, run it. You do not even have to restart Textmate and you have basic erlang code highlighting, etc. That and an open terminal do the trick.

With this - I have been able to have a basic working model. Code, compile, etc. It is amazing how much tooling I rely on day to day coding C# or Java. Visual Studio, Resharper, Intelli J - these tools REALLY do a TON. On one hand it is refreshing to get to just a text editor and a compiler again, but on the other hand - I am just not sure how productive you can possibly be compared to an environemt with TONS of tooling. Simple refactorings becomde ‘grep’ efforts in stead of a code construct aware proper refactoring…

More to come;
Chris


RabbitMQ

I just had to mention this one- Rabbit MQ:

Built on the Erlang OTP
Implementation of AMQP
Java and .Net implementations
Open Source (similar to qpid)


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