2 ms·
Because it requires some really difficult conversion work under the surface. For example, JS has no concept of integers. To shoe-horn other languages in invol
by Twirrim 13y ago
Because it requires some really difficult conversion work under the surface. For example, JS has no concept of integers. To shoe-horn other languages in involves a lot of extra work, which by nature is going to be less efficient.
Worse, the javascript engine's JIT can't take advantage of some of the semantics of the language being converted, e.g. if the JIT knew for sure that the number was an int, it could take advantage of that in various ways, or make a smarter decision based on the known performance characteristics of the hardware it's running on.