News for hackers. Stuff that matters.
Re:Discussing a bytecode standard in browsers by Joeri on Tuesday November 23, 2010 @02:12PM (#1934969)
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 by Someone on Tuesday November 23, 2010 @02:46PM (#1935070)
"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 by lukev on Tuesday November 23, 2010 @03:45PM (#1935282)
> 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 by protomyth on Tuesday November 23, 2010 @04:51PM (#1935522)
To add, I get the feeling that a standard byte code would create a huge number of compilers specifically so people could use the same language they are using on the server for client work. I would also expect a VM running the byte code to migrate back to the servers.
Re:Discussing a bytecode standard in browsers by stcredzero on Wednesday November 24, 2010 @05:19AM (#1936982)
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.

So, is the issue really the ability to use source debugging? We could still treat Javascript as an Intermediate Language and add a Source Pointer data format that would enable source debuggers in the cross-compiled languages.

In fact, we could build such things into Firefox and Chromium ourselves!

Re:Discussing a bytecode standard in browsers by Joeri on Saturday November 27, 2010 @10:37AM (#1945114)
My point exactly. The demand for other languages is clearly not big enough for people to have hacker together an implementation of it on top of what's there today. It can be done, it's just that very few people are busy doing it.
Re:Discussing a bytecode standard in browsers by wvenable on Tuesday November 23, 2010 @03:10PM (#1935153)
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 by j_baker on Tuesday November 23, 2010 @03:16PM (#1935176)
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 by Joeri on Tuesday November 23, 2010 @03:58PM (#1935333)
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?
Re:Discussing a bytecode standard in browsers by chc on Tuesday November 23, 2010 @06:27PM (#1935813)
No, because Objective-J essentially just adds Objective-C syntax on top of JavaScript — but most people don't particularly love the syntax of Objective-C. You look at one language's lack of popularity and extrapolate that people just must not like languages.
Re:Discussing a bytecode standard in browsers by Joeri on Saturday November 27, 2010 @10:44AM (#1945127)
First of all, a lot more people like that syntax than you make it out to be. It's popular enough that objective-j should have caught on. The fact that it didn't is telling.

Secondly, I was only using it as an example. I base my opinion on the lack of popularity of all cross-compilation engines except GWT. There's two ways of looking at that. One is that GWT proves the demand for other languages because of its success. The other is that GWT proves the demand for other languages is not that big, because otherwise those other languages would have GWT-like platforms in the field already. I'm partial to the latter.

Re:Discussing a bytecode standard in browsers by wmf on Tuesday November 23, 2010 @02:43PM (#1935062)
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 by jbjohns on Tuesday November 23, 2010 @04:03PM (#1935346)
>The curious thing about the demand for bytecode in browsers is that there doesn't seem to be a practical reason to do it.

Really? Javascript is an opinionated high level language. I wonder how many people using Javascript these days actually write it. Personally I haven't bothered to learn Javascript, I just use libraries in my preferred languages to generate it. This works fine for me so long as I don't have to debug it...

Re:Discussing a bytecode standard in browsers by scott_s on Tuesday November 23, 2010 @02:57PM (#1935099)
Re:Discussing a bytecode standard in browsers by jimmyjazz14 on Tuesday November 23, 2010 @11:26PM (#1936496)
I would much prefer to be able to use another language in the browser, if languages are tools then programmers developing for browsers only currently have one tool available to them (unless you count html and css) which I see as a pretty major stumbling block towards new innovations.