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.
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.
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 language for web scripting? Could it gain enough momentum to replace Javascript?
Actually, the easiest candidate would be for browsers to start natively supporting Coffeescript. But imagine a "dream team" designing a language just for the web, from scratch: Douglas Crockford, John Resig, Guido van Rossum, Yukihiro Matsumoto...
Is this a "it's crazy but it just might work" scenario, or is it just crazy?
Not crazy at all, especially if is a VM that can host multiple languages. Hm... What would be even more interesting is a VM that can be configured form the server.
1. User opens a page with scripts in LanguageX. The page links to some kind of VM configuration file.
2. Browser loads that file, which enables it to parse LanguageX. Browser caches that file.
3. From now on, the browser can execute scripts in LanguageX.
Although, this particular idea might be the case when too much flexibility would lead to issues in the long run.
His main point: "there are a couple of critical problems with JavaScript that prevents it from ever being a viable alternative as development platform for server application development."
But then he goes on to list things like "Lack of language defined modules and namespaces" (which it has in common with COBOL, C, and PHP), "null vs. undefined" (JS has eight kinds of nothingness — '', false, null, undefined, NaN, 0, [], and {} — as opposed to a usually slightly smaller number, although Python has nine: '', None, [], {}, (), NaN, 0, 0.0, and False), etc.
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.
I'm sure you'll be happy to know that all your gripes are de-griped in js.next (http://wiki.ecmascript.org/doku.php?id=harmony:harmony - and strawman) - and with the speed of browser upgrades they'll hopefully be here the "reasonably close" future. Hopefully.
I'm well aware of js.next/harmony/whateveryouwannacallit. Come back to me in 10 years when it's implemented everywhere and everyone that was on an old version of browser X has upgraded to one with those features.
"Hopefully" indeed -- I had a lot of hope for ECMAScript 4 back in 2007, and look how that turned out.
As with most "next gen" web browser technology (for whatever your 'current gen' may be, back to Netscape 2.0), until I see it actually shipping in a majority of browsers I will remain skeptical.
The author strikes out at the "same language on the server and client" claim, which I think is a bit unfair.
one of the great things about node.js for me is that it is (mostly) js, so I can crank it open and understand what's going on - this is especially true for libraries. I know js pretty well (and most of the syntax hacks), so this is pretty straight forward.
If I try and do the same thing with django or rails, then I find myself investing serious amounts of time just understanding the syntax (the splat operator is a good example).
Using the same language (not necessarily the same environment) that you already know on the server does have genuine benefits, even if you do have to treat it differently.
Javascript is a really lousy language thrown together in two weeks or so.
What ideally should happen is browsers should expose the VM and an entry point for interpreters to use and configure JS on the VM. That way other languages could be used against the VM-in-browser.
I suspect Google is trying to move in this direction, but IDK.
I'm not a fan of CoffeScript, it fixes the wrong problems. It's not the syntax that's the REAL issue, it's the fragmentation, lack of module system, etc.
[+] [-] jerf|14 years ago|reply
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.
[+] [-] maratd|14 years ago|reply
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.
[+] [-] fholm|14 years ago|reply
[+] [-] billybob|14 years ago|reply
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 language for web scripting? Could it gain enough momentum to replace Javascript?
Actually, the easiest candidate would be for browsers to start natively supporting Coffeescript. But imagine a "dream team" designing a language just for the web, from scratch: Douglas Crockford, John Resig, Guido van Rossum, Yukihiro Matsumoto...
Is this a "it's crazy but it just might work" scenario, or is it just crazy?
[+] [-] protomyth|14 years ago|reply
[+] [-] fholm|14 years ago|reply
[+] [-] romaniv|14 years ago|reply
1. User opens a page with scripts in LanguageX. The page links to some kind of VM configuration file. 2. Browser loads that file, which enables it to parse LanguageX. Browser caches that file. 3. From now on, the browser can execute scripts in LanguageX.
Although, this particular idea might be the case when too much flexibility would lead to issues in the long run.
[+] [-] justincormack|14 years ago|reply
[+] [-] kragen|14 years ago|reply
But then he goes on to list things like "Lack of language defined modules and namespaces" (which it has in common with COBOL, C, and PHP), "null vs. undefined" (JS has eight kinds of nothingness — '', false, null, undefined, NaN, 0, [], and {} — as opposed to a usually slightly smaller number, although Python has nine: '', None, [], {}, (), NaN, 0, 0.0, and False), etc.
I think he has failed to prove his point.
[+] [-] BasDirks|14 years ago|reply
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.
[+] [-] Spines11|14 years ago|reply
[+] [-] mrspeaker|14 years ago|reply
[+] [-] fholm|14 years ago|reply
[+] [-] georgemcbay|14 years ago|reply
As with most "next gen" web browser technology (for whatever your 'current gen' may be, back to Netscape 2.0), until I see it actually shipping in a majority of browsers I will remain skeptical.
[+] [-] david_a_r_kemp|14 years ago|reply
[+] [-] pnathan|14 years ago|reply
What ideally should happen is browsers should expose the VM and an entry point for interpreters to use and configure JS on the VM. That way other languages could be used against the VM-in-browser.
I suspect Google is trying to move in this direction, but IDK.
[+] [-] unknown|14 years ago|reply
[deleted]
[+] [-] franze|14 years ago|reply
[+] [-] fholm|14 years ago|reply
[+] [-] MrNibbles|14 years ago|reply
[deleted]