3 ms·
Javascript does have it easier by virtue of being single threaded, with no overloading and with a single numeric type. In the python version of this loop:
by beagle3 10y ago
Javascript does have it easier by virtue of being single threaded, with no overloading and with a single numeric type. In the python version of this loop:
for x in range(1000):
sum = sum + math.sin(x)
The global "math" and "math.sin" can be changed by another thread at any point. Javascript guarantees that this cannot happen.
Also, what constructs of Javascript are more dynamic than python? I can only think of "eval" and "with", both of which the JavaScript JIT decline to compile and interpret instead.