in reply to Perl vs. Compilable Language

Unless you are making a production system, application, or library that will be run many, many times, programmer productivity is probably more important than code efficiency.

A point that hasn't been brought up here yet is that it also depends on how high-level your algorithms are. If you are working with an executable grammar, multilevel hashes, elaborate RegEx expressions, or other such abstractions, you're almost certainly better off letting the language do the work.

The only languages which may have a real performance benefit over Perl are C and C++, but you have to be careful there because C++ efficiency requires a lot of implementation understanding that's deeper than most programmers care to go. Likewise, C pointer usage can blow Perl away... IF it works. Once again, the higher the level of abstraction, the less advantage C++ or C will have.

Raw compiled C is almost certainly fastest... but how much time are you willing to devote to building your own libraries? Handling your own memory management? Parsing strings? Porting code to another architecture?

Replies are listed 'Best First'.
Re^2: Perl vs. Compilable Language
by cog (Parson) on May 02, 2005 at 13:04 UTC
    Unless you are making a production system, application, or library that will be run many, many times, programmer productivity is probably more important than code efficiency.

    The fact that it will run many times doesn't mean efficiency is the biggest of concerns.

    I've seen a guy who did that kind of systems saying that efficiency didn't matter for him; what mattered was that things worked.

    If your system running is going to slow down others, or delay something, *then* you have to worry about efficiency.

    That, of course, for certain values of efficiency :-)

    YMMV, of course :-)

      And then, of course, we have to look at what kind of efficiency... cpu cycles, latency, memory usage, etc. You're absolutely correct in that raw cpu cycles are rarely the best optimization. In fact, on a multiuser system, a background task run through cron is often better implemented in samll chunks, i.e. shell script or Perl w/ system calls, just so the scheduler gets more chances to take back control to give to another user process. Woefully "inefficient" but far better for the health of the system.
Re^2: Perl vs. Compilable Language
by Anonymous Monk on May 02, 2005 at 16:01 UTC
    Unless you are making a production system, application, or library that will be run many, many times, programmer productivity is probably more important than code efficiency.
    It depends on the situation. Sometimes, timely response is far, far more important than programmer productivity, even if the program is run only once. Deployment of a satellite, for instance. Or a demo for a new customer.