News for hackers. Stuff that matters.
Re:The Elusive Universal Web Bytecode by TazeTSchnitzel on Thursday March 26, 2015 @02:09PM (#9271832)
Uh, JS has numbers, blocking IO, and easy integration.

What are you on about?

Re:The Elusive Universal Web Bytecode by marcosdumay on Thursday March 26, 2015 @04:32PM (#9272858)
JS implement numbers as strings (has bitten me once).

Last time I looked at, there was no blocking IO at all (there is continuation, but it does not solve the problem because there isn't any locking mechanism - yep, I'd like atomic locking at my bytecode too). That's even the main "selling point" Node.js people throw around as if it was a good thing.

By easy integration I mean the hability of using capabilities available at the system, but not exported into the language runtime. It can be solved by something that would let me query the sandbox enviroment for the existence of a "library" that exports foreign functions, and use it. Also, something that by the other side lets me write and distribute one such "library" so people can install them on their browsers let JS use its functionality.

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.

[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.

Re:The Elusive Universal Web Bytecode by DonHopkins on Thursday March 26, 2015 @10:34PM (#9274448)
I think you have JS confused with TCL, the other language that Sun announced was going to be the universal web browser scripting language, right before Java happened.

Remember "The Great TCL War of 1994"?

  Why you should not use Tcl
  Richard Stallman ([email protected])
  Fri, 23 Sep 94 19:14:52 -0400
http://www.vanderburg.org/OldPages/Tcl/war/0000.html
Re:The Elusive Universal Web Bytecode by TazeTSchnitzel on Thursday March 26, 2015 @07:24PM (#9273828)
> JS implement numbers as strings (has bitten me once).

No it doesn't. JS numbers are IEEE754-2008 64-bit double-precision floating point.

> Last time I looked at, there was no blocking IO at all

Huh? It's everywhere. XMLHttpRequests, prompt(), localStorage...

> By easy integration I mean the hability of using capabilities available at the system, but not exported into the language runtime.

Not doable for a sandbox. Sorry.