> >For-Next is interpreted when executed. It is
at that point that the
> >relevant machine language instructions are generated and executed. Machine
> >language is low-level, C is slightly higher, BASIC is definitely
> >high-level
> And Perl is some of most of these - at times
faster than C, yet sometimes
> simpler than Basic, almost as powerful as APL, and runs on more machines
> than Java! (of course, APL runs on more machines than Java...)
Now, how can Perl be faster than C when it's
written in C?
Simple - lets assume you want to keep a list of key/value pairs.
you could do it simple in an unordered list of strings, add new
keys to the end and use linear search, or more sophisticated, sort
this list insert new key at the aprobiate place and search by halving
the index - or, againe better, use a B-tree structure and shorten
insert time (while adding maybe search time). Now, honest, if this
list you need is only a tool for some temporary data, would you build
up anything else than the linear list ? No, since you want to ro the
actual task (like the picture ting) instead, so your programm will be
slower when searching for a key than the same algorythm written in
PERL, where the more sophisticated funcion is alread build in and
optimized.
Gruss
H.
(I like PERL, but I never did any single programm with more than 150
lines (two maybe 3 screen pages), including comments and beautifying
empty lines - if I need more, I prefer a real language, like Assembler :)
--
Ich denke, also bin ich, also gut
HRK