point
The Smart Techie was renamed Siliconindia India Edition starting Feb 2012 to continue the nearly two decade track record of excellence of our US edition.

April - 2008 - issue > Technology

Erlang - Software for the Real World

Karthik Ramchandra
Monday, March 31, 2008
Karthik Ramchandra
Whenever we talk of designing software, we talk of modelling our system so that it mirrors the real world as much as possible. We say that we conceptualise objects or services to make them similar to the real world. The real world is concurrent, and consists of a large number of events many of which happen simultaneously. At an atomic level our bodies are made up of atoms and molecules that are in simultaneous motion. At a macroscopic level the universe is populated with galaxies of stars that are in simultaneous motion.

When we perform a simple action, like driving a car, we are aware of the fact that there may be several hundreds of vehicles within our immediate environment, yet we are able to perform the complex task of driving it and avoiding all these potential hazards and hurdles without even thinking about them.

In the real world sequential activities are rare. As we walk down the street we would be very surprised generally to find only one thing happening; we expect to encounter many simultaneous events. If nature had not endowed us with the ability to simultaneously analyse and predict the outcome of many events we would live in great danger, and tasks like driving a car would be impossible. The fact that we can do things which require processing massive amounts of parallel information suggests that we are equipped with mechanisms that allow us to intuitively understand concurrency without consciously thinking about it.

When it comes to computer programming, things suddenly become inverted. Programming a sequential chain of activities is viewed as the norm and is thought of as being easy, whereas programming collections of concurrent activities is avoided as much as possible, and is generally perceived as difficult. This is due to the poor support which is provided for concurrency in virtually all conventional programming languages. The vast majority of programming languages are essentially sequential; any concurrency in the language is provided by the underlying operating system, and not by the programming language. If we write programs that behave the way the natural objects do in the real world, such programs will have a concurrent structure.

In Concurrency Oriented Programming, the concurrent structure of the program should follow the concurrent structure of the application. It is particularly suited to programming applications which are modelled after or interact with the real world.


Share on Twitter
Share on LinkedIn
Share on facebook