Wednesday, January 28, 2009

Absolute path resolver

I was looked for some utility to resolve absolute path of file or directory. I found namei but it result returns in form
$ namei /etc/gdc
f: /etc/gdc
d /
d etc
l gdc -> /home/hynek/.gdc
d /
d home
d hynek
l .gdc -> work/tiger/bear/common/etc/gdc
  d work
  d tiger
  l bear -> bear.trunk/
    d bear.trunk
  d common
  d etc
  d gdc
but I suspected something more like
$ abs_path /etc/gdc
/home/hynek/work/tiger/bear.trunk/common/etc/gdc
I haven't found anything better than make alias in my ~/.bashrc
alias abs_path='perl -MCwd -le'\''print Cwd::abs_path($_) foreach @ARGV'\'

Edit: As ZD notice readlink -f does same work. Thanks. readlink -m and readlink -e works as well but differs if some parts missing. I have decided to use

alias abs_path='readlink -m'

Wednesday, January 14, 2009

Erlang history summary by J. Armstrong

Joe Armstrong posts nice summary of Erlang history.

The transition was easy - they paid to do this. It became a real shipping project when they decided to use Erlang for the AXD301 - at that stage they put in the necessary $$$'s.

Now why did they choose Erlang for this project? - because all other alternatives had failed - ie it was not the strength of Erlang that was the deciding factor - rather the non-existence of alternatives.

Now how come the Erlang stuff was developed in the first place?

This was a happy accident - In the early 1980's a computer science lab was formed - most of the guys in the newly formed lab had zero experience with technology transfer, so we all thought that all we had to do was "invert stuff" and then "sell the idea to the management" nobody told us that this was like permanently banging your hand against a brick wall.

Inventing stuff is the easy bit ...

The selling stuff was tricky - we were very bad at this but very optimistic (still am :-) - we made all the classic mistakes - insulting people - getting into technical wars -

The turning point came when Erlang was banned - at the time we were very pissed off but like most carefull considered management decsions the net result was the exact opposite of what was planned - the consequences of the ban were difficult to forsee - but chaos was created - so things changed rapidly.

Thinking back the *important* things were:

  • enthusiasm and optimism (believe in what you do)
  • serendipity
  • chaos
  • smart people
  • finance

I think we systematically under-rate the significance of chance and chaos. Most significant change takes place in very short time periods of chaos. Erlang had many periods when nothing happened for years then rapid changes could take place in very short time periods, always when a crisis occurred (ie Erlang was banned, a big project failed etc).

Moral - forget about careful planning and move quickly when a crisis occurs - trust your gut feelings.

Cheers

/Joe Armstrong

Tuesday, January 13, 2009

History of Erlang

Joe Armstrong wrote nice article about Erlang History. It's worth reading whole article but I found most funny and nice part it's end.

6.4 Finally

It is perhaps interesting to note that the two most significant factors that led to the spread of Erlang were:

  • The collapse of the AXE-N project.
  • The Erlang ban.

Both of these factors were outside our control and were unplanned. These factors were far more significant than all the things we did plan for and were within our control. We were fortuitously able to take advantage of the collapse of the AXE-N project by rushing in when the project failed. That we were able to do so was more a matter of luck than planning. Had the collapse occurred at a different site then this would not have happened. We were able to step in only because the collapse of the project happened in the building where we worked so we knew all about it. Eventually Ericsson did the right thing (using the right technology for the job) for the wrong reasons (competing technologies failed). One day I hope they will do the right things for the right reasons.