Tuesday, May 29, 2012

My Letter to the Editor of Linux Format

Linux Format published a series on writing Assembly Language Applications.  I personally thought this was obscure and the author was showing off.  With the speed of modern computers I found the subject ridiculous, so I wrote the following letter to the Editor:


In regards to Mike Saunders column on Assembly.
I find the whole concept strange and obscure. When you take the speed of today's computers into account, there is virtually no need to reach for Assembly. For those who do, it is usally a personal choice and not a technical one.
If you find that your application has a performance problem it can usually be fixed by a more efficient algorithm. Next, I would look at changing the most CPU hungry routines with c. If that doesn't work go back and look at the algorithm.
There are some real problems writing apps in Assembly,
      1. Maintenance is difficult and expensive.
      2. Moving the app from one processor to the next often requires a complete rewrite.
      3. It takes many times longer to write in Assembly and requires specialist knowledge. So the programming time costs more per hour and the number of hours are higher.
      4. He was writing in 32 bit when most processors today are 64 bit, running 32bit code on a 64 bit machine requires it to be ran in a interpreted mode and actually performs many times worse then if it had been compiled in c for a 64 bit processor.

Let us remember that virtually the entire Linux OS is written in c. I believe there are still some low level routines still written in Assembly, but the vast majority is written in c. If an OS as complex as Linux can be written in c and with good performance, the argument for writing in Assembly seems weak at best.
Terry Haimann
Des Moines, Iowa, USA