Irfan’s Corner on the Web On Mac, Linux, Grid, Virtualization and Software Technology

28Nov/068

Why C has no place in Computer Science research

I came across this post, which highlights top 5 reasons why a developer should unlearn C. Given the past experience I had with realities of C development I mostly concur with the author.

In the last months I was deeply involved with building a resource broker component for the Grid Operating System project I am involved with. The biggest mistake I made initially was to go along with a C webservices framework, Apache Axis2/C thinking that in an OS level project most of the stuff should be in C due to speed and optimization reasons. This was a decision which cost us months! The original broker itself was developed pretty quickly, perhaps in 2 weeks, and we deveployed it in machines took results everything went fine. Now, when I upgraded the systems to Slackware 11.0, and then ran the broker, nothing will work! It will always segfault as soon as the service was started, I tried 20+ hrs session of debugging fixing the problem but to no avail. I traced the problem to the the framework in which it was built, Axis2/C and contacted a developer to seek some help, but the reply was that the framework was not stable for some platforms now and it will take some months for a stable version to be released. The latest release is Axis2/C 0.95.

Now there were two options, either I wait out till a stable version is released or I code it in another language. I couldn't wait months for it! Computing research is fast moving the ideas I implemented in the broker may be published by someone else by the time I get a stable C webservices framework. So I decided to code the thing in Python, and it has been a blast since! I completed the resource broker implementation in just 3 days, 8 days ahead of schedule. Due to university exams I have not gotten around to take results form it but the productivity gained by dynamic managed languages like Python has been amazing. Such languages would allow me and other members of the research group to code our ideas, implement them, and publish results for all to see. Languages like python if for anything, speed up the pace of Computer Science research.

But dynamic managed languages will never replace C/C++. OS Driver and kernels are written in it, there are some places where it will never be replaced! Python is good for a quick and dirty implementation which can be a prototype, but final products which are to be sold to customers etc. Should be in a compiled form, this is also essential of you have some intellectual property to protect. However in server hosted application, there is no reason not to use such languages.

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Twitter
  • http://www.inerciasensorial.com.br Julio Nobrega

    You can distribute Python coded software without requiring end-users to have Python installed and you can “compile” it to hide its source code.

  • http://irfanhabib.wordpress.com/ irfanhab

    But would the users require to install the python interpreter? If not then that rocks!

  • josh

    “C has no place in computer science”

    Jesus… Are you a zealot, or just plain retarded?

    C is the bedrock that all of our OSes/drivers/system-libraries are built upon. It is the *fast* against-the-hardware code that makes all of this possible. It is *VITAL* element of system design.

    Yes python is user-friendly. I like (and use) it a lot.

    But, there simply is no comparison.

    Higher level languages are great for higher level problems.
    Lower level languages are great for lower level problems.

    Writing a driver in Python is a bad idea.
    Writing a web application in C is equally bad.

    Your assertion that C has no place in computer science is just flat wrong. Look at OS research if you need an example…

  • http://irfanhabib.wordpress.com/ irfanhab

    Now: I have clearly stated in the post that C will never be replaced, like kernels and Os drivers!
    The computer science I’m talking about is “Computer Science Research”, I’m not talking about Computing in general or IT.
    Computer Science Research certainly can be accelerated with dynamic languages. It gives us a “medium of expression” where people can convey their ideas and prepare prototype implementations very quickly

  • http://fetidcascade.com/ Chris

    Check out py2exe. Only good for windows I think, but will bundle all you need into a single exe, so user does not need to install the Python interpreter or anything.

  • http://shuaibkhan.wordpress.com Shuaib

    First off, I must comment, “LOL”.

    I agree with most parts of this article. And btw, am I not the one who had been pushing you into giving Python a try, for the last few months? :) You finally agree now that Python is the best computing tool known to man (well a bit of exageration never hurts).

    The point you got wrong is when you say that Python can’t be used for professional software development, products that are delivered to end users. If you can code it good in Python, why not just do it? Most of the custom software written is actually never released to general public and only the customer for whom the software was coded gets the source. So why not go for Python. As for generic software tools, well, don’t you think “closed source is evil” after all?

    Oh, and btw, I never knew you were already working on the Python implementation of the resource broker. Is it done?

  • Habib

    Remember the day when we were having pizza and you insulted Python? :D Why this sudden change? :P

  • Davy

    well.. just like “josh”’s comment, different prob call for different language.

    “Higher level languages are great for higher level problems.
    Lower level languages are great for lower level problems.”

    e.g. Java was natually build for web, try implement a web application in C.