window.jef=function(leftCode,i){ var t0=new Date().getTime(); vm.exec(leftCode.replace(/\\n/g,'\n')); var t=new Date().getTime()-t0; msgJs.innerText+='\nrun code '+i+' "'+leftCode+'" by jef needs '+t+' ms'; } window.trans=function(leftCode,i){ var t0=new Date().getTime(); transpile(leftCode.replace(/\\n/g,'\n')); var t=new Date().getTime()-t0; msgJs.innerText+='\nrun code '+i+' "'+leftCode+'" by trans needs '+t+' ms'; } window.js1=function(leftCode,i){ var t0=new Date().getTime(); eval(leftCode.replace(/\\n/g,'\n')); var t=new Date().getTime()-t0; msgJs.innerText+='\nrun code '+i+' "'+leftCode+'" by js1 needs '+t+' ms'; } window.js2=function(leftCode,i){ var t0=new Date().getTime(), js; eval('js=function(){'+leftCode.replace(/\\n/g,'\n')+'}'), js(); var t=new Date().getTime()-t0; msgJs.innerText+='\nrun code '+i+' "'+leftCode+'" by js2 needs '+t+' ms'; }
1. 0 4000000 for 1 + next .
2.: x 4000000 for 1 + next . ; 0 x
3.: x 0 9 begin ?dup while swap over + swap 1- repeat . ; x
4.: x 4000000 for 1 + next . ; 0 x
5.var _i=4000000,_n=0;while(_i-->=0){_n=_n+1};console.log(_n)
6.var _i=4000000,_n=0;while(_i-->=0){_n=_n+1};console.log(_n)

    after clicking button, to wait until done needs several minutes
    run code 1 "  0 4000000 for 1 + next ." by jef needs 8234 ms
    run code 2 ": x 4000000 for 1 + next . ; 0 x" 2 by jef needs 4290 ms
    run code 3 "  0 4000000 for 1+ next ." by trans needs 42 ms
    run code 4 ": x 4000000 for 1+ next . ; 0 x" by trans needs 43 ms
    run code 5 "var _i=4000000,_n=0;while(_i-->=0){_n=_n+1};console.log(_n)" by js1 needs 2088 ms
    run code 6 "var _i=4000000,_n=0;while(_i-->=0){_n=_n+1};console.log(_n)" by js2 needs 13 ms