On Sun, Feb 15, 2015 at 7:16 AM, Benjamin (Inglor) Gruenbaum <
[email protected]> wrote:

>
> This is something that can be solved at the VM level. VMs perform much
> much smarter optimizations than this already. There is no reason to
> sacrifice code correctness and the principle of least astonishment in order
> to get acceptable performance. Benchmarking against "proof of concept"
> implementations is counter-productive in my opinion. The engines are
> already 'allowed' to use the same object when there is no observable
> difference. Even if we allow this 'optimization' it will take the engines
> as much time to implement it so there is no gain from this anyway.
>
> ______________________________________________
>

Is 60,000 lines of source code a good enough "proof of concept for you"?

I don't see what the problem is.  My transpiler generators the following
ES5 code:

//for (var item in set)

var iter = obj.iterator();
while (1) {
   var ret = obj.next();

   if (ret.done) break;
   var item = ret.value;
   ...loop body
}

It works quite well.  You may be right about the VM vendors, however.  This
requirement basically makes JS useless for anything other than minor
scripting tasks.  The VM people may not have any choice but to optimize it.

Joe
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to