was something like:

put 1 into c
repeat for 100000000
  add 2 to c
end repeat

I don't have the c++ source

Very cool- a big applause for Rev. My C++ instincts would tell me, just like your friend, that running that tight of a mathematical loop in an interpreted language might be much more than 7 times slower.


But not in Rev =)!

FWIW, the equivalent C++ would be something like:

int c = 1;
for(int i=0; i<100000000;i++) i += 2;

Of course, the compiler might make a big difference- some compilers may be smart enough to effectively optimize that loop to become the same as:

int c = 1;
i += 200000000;

Speaking of which, has anyone ever considered writing an optimizer for Transcript, that does basic stuff like unrolling loops, killing dead branches, etc? It would probably even be possible to pre-process scripts to make sure they use "repeat for each" when necessary, and other much-discussed optimizations.

- Brian

_______________________________________________
use-revolution mailing list
[EMAIL PROTECTED]
http://lists.runrev.com/mailman/listinfo/use-revolution

Reply via email to