From Botched Coyote, 10 Years ago, written in Plain Text.
This paste is a reply to WTF Python... from Bitty Terrapin - go back
Embed
Viewing differences between WTF Python... and Re: WTF Python...
longneck@mofa ~ $ cat test.py 
print 'start'
for i in range(50 
c
#include <stdio.h>
 
int main()
{
    const int max = 50 
* 1000 * 1000):
    if 1 
1000;
    int i;
    for(i = 0; i < max; i++)
        if(1 
== 1:
        i
print 'end'
1) {
            i;
        }
    return 0;
}
longneck@mofa ~ $ time python test.py 
start
end

time ./test

real    0m4.108s
0m0.220s
user    0m3.576s
0m0.216s
sys     0m0.532s
longneck@mofa ~ $ cat test.coffee 
console.log 'start'
for i in [1..50 * 1000 * 1000]
    if 1 == 1
        i
console.log 'end'
longneck@mofa ~ $ cat test.js 
// Generated by CoffeeScript 1.10.0
(function() {
  var i, j, ref;

  console.log('start');

  for (i = j = 1, ref = 50 * 1000 * 1000; 1 <= ref ? j <= ref : j >= ref; i = 1 <= ref ? ++j : --j) {
    if (1 === 1) {
      i;
    }
  }

  console.log('end');

}).call(this);
000s
longneck@mofa ~ $ time node test.js 
start
end

real    0m0.294s
296s
user    0m0.288s
284s
sys     0m0.008s
020s
longneck@mofa ~ $