Live data from Hacker News

My gripes with JavaScript

ironjs.wordpress.com

21–30 of 48 posts

Re: My gripes with JavaScript

#21
The other problem I would see is obvious if you continue with something like the following logic: All successful languages passed through a phase in which they had a broadly similar list of problems. How did they escape from that phase? Because somebody had the power to move the language forward. Somebody (or small set of somebodies) could say "yes" to that idea and "no" to the other idea, and implement them, and have them out for use in a matter of months, gather feedback on the results, and after ten years of repeating that, create a credible platform.

Javascript's root problem is that there is nobody who plays that role. The language has now been around for ~15 years, but it has hardly changed in the meantime. Not zero, I know that, but compared to the advances that any other language made over the same period of its life, Javascript has hardly moved at all. Not since Netscape lost the ability to unilaterally move the language forward by virtue of having the de facto only implementation has the language been able to move much.

So not only does the language have problems, right now, there is no effective path for those problems to be fixed in any reasonable period of time. We know this, because js.next shouldn't be "something we hope to see in a few years" but rather something that should have been done ~2002/2003, if the whole improvement process wasn't so broken.

(BTW, remember to separate "the language" from "the bindings". XMLHTTPRequest was not a Javascript change, for instance, just a new binding that all browsers had.)

Even the standardization process is slow, somewhat disconnected from implementation, and is still essentially focused on fixing syntax problems that have been dangling for a decade now. If js.next somehow successfully manifests in the next few years, we still have a lot of problems in the library department, for instance.

Server-side JS will probably face a decision point at some point in the not-very-near future, where the decision will have to be made as to whether it sticks as close to client-side, browser JS controlled by a effectively-leaderless process running at vanishing fractions of the rate of improvement of any other language, or if it runs off to start creating its own improvements, probably by paving over the cowpaths. I actually favor the latter, because it would create some set of people who can say yea or nay, restore an actual feedback loop, and create progress which could then be propagated back to clients as appropriate.

Re: My gripes with JavaScript

#22
post #4

There seems to be agreement that Javascript is a messy language which is popular by default: it was included in Netscape, then other browsers picked it up. Now we're stuck with it. I realize this would be very difficult and introduce horrible compatibility issues for a while, but sometimes I think, "what if we could start over?" What if Chrome and Firefox started supporting Python or Ruby or a custom, well-designed l…

Chrome's ative code plugin NaCl lets you do this - there is a Tcl implementation using it so far, but no reason why there should not be others.

But NaCl in its current state is limited to a specific platforms, which is a big problem for a web app. Do you know if portable NaCl ever got anywhere?

Re: My gripes with JavaScript

#23
post #21

The other problem I would see is obvious if you continue with something like the following logic: All successful languages passed through a phase in which they had a broadly similar list of problems. How did they escape from that phase? Because somebody had the power to move the language forward. Somebody (or small set of somebodies) could say "yes" to that idea and "no" to the other idea, and implement them, and hav…

Very well put, pretty much agree with it completely.

Re: My gripes with JavaScript

#24
I used to hate JS. In fact, like the over-opinionated teenager I was I wouldn't waste any decent opportunity to make this known to my friends and the rest of the world: "Real hackers use C, Haskell, Python or LISP!1". But then as I started doing design work for web, I inevitably came in contact with JS, and lots of it. And hey, you could actually build stuff with this shit. Then, being as obsessed as I am with aesthetics and thus coding style and best practices, I found out that it's actually possible to write good (looking) programs with JavaScript. Add some CoffeeScript and underscore to the mix, and I could even write them with pleasure.

This touching lifestory isn't meant to convince you that JS is any good, but it should illustrate why/how certain individuals come to join the dark side.

Re: My gripes with JavaScript

#25

Earlier quoted context omitted.

If we started over, we should pick a VM, not a language.

Yes a VM would be nice. Or LLVM + native client, "portable native client", Google is (was?) working on this in Chromium.

LLVM code with access to the DOM would be fine by me. Security would probably take a while to audit.

