Live data from Hacker News

Discussing a bytecode standard in browsers

aminutewithbrendan.com

1–10 of 18 posts

Re: Discussing a bytecode standard in browsers

#2
So it comes down to: 1) nobody will agree on a bytecode, 2) bytecode is less flexible than source so it would limit what you can do in the future. It would take versioning and versioning doesn't work.

(2) only seems compelling in light of (1).

Re: Discussing a bytecode standard in browsers

#3
The curious thing about the demand for bytecode in browsers is that there doesn't seem to be a practical reason to do it. Bytecode doesn't seem to bring better performance, as flash doesn't outperform javascript. And web developers don't seem to want to use other languages, given that aside from GWT (almost) nobody cross-compiles from another language. Javascript-to-javascript compilation (closure compiler) is more popular than cross-language compilation.

It's more likely at this point that the server-side world will standardize on javascript than that the browser will gain a method for supporting other languages natively.

Re: Discussing a bytecode standard in browsers

#4
post #3

The curious thing about the demand for bytecode in browsers is that there doesn't seem to be a practical reason to do it. Bytecode doesn't seem to bring better performance, as flash doesn't outperform javascript. And web developers don't seem to want to use other languages, given that aside from GWT (almost) nobody cross-compiles from another language. Javascript-to-javascript compilation (closure compiler) is more p…

Bytecode (or AST, as he points out) ought to be smaller than (minified and compressed) source, so it would download faster. That's a minor benefit, though.

Re: Discussing a bytecode standard in browsers

#5
post #3

The curious thing about the demand for bytecode in browsers is that there doesn't seem to be a practical reason to do it. Bytecode doesn't seem to bring better performance, as flash doesn't outperform javascript. And web developers don't seem to want to use other languages, given that aside from GWT (almost) nobody cross-compiles from another language. Javascript-to-javascript compilation (closure compiler) is more p…

"as flash doesn't outperform JavaScript" does not imply that bytecodes cannot be faster than JavaScript.

Also, at least some people think bytecodes in the browser are worth pursuing (http://nativeclient.googlecode.com/svn/data/site/pnacl.pdf)

I think it will take just one popular app to make that client gain the desktop. It will be harder to take closed systems such as the iPad, but I think Google can pull that off, too (scenario: gmail, YouTube and the Google home page get superior, portable NaCl based user interfaces)

Re: Discussing a bytecode standard in browsers

#6
post #3

The curious thing about the demand for bytecode in browsers is that there doesn't seem to be a practical reason to do it. Bytecode doesn't seem to bring better performance, as flash doesn't outperform javascript. And web developers don't seem to want to use other languages, given that aside from GWT (almost) nobody cross-compiles from another language. Javascript-to-javascript compilation (closure compiler) is more p…

My comment on potential benefits: http://news.ycombinator.com/item?id=1894277

Rest of that thread: http://news.ycombinator.com/item?id=1893686

Re: Discussing a bytecode standard in browsers

#7
post #3

The curious thing about the demand for bytecode in browsers is that there doesn't seem to be a practical reason to do it. Bytecode doesn't seem to bring better performance, as flash doesn't outperform javascript. And web developers don't seem to want to use other languages, given that aside from GWT (almost) nobody cross-compiles from another language. Javascript-to-javascript compilation (closure compiler) is more p…

The problem Javascript-to-javascript compilation and even minification of Javascript is that it makes debugging very difficult. A byte-code with embedded debug information (such as line numbers) would make compilation a much better option. And then you also get minification for free.

There are advantages to using other languages besides JavaScript. Many of things currently being done by libraries and boiler-plate code could be handled by a compiler (e.g. CoffeeScript). And libraries like jQuery might be less necessary if your compiler handled the cross-browser issues.

Re: Discussing a bytecode standard in browsers

#8
post #3

The curious thing about the demand for bytecode in browsers is that there doesn't seem to be a practical reason to do it. Bytecode doesn't seem to bring better performance, as flash doesn't outperform javascript. And web developers don't seem to want to use other languages, given that aside from GWT (almost) nobody cross-compiles from another language. Javascript-to-javascript compilation (closure compiler) is more p…

I think bytecode in the browser would be useful even if we still used it to run pre-compiled JavaScript code that got no speed benefit. Not only would it remove the problem of different browsers having different versions of the language standard, but it would allow the language to evolve without having to wait for every browser to catch up to the standard.

Re: Discussing a bytecode standard in browsers

#9
post #3

The curious thing about the demand for bytecode in browsers is that there doesn't seem to be a practical reason to do it. Bytecode doesn't seem to bring better performance, as flash doesn't outperform javascript. And web developers don't seem to want to use other languages, given that aside from GWT (almost) nobody cross-compiles from another language. Javascript-to-javascript compilation (closure compiler) is more p…

> And web developers don't seem to want to use other languages, given that aside from GWT (almost) nobody cross-compiles from another language.

I've met tons who WANT to use other languages. The reason they don't cross-compile more often is that for the most part cross-compilation sucks - it is impossible to debug through, for one thing. GWT managed to get around most of these issues which is why it's so popular, but it was quite a feat, and it comes at a cost (two seperate runtimes for GWT code which are every so slightly different).

If programming in any other language for the browser was just as easy as javascript, I expect you'd see javascript usage plummet.

Re: Discussing a bytecode standard in browsers

#10
post #8
post #3

The curious thing about the demand for bytecode in browsers is that there doesn't seem to be a practical reason to do it. Bytecode doesn't seem to bring better performance, as flash doesn't outperform javascript. And web developers don't seem to want to use other languages, given that aside from GWT (almost) nobody cross-compiles from another language. Javascript-to-javascript compilation (closure compiler) is more p…

I think bytecode in the browser would be useful even if we still used it to run pre-compiled JavaScript code that got no speed benefit. Not only would it remove the problem of different browsers having different versions of the language standard, but it would allow the language to evolve without having to wait for every browser to catch up to the standard.

Yeah, but all the popular bytecode engines end up being versioned anyway. I don't doubt that bytecode would allow for adding some syntactic sugar without upgrading the browser engine, but so does JS-to-JS compilation, which is available today, even on IE6. And if people really wanted those features, wouldn't there be tons of objective-j programmers?
Post reply on HN