Programming Languages

Found myself recently spending some time thinking about programming languages. My preferred language is still C++, which I have mastered almost at guru level. You can do incredible things with modern C++ design, but with all those people using JAVA, Python, Ruby and even C#, I might become a FORTRAN or COBOL programmer of our time: maybe respected, but on the way towards a dead end, with a knowledge that might become useless or obsolete, or even worse, become a ballast that makes me blind and unable to learn new stuff.

So first of all, JAVA is a language that is in wide-spread use, has a blazingly fast compiler: The startup time of a java program usually is longer than the compile time. And there are cross-platform libraries that cover such a wide range that you will probably find anything you need somewhere on the web, and it will just work on your platform. And no more pointers that make your software crash or susceptible to buffer overflow attacks. There is just one problem: I do not like Java. I never did, and probably never will. Why? The short version: Lack of control and nannying, and the performance penalty I have to pay even if I dont want to. I do not say Java is too slow; it is just that it can never be as fast as C or C++. Ah, and floating point was broken in Java by design; they tried to fix it, but I am still not convinced. I just looked up some performance figures for current Java implementations, and the linpack benchmark really raises my suspicion: it runs so fast in Java, that I am quite sure they have a kind of benchmark detector inside, because my own benchmarks typically show a factor of 3-5 slower than C++ when using tight loops that crunch numbers, but I definitively have to investigate on that further.

So with Java not becoming a good friend anytime soon, how about Python, the new old scripting kid on the block? I think there is definitively a place for “scripting” languages, who prefer themself to be called “dynamic languages”. When scripting, I am willing to pay the price for the isolation layer and for the ability to quickly glue together big chunks of code of different origin. But I do not want to pay the price when I want to deal with bits and raw bytes. I really like C++ philosophy of “you don’t pay for what you don’t use”. I would really like to have a dynamic language that makes and keeps that promise, but there is another issue: How can I know the price of the things when I use I a high level language? And what about the web? Tonight I am going to do some Ruby benchmarks, but I was already told it is supposed to be slow, but lets see. I will also throw in my Python, C++ and Java Benchmarks, and also those of my own virtual machine spike solution for a dynamic language. Stay tuned.