To view parent comment, click here.
To read all comments associated with this story, please click here.
It's called Type Inference and has been part of Firefox since the start of 2012:
https://blog.mozilla.org/blog/2011/12/20/major-javascript-enhancemen...
Its a neat trick, but how far will it get you? How long before you run out of obvious optimizations? How long before you run into the brick wall that is the language itself?
It just doesn't make sense. JS will always be worse off because it performs a lot at run time, that is done at compile time (with much more diligence) in other languages.
There simply isn't a comparison between the performance of a JS JIT compiler and what a good optimizing compiler or even C#'s JIT can do.
It is true that JS has geniuses working behind it (esp. the V8 team) but JS as it stands now isn't ready, and I'm not sure it'll ever even become good enough.





Member since:
2005-09-08
Yes but Java and C# have better defined datastructures. One of the problems with compiling JavaScript is that the central datastructure is essentially a hash-table, which makes it very hard to convert to efficient machine code, though there are several tricks to try anyway and then go back to interpretation if it fails.