"The LLVM code representation is designed to be used in three different forms: as an in-memory compiler IR, as an on-disk bitcode representation (suitable for fast loading by a Just-In-Time compiler), and as a human readable assembly language representation. This allows LLVM to provide a powerful intermediate representation for efficient compiler transformations and analysis, while providing a natural means to debug and visualize the transformations. The three different forms of LLVM are all equivalent. This document describes the human readable representation and notation." http://llvm.org/docs/LangRef.html#abstract

Re: My gripes with JavaScript

#26
post #21

The other problem I would see is obvious if you continue with something like the following logic: All successful languages passed through a phase in which they had a broadly similar list of problems. How did they escape from that phase? Because somebody had the power to move the language forward. Somebody (or small set of somebodies) could say "yes" to that idea and "no" to the other idea, and implement them, and hav…

The fact that everything you said is true makes JavaScript an even more amazing language. How many languages could survive 15 years without change and still remain relevant? And not only relevant, but expand their influence?

Certainly this is mostly due to its unique position on the browser, but the language had to be flexible enough to fill that role and more. That's amazing.

Re: My gripes with JavaScript

#27
post #26
post #21

The other problem I would see is obvious if you continue with something like the following logic: All successful languages passed through a phase in which they had a broadly similar list of problems. How did they escape from that phase? Because somebody had the power to move the language forward. Somebody (or small set of somebodies) could say "yes" to that idea and "no" to the other idea, and implement them, and hav…

The fact that everything you said is true makes JavaScript an even more amazing language. How many languages could survive 15 years without change and still remain relevant? And not only relevant, but expand their influence? Certainly this is mostly due to its unique position on the browser, but the language had to be flexible enough to fill that role and more. That's amazing .

I agree, except that "without change" is a bit strong. Still, the basic structure is all there from the beginning, and while warty it has managed to support some non-trivial apps. I'd count it a win overall for the author, in a very tough field.

Re: My gripes with JavaScript

#28

Earlier quoted context omitted.

Yes a VM would be nice. Or LLVM + native client, "portable native client", Google is (was?) working on this in Chromium.

LLVM code with access to the DOM would be fine by me. Security would probably take a while to audit. "The LLVM code representation is designed to be used in three different forms: as an in-memory compiler IR, as an on-disk bitcode representation (suitable for fast loading by a Just-In-Time compiler), and as a human readable assembly language representation. This allows LLVM to provide a powerful intermediate represen…

isn't the sandboxing the entire point of NACL?

Re: My gripes with JavaScript

#29
post #26
post #21

The other problem I would see is obvious if you continue with something like the following logic: All successful languages passed through a phase in which they had a broadly similar list of problems. How did they escape from that phase? Because somebody had the power to move the language forward. Somebody (or small set of somebodies) could say "yes" to that idea and "no" to the other idea, and implement them, and hav…

The fact that everything you said is true makes JavaScript an even more amazing language. How many languages could survive 15 years without change and still remain relevant? And not only relevant, but expand their influence? Certainly this is mostly due to its unique position on the browser, but the language had to be flexible enough to fill that role and more. That's amazing .

IMO, it accomplishes this not as much by being good, as by being a parasite that infects web browsers. At that, it is so good that some people think the DOM and JavaScript are in a symbiotic relationship.

Yes, that is tongue-in-cheek, but without JavaScript, web browsers would have found another language; without web browsers, JavaScript would long have been forgotten.

Re: My gripes with JavaScript

#30
post #4

There seems to be agreement that Javascript is a messy language which is popular by default: it was included in Netscape, then other browsers picked it up. Now we're stuck with it. I realize this would be very difficult and introduce horrible compatibility issues for a while, but sometimes I think, "what if we could start over?" What if Chrome and Firefox started supporting Python or Ruby or a custom, well-designed l…

If we started over, we should pick a VM, not a language.

Producing a truly language-neutral VM would be an interesting goal, one that no-one's really got that close to achieving. (I think Microsoft's got closest.) Making it a compact wire format to boot would be... challenging.

Ultimately, a VM is just another language with lousy readability.

Post reply on HN