in reply to new DLL compile code inside script languages

perl -e "$sum += $_ for (1 .. 100000000); print $sum;"
took about 26 seconds on my Windows XP Pro with an Intel Pentium 1.7 Ghz processor.

Fast enough for me and it took me like 10 seconds to write this code. I see no benefit to code it in PDL or call arcane functions in a DLL: that would have taken me much much longer.

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Replies are listed 'Best First'.
Re^2: new DLL compile code inside script languages
by Jorge_de_Burgos (Beadle) on Jul 05, 2009 at 14:04 UTC
    Of course in Linux you want to change those double " to single ': perl -e '$sum += $_ for (1 .. 100000000); print $sum;'