Re:The Elusive Universal Web Bytecode
by jdmichal on Thursday March 26, 2015 @05:55PM
(#9273413)
> JS implement numbers as strings (has bitten me once).
What? JS implements all numbers as 64-bit floating point, which happens to be able to perfectly represent the 32-bit integer space. It can actually perfectly represent a 52-bit integer space. See Number.MAX_SAFE_INTEGER [0] for details.
Now, JS does allow for type coercion between values when using the `==` operator. Luckily, the `===` operator also exists which eliminates this effect.
> Last time I looked at, there was no blocking IO at all.
What does blocking even mean in a single-threaded event-pump context? Does it mean other events can be processed while the IO executes? Because that's exactly what an asynchronous AJAX request does. Or does it mean it blocks the only thread available? Because that's what a synchronous AJAX call does.
Now, if your argument is that JS doesn't have an async / await construct in order to make asynchronous AJAX look like synchronous AJAX in the code, then that's in ES7.
What? JS implements all numbers as 64-bit floating point, which happens to be able to perfectly represent the 32-bit integer space. It can actually perfectly represent a 52-bit integer space. See Number.MAX_SAFE_INTEGER [0] for details.
Now, JS does allow for type coercion between values when using the `==` operator. Luckily, the `===` operator also exists which eliminates this effect.
[0] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
> Last time I looked at, there was no blocking IO at all.
What does blocking even mean in a single-threaded event-pump context? Does it mean other events can be processed while the IO executes? Because that's exactly what an asynchronous AJAX request does. Or does it mean it blocks the only thread available? Because that's what a synchronous AJAX call does.
Now, if your argument is that JS doesn't have an async / await construct in order to make asynchronous AJAX look like synchronous AJAX in the code, then that's in ES7.