4 ms·
> JavaScript code is some of the fastest interpreted code around, and projects like asm.js take that even farther. That says something about market forces, but
by munificent 14y ago
> JavaScript code is some of the fastest interpreted code around, and projects like asm.js take that even farther.
That says something about market forces, but nothing about the language. JavaScript is the fastest dynamic language because it was the language that was most profitable to optimize.
We don't have any real-world comparisons to other languages where an equal amount of brainpower was spent on optimization so that we could see how the language itself affects things.
- derefr 14y ago> We don't have any real-world comparisons to other languages where an equal amount of brainpower was spent on optimization so that we could see how the language itself affects things. Yes we do: Lua--optimized by lots of big brains for use in gaming. And it turns out that LuaJIT is much faster than any current Javascript JIT--with the reason frequently given that it is a much simpler language.
- lucian1900 14y agoAlso PyPy, which is generally about as fast as v8 on benchmarks.
- ksec 14y agoNot really.. https://attractivechaos.wordpress.com/2013/04/06/performance-of-rust-and-dart-in-sudoku-solving/ https://attractivechaos.wordpress.com/2013/04/06/performance...
- simonster 14y agoBy "lots of big brains," I think you mean Mike Pall :). But yeah, LuaJIT is really fast. Julia (http://julialang.org/ http://julialang.org/) is another dynamic language designed from the start for high performance, although the objectives are slightly different from those of Lua. While LuaJIT is fast at everything, Julia is really optimized so that running the same code many times is fast. Running a function the first time can be much slower than in other dynamic languages, I think because there is no baseline JIT or interpreter.
- kzrdude 14y agoMy impression would be that * LuaJIT is comparable to the best javascript engines in performance * LuaJIT is entirely the work of one person. Lua is well designed and values simplicity, which has lent itself well to Pall's success.
- nnethercote 14y agoAnd Mike Pall is a superhero when it comes to writing JIT compilers.
- Shamharoth 14y agoAnd also because it isn't a shitty language, like js.