Sunday, 3 October 2010

TIOBE index decomposed

This post presents a different way to look at the TIOBE index. Of the top 20 languages, I exclude non-generic languages, like SQL or MATLAB. The next is to group the languages by performance characteristics:

Compiled languages that produce very fast apps:
* Ada
* C
* C++
* Delphi, Pascal
* Objective-C

Garbage-producing languages:
* C#/VB.net
* Google Go
* Java

Languages that produce slow apps:
* Javascript
* Lisp
* Perl
* PHP
* Python
* Ruby

When I look at products, which I consider successful, fast and slick, I see:
* Apple uses Objective-C
* Linux kernel and tools (incl. Android, Google servers etc.) use C/C++
* Webkit, Google Chrome use C/C++
* Microsoft uses C/C++
* Several successful vendors with great software in my industry use Delphi

I see problems with:
* Microsoft .net and Java apps tend to be bloated and slow
* Java apps on Android are not as slick as Objective-C apps on iPhone
* C#/VB.net programming requires that you are willing to bet your investment on Microsoft, who has lost major market share in many form factors
* Large apps or frameworks built on PHP or similar, simply fail to deliver

Looking into the future, where we will need one language to write one app that runs on multiple CPUs with each their own RAM, or NUMA, the compiled languages will do just fine, but the garbage languages need to be replaced with something that handles memory allocations differently.

13 comments:

ahmoy said...

Objective-C also has a garbage collector (not for iOS though)

LDS said...

"Large apps or frameworks built on PHP or similar, simply fail to deliver"

Facebook? Wikipedia? Flickr?

Also you're looking at Java from a desktop app perspective. Java today is much more used on the server side, like nost of C# code.

Lars D said...

I would not include wikipedia and flickr as programming frameworks, but I agree that a lot of slow technology can be made faster by adding more hardware on the server. However, for languages like php, it is obvious that they don't deliver as general purpose languages - much performance-requiring stuff has to be implemented as php modules using c/c++, and the oop part seriously slows down everything.

Michael Justin said...

JavaScript in modern browsers can be very fast. For example, "The Mozilla platform, which underlies Thunderbird, Firefox and some other web browsers, uses JavaScript to implement the graphical user interface (GUI) of its various products." - http://en.wikipedia.org/wiki/JavaScript

Popa Adrian Marius said...

I found the same with debian generic test but also with my programming experience
We are served with slow and bloated languages (burger king) like
C#,vb.net,java and we are somehow forced by companies stupid rules to work on thouse but in fact if you want fast things you need to code in c++, and pascal on the server side (some might say the real
http://mapopa.blogspot.com/2010/09/why-free-pascal-on-server-side-speed.html

programmers do hex or asm :P)
heck i can run >10 instances of quake engine written in c in the native form implementation in the same time in the browser
so native code rulz for speed and low memory usage (see the pascal low memory footprint compared with java)
http://mapopa.blogspot.com/2010/01/google-nacl-quake-demo.html

so why the heck we are still continue eating burgers ? it's time for a low carb diet , we want real food with good taste and in classy
restaurant with good history
not the fake food and fatness on our bottoms

Daniel Toffetti said...

-"it's time for a low carb diet , we want real food with good taste and in classy restaurant with good history not the fake food and fatness on our bottoms."

My hopes for this to happen are on D language, I really hope it goes mainstream.

LDS said...

Wikipedia is run on MediaWiki which IMHO is a framework. There are some big site using Drupal (i.e. The Economist). Just saying "oh, but they have a lot of hardware" is too simple :) Anyway that could show how much scalabe it is!
Even Delphi uses some ASM and C/C++ code, it cannot compile Windows drivers, thus it is not a general purpose language? And I believe noone thinks about PHP as a "general purpose language".
PHP approach IMHO is correct - use the "scripting language" where it is most useful, and use native compiled code for processing-intensive tasks.

Lars D said...

A good example where php fails, is to calculate statistics. If it gets just a little complicated, all oop mudt be stripped, and if it gets worse, it is just too slow. This is business logic, and not some kind of technicality.

Lars D said...

I see absolutely no reason why we need separate languages for different purposes. C# is close to be suitable for everything, it just needs to get rid of the runtime, the memory management and the Microsoft dependency. And yes, you can make drivers for Linux with Kylix :-) (bash can do that, too)

Lars D said...

Mike, interesting point about "languages that need an IDE". I agree that requiring an IDE reduces the number of people who can use a language, but it also reduces the productivity of those that use the language. I use readability without an IDE as one of the most important source code metrics.

I would not blame the concept of Class libraries, because a class is basically just a collection of code pieces that take the same data as parameter, which is a good concept. Instead, I would blame those people that do not employ usability techniques when designing libraries and languages. The Java way of converting a string to a double is a good example of a usability disaster.

LDS said...

Coding a web app requires at least:
1) Server side language
2) HTML
3) CSS
4) Javascript
5) XML
6) SQL
You can also add Flash and the like, plus the graphics skills because you have no standard GUI.
What's the problem with PHP and C? :D
You can also have issue with Delphi alone, if the defunct Kylix can make Linux driver is totally useless, the problem is Delphi can't produce some Windows executables, and you may need to use C/C++ or assembler as well - how FastMM and the FastCode routines are coded?
You describe a C# that can't exist. Yes, C# would be a great language if it wasn't C#...

Lars D said...

Most teams try to consolidate on fewer languages, and it seems that there is currently a movement towards more advanced client-side technology, than HTML+Javascript. Mobile phones are leading the way because Microsoft stopped innovating their Windows platform - Windows still lacks sandboxing and a market.

C/C++ seems to be useful everywhere - even in HTML pages using Google Native Client. There is no reason why Pascal or other language should not be able to do the same.

Ciprian Khlud said...

Your categories are at best subjective.
Python generates (enough) fast applications where it is used: installers, menu editors in Linux world. I use Mercurial day by day and I never sow it as a slow application.
PHP is provided already in a framework: FaceBook, Wordpress (as your blog is based on it).
At the end: why so much bias against C#/Java? Do VM destroy your impression of performance? Even so, does the performance of VMs should necessarily make your applications slow?
Fast applications I know to date: most of banking, some of air traffic backbone code are today written in Java. They do have close to real-time requirements. You may argue that they need to be "warmed" to get to that speed, but they are fast. Even for client are fast applications, the most known cases are IDEs like: Eclipse (judge its speed on opening big projectcs), IDEA, SharpDevelop. Google development to make you us to use GMail, Calendar, uses a Java based framework (GWT) which is fast combined with todays JIT based JS browsers. Also, well written WPF applications are fast, accelerated, and so on. Froyo on Android is also fast.
At the end, look on JavaScript: is slow for "native" standards, but is really fast enough for an enterprise based application, for an Office like application, and so on.
I can compare a Delphi application: DevC++ that is really slow (on average to big projects, more than 100 classes) than both Eclipse (Java), MonoDevelop. Lazarus starts slower than MonoDevelop and SharpDevelop (on Windows) on my machine.
Do I draw conclusions? Yes: performance of the latter is by design, not by runtime.