Live data from Hacker News

JavaScript is Dead. Long Live JavaScript

peter.michaux.ca

11–20 of 69 posts

Re: JavaScript is Dead. Long Live JavaScript

#11
What happened to the idea of standardising Mono (the open source .NET) bytecode as a new browser language?

Then you can use whatever java-like/basic-like/functional-like language you want, and have it compile to bytecode. Also, with sophisticated JITs for that style of bytecode already lying around, you could probably instantly beat javascript's performance even under the best engines, because of static typing etc. rather than relying on ridiculously complicated static analysis.

It'd have to be supported side-by-side with javascript for the forseeable future, but the earlier you get a change like this in, the better...

Re: JavaScript is Dead. Long Live JavaScript

#12
post #5

I tend to agree that compiling to JavaScript is the future of browser programming. CoffeeScript seems to be a nice language, but I bet there will be many more to come in the next year or two.

I hope someone writes a decompiler for one of these supra-JS languages (not sure if CoffeeScript is Turing-complete) to run against existing Javascript codebases. It could well speed up adoption if a mass-tangle of JS can be boiled down to a more readable and understandable structure.

Re: JavaScript is Dead. Long Live JavaScript

#13
post #12
post #5

I tend to agree that compiling to JavaScript is the future of browser programming. CoffeeScript seems to be a nice language, but I bet there will be many more to come in the next year or two.

I hope someone writes a decompiler for one of these supra-JS languages (not sure if CoffeeScript is Turing-complete) to run against existing Javascript codebases. It could well speed up adoption if a mass-tangle of JS can be boiled down to a more readable and understandable structure.

  > not sure if CoffeeScript is Turing-complete
Wait, why wouldn't it be?

Re: JavaScript is Dead. Long Live JavaScript

#14
post #12
post #5

I tend to agree that compiling to JavaScript is the future of browser programming. CoffeeScript seems to be a nice language, but I bet there will be many more to come in the next year or two.

I hope someone writes a decompiler for one of these supra-JS languages (not sure if CoffeeScript is Turing-complete) to run against existing Javascript codebases. It could well speed up adoption if a mass-tangle of JS can be boiled down to a more readable and understandable structure.

CoffeeScript allows loops no? Therefore it is turing complete (practically).

Re: JavaScript is Dead. Long Live JavaScript

#15
post #9
post #2

Great and thorough article. Here's a TLDR: * Javascript has some warts, and here are some examples. * It's going to take way too long to get these fixed to the point that we can actually start using new versions of Javascript because of slow browser adoption. * To get around this problem, people are treating Javascript as a compilation target for other languages, the most prominent example being CoffeeScript. * Discu…

"It's going to take way too long to get these fixed to the point that we can actually start using new versions of Javascript because of slow browser adoption." Which isn't true, because you could compile newer versions of javascript to older versions. I see languages like coffeescript as interesting experiments in how the language can evolve, but eventually it needs to come back home to javascript and get deployed na…

Seeing how a handful of ideas in CoffeeScript have been rumored to be included in the next JS release, it seems like individual experimental language design might be the way to push for change.

Re: JavaScript is Dead. Long Live JavaScript

#16
post #9
post #2

Great and thorough article. Here's a TLDR: * Javascript has some warts, and here are some examples. * It's going to take way too long to get these fixed to the point that we can actually start using new versions of Javascript because of slow browser adoption. * To get around this problem, people are treating Javascript as a compilation target for other languages, the most prominent example being CoffeeScript. * Discu…

"It's going to take way too long to get these fixed to the point that we can actually start using new versions of Javascript because of slow browser adoption." Which isn't true, because you could compile newer versions of javascript to older versions. I see languages like coffeescript as interesting experiments in how the language can evolve, but eventually it needs to come back home to javascript and get deployed na…

Good point. I hadn't thought of compiling old versions of javascript to new versions - that keeps everyone writing in the same language and seems like a better solution to me.

