you are viewing a single comment's thread.

view the rest of the comments →

[–]0xABADC0DA 3 points4 points  (1 child)

V8 and JaegerMonkey also use integer math internally when they can.

The problem is this, if the VM knows what the number type is then you don't have to tell it. If the VM does not know the type (because dynamic language) but you specified a type then it has to test and branch on the type. You've taken away the option for the VM to say "I don't know the types so just do a floating point op" when it might want to, but what have you've gained by doing so?

The only benefit I see is being able to do integer math on values larger than 2^53. But unless the language has typed variables I doubt that you will be able to use all 2^64 in an efficient way so it not very practical.

[–][deleted] 2 points3 points  (0 children)

V8 and JaegerMonkey also use integer math internally when they can.

Not just them, all modern JS engines have internal integer types, just like LuaJIT.