Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Can we clap the face of skeptics?

by TedYoung (Deacon)
on Apr 22, 2008 at 16:04 UTC ( [id://682205]=note: print w/replies, xml ) Need Help??


in reply to Can we clap the face of skeptics?

There are many questionable statements here, but the one I will address at the moment is the relation you draw between the complexity of the grammar (specifically you speak of "the more operators") the slower the language. That is simply not true.

Operators are nothing more that first class methods (or functions, depending on the paradigm). First class means that they have their own syntax.

The compiler might have to do a little bit more work parsing a complex grammar, but this has little to do with execution speed. For instance, the worst case scenario is Perl5/CGI where the application needs to be compiled for each request served. Even in this environment, perl5 is plenty fast for more needs. Options like modperl and perl6 (which can be compiled) eliminate this overhead.

Regardless, once compiled the number of operators a language supports has nothing to do with runtime performance. All operators (just like all methods) get boiled down to a set of simple instructions. For instance, the Standard Java Library as of version 1.6 has over 4000 public classes (and who knows how many private ones). There may be dozes to hundreds of methods per class. None of this makes Java slow (I wrote a Sudoku solver in high-level java that solved 14-given 17-given sudokus (some of the hardest) in under 500 microseconds each).

Perl is fast because it has 10 years of optimizations behind it. Ruby is not as fast because it simply doesn't. Update: Sorry, that should have been 10 years more. Ruby is about 12 years old, perl is just over 21.

Ted Young

Replies are listed 'Best First'.
Re^2: Can we clap the face of skeptics?
by chromatic (Archbishop) on Apr 22, 2008 at 20:32 UTC
    Perl is fast because it has 10 years of optimizations behind it. Ruby is not as fast because it simply doesn't.

    Ruby is a couple of months older than Java.

      Ruby is a couple of months older than Java.

      Java has a lot more money behind it though.

      I do find it amusing that Perl has gone from being a relatively slow language (when I first started using it about 10 years ago), to a relatively fast one. The relation in question being to the other languages that are commonly used for similar domains.

Re^2: Can we clap the face of skeptics?
by Porculus (Hermit) on Apr 23, 2008 at 18:58 UTC

    I agree with your points, but must correct you on one point of terminology. A "first-class function" (or method) is almost exactly the opposite of one that has its own syntax! First-class functions are functions that can be assigned to variables, passed around as parameters, created or destroyed at runtime, etc.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://682205]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2024-04-19 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found