Re: JavaScript is Dead. Long Live JavaScript

#17
He did mention the GWT Java to Javascript compiler. I have been using GWT (actually SmartGWT) a lot lately because one of my customers uses it. Except for long build times, the GWT Java to Javascript compiler has a lot going for it. Once a project is built and running in test + debugger mode, the client side development experience is pretty good.

Re: JavaScript is Dead. Long Live JavaScript

#18

What happened to the idea of standardising Mono (the open source .NET) bytecode as a new browser language? Then you can use whatever java-like/basic-like/functional-like language you want, and have it compile to bytecode. Also, with sophisticated JITs for that style of bytecode already lying around, you could probably instantly beat javascript's performance even under the best engines, because of static typing etc. r…

1. JavaScript's speed is actually not far from Mono's now. And constantly getting closer.

2. I don't think anyone but Microsoft would support .NET bytecode in the browser, simply because Microsoft controls .NET and has patents on it. It would take a lot more to reassure other browser vendors than Microsoft's existing CPs.

3. Running dynamic languages on Mono is slow. Look at the speed of all the dynamic languages on Mono (or the JVM for that matter), and compare them to native implementations of dynamic languages, in particular JavaScript and Lua. The native implementations beat dynamic languages on Mono by a large margin, simply because .NET is a bytecode made for static languages. Of course you can say that you prefer to have static languages in the browser over dynamic ones, that's a legitimate opinion of course, but not everyone would agree.

4. Standardizing on bytecode can inhibit innovation. JavaScript doesn't have a bytecode standard, which let JS engines implement very different ways of running it (V8 doesn't have a bytecode interpreter at all, for example). Of course standardizing on syntax also inhibits innovation, just in other ways, it isn't clear which is better.

5. Static languages compiled to JavaScript (that is, that use JavaScript as their 'assembly') are getting quite fast. Some benchmarks I ran found them to be around 5X slower (on the development versions of SpiderMonkey and V8) than gcc -O3, compared to Mono which is 2.5X slower, http://syntensity.blogspot.com/2011/06/emscripten-13.html

6. There is already Silverlight/Moonlight which does .NET in browsers, and it hasn't been very successful. (Of course it is a chicken and egg thing, if it were bundled in browsers it might be more popular. But the failure of Silverlight is a disincentive to add Mono to browsers nonetheless.)

For all these reasons, I don't think Mono has much of a chance to be included in browsers. Most of the same arguments apply to other static-language bytecodes like NaCl.

Re: JavaScript is Dead. Long Live JavaScript

#19
post #14
post #12

Earlier quoted context omitted.

I hope someone writes a decompiler for one of these supra-JS languages (not sure if CoffeeScript is Turing-complete) to run against existing Javascript codebases. It could well speed up adoption if a mass-tangle of JS can be boiled down to a more readable and understandable structure.

CoffeeScript allows loops no? Therefore it is turing complete (practically).

Practically you need some desicion making control structure (cond, if) and an emulation of read/write tape (arrays)

Re: JavaScript is Dead. Long Live JavaScript

#20
post #4

He calls inheritance in Javascript a wart. It's one of its major strengths, IMO: the fact that you can directly override methods for a single object. Class inheritance, as he'd like to see, is not all it's cracked up to be. Just look at Java with its anonymous inner classes, for one incredibly ugly construct... BTW an easy way to produce traditional class inheritance in Javascript is to have a single instance from th…

Yeah, javascript's prototypal inheritance is flexible enough to simulate classical inheritance. I wouldn't call that a wart.

http://www.prototypejs.org/learn/class-inheritance

http://dojotoolkit.org/reference-guide/dojo/declare.html

Plus, I tend to prefer prototypal inheritance to classical inheritance. I do agree that the constructor pattern using the new keyword and the prototype object is a bit odd, but that's not the only way to have objects inherit from other objects in javascript.

Post reply on HN