[Ilugc] .a-tip-a-day (patch - apply diffs and act as inverse of diff)

  • From: prem@xxxxxxxxxxxxxxxx (Prem Kurian Philip)
  • Date: Wed Sep 30 18:52:52 2009

From: steve <steve@xxxxxxxxxxxx>

If you *really* want to go that way and do a 'relevant' one-to-one
comparison, you have to include the number of syscalls being made by
gcc >>when compiling your code to binary ...which is essentially what
the perl >>interpreter is doing for  you for 'free'.

the C programs does the same job with 23 system calls
*plus* the number of syscalls it would take for gcc to convert text to
executable code, which is what perl does on your behalf. So, comparing
number of syscalls of the final executable is not a valid measure of
appropriateness of a langauage.

How do you think the python/perl/whatever-interpreted-language works? The
interpreter first reads in the script, parses the code, checks for errors,
compiles it down to byte-code etc and then starts executing the statements
line by line. How is this "free"?

A compiler is required to create the machine code just once - while an
interpreter will need to do this every time a script is done - unless you
are using pre-compilation.

Ultimately, yes, it does come down to the number of instructions which are
executed by a platform for performing a single function. No one in their
right mind will argue that a program written in C wouldn't be faster than
the equivalent program written in any other high level language - unless
the algorithm was implemented poorly.

And yes, the platform you use to run your app on has a pretty drastic
impact on cost - the cost of software, the servers, electricity etc all
add up if you are going to be adding servers.

From: Kenneth Gonsalves <lawgon@xxxxxxxxxxxxxxx>

for that matter facebook handles more than that a day - so does youtube -
they use python servers. I believe that they are getting bang for their
buck. As are google, yahoo, livejournal ... none of them use C. As some
one remarked, programmer's time is more expensive than memory, servers,
RAM and bandwidth.

Having developed some large enterprise banking apps in python - this is my
feedback.

There is a significant performance penalty in using python or for that
matter any of the other *trendy* languages these days - ruby, groovy,
jruby etc. Scala, on the other hand, is pretty fast (almost as fast as
java on the jvm) but I find it pretty difficult to learn.

And whatever one may say about java, I can verify that java is much
quicker than python, php, groovy, ruby and jruby. And now with really
simple frameworks (see Click for java), java development doesn't take much
more time than python development.

Just look at the performance difference between the different languages -
it is pretty astounding.
http://blog.dhananjaynene.com/2008/07/performance-comparison-c-java-python-ruby-jython-jruby-groovy/

I am guessing that Youtube, Facebook etc would have saved a lot of money
on infrastructure and incurred a minor increase in development cost if
they had used java rather than python.

About developing in C/C++ - the vast majority of desktop apps are still
written in C/C++ due to the vast difference in performance between C/C++
and interpreted languages.

The reason C/C++ isn't heavily used on the web is because:

1) There aren't that many good frameworks for web development using C/C++.

2) Memory management is complex (when compared to interpreted languages).
So it requires a more skilled developer. Skilled C/C++ developers aren't
that easy to find.

3. .NET/Mono is pretty fast though not as fast as C++. And since this
platform has garbage collection etc, it is far easier to develop in than
C/C++. So it is a reasonable tradeoff.

If you are interested in web development using C++, try this framework:
http://www.webtoolkit.eu/wt#/

Regards,
Prem





Other related posts: