8 ms·
> we're just now starting to get to a point where developers are leveraging its power and dynamism in its own right It's damning that you say it took 20 years
by dietrichepp 12y ago
> we're just now starting to get to a point where developers are leveraging its power and dynamism in its own right
It's damning that you say it took 20 years for us to "start" to leverage JavaScript's power. Compare to C#, which appeared 15 years ago, or Go which is from 2009, or Swift, which hasn't even celebrated its first birthday yet.
Better comparisons might be Python and Ruby, which are both fully dynamic and have cool metaprogramming facilities like JavaScript does, but they'll both give you hard errors when you type the equivalent of [].lenght. And they give you proper stack traces and error messages, too: none of "undefined is not a function" which took until 2015 to get fixed in Chrome (try it). Working with Node.js will make you fall into despair when you realize that your program crashes, and it has stack traces, but none of the stack frames are in your code because everything has been threaded through callbacks. Python's major implementation has serious problems with concurrency (re: the GIL, global interpreter lock) and it too has dynamic types everywhere but it's still far easier to work with.
What I want is to be able to refactor a JavaScript project without feeling like I'm crossing the river Styx. Where are the call sites for this function... who knows? TypeScript seems to at least give me some of those tools, it's a shame that the tooling isn't really ready--the compiler takes ages to run (timed it at 2.0 seconds on a small project... I might as well be using C++ at those speeds).
And if Google has been using TypeScript as a basis, as they say, then you can keep using JavaScript the way you want and you don't even have to type anything in differently. Just let us add some type checking if we want it.
- BrendanEich 12y agoBefore TypeScript (fall 2012), Zef Hemel then at c9.io did static analysis for JS IDE diagnostics (mid-2012?), Dmitry Vardoulakis then grad-student-interning at Mozilla Research did DoctorJS (spring 2010, I think). And don't forget the Closure compiler from Google, but I'm not sure when that really got serious about static analysis -- perhaps after Google hired Dmitry. So no more than 15 years, not 20. ;-) What's damning is the stagnation under the IE (convicted in the US) monopoly from late '90s through 2009 when ES5 was published. It's not as if Python 1.3 or whatever, if frozen in Netscape 2 amber, would have fared better if forked.
- dietrichepp 12y agoMy comment about 20 years was in response to a quote from the parent comment. But yes, that's a very good point. Very few languages have ever come out of the gate close to the mark. Early C# and Java were painful without closures, iterators, function pointers, or good performance. Which is why I'm glad to see things like TypeScript, Closure, and ES6, Traceur, etc. (and I'm less excited about Coffeescript and Dart). It's especially a good sign that Google is using TypeScript as a basis because it means we might not get siloed implementations and communities.
- lmm 12y ago> It's not as if Python 1.3 or whatever, if frozen in Netscape 2 amber, would have fared better if forked. Disagree. Python 1.3 was at least designed as a general-purpose programming language, with a variety of use cases, and took the best parts of existing languages (TCL and Perl) rather than having novel features that sorta-but-not-quite replace more conventional ones. It had its share of warts but nothing in Python 1.3 is as awkward as prototypal inheritance or javascript's scoping. IMO the biggest tragedy is Mozilla's unwillingness to put other languages in the browser. Dart was developed in public, far more of an open standard than the original JS, fixed language design problems that ES6 still isn't addressing, had an adequate approach to running in JS-only browsers, and would have added much less complexity to browser implementation (the reason given for rejection) than many standards that Mozilla has been happy to support.
- amyjess 12y ago> IMO the biggest tragedy is Mozilla's unwillingness to put other languages in the browser. Dart was developed in public, far more of an open standard than the original JS, fixed language design problems that ES6 still isn't addressing, had an adequate approach to running in JS-only browsers, and would have added much less complexity to browser implementation (the reason given for rejection) than many standards that Mozilla has been happy to support. It's also Google's failure to exploit their market position. Instead of using Dartium, they should've just integrated the Dart VM into mainline Chrome and began paying web developers to use Dart. Mozilla would then have no choice but to implement Dart or find their users complaining about not being able to access their favorite websites. On a similar note, it's kind of a shame that IE's support for VBScript never took off. Not because VBScript was a good language, but because it would've laid down a precedent for the web being a multi-language environment. Browser vendors would have developed pluggable scripting architectures to compete. Imagine if, say, every browser on Windows could have allow scripts written in, for example, everything offered by Windows Script Host (and I'm sure some equivalent architecture would have been developed for Mac and Linux -- maybe even something as simple as "any script that can be interpreted via a shebang line").
- wwweston 12y ago> It's damning that you say it took 20 years for us to "start" to leverage JavaScript's power. If that's true, then Lisp is surely triply damned, as it's older than 60 and it's safe to say that most working programmers in the industry don't know how to leverage its power. Or, since you brought up Ruby, the industry by and large didn't care about its existence for roughly the first decade of its life, though I suppose that's only half-damned. One might reasonably conclude that what a language has to offer is only tenuously connected to whether a critical mass of industrial programmers knows how to work in it and take advantage of everything it has. > Compare to C#, which appeared 15 years ago, or Go which is from 2009, or Swift, which hasn't even celebrated its first birthday yet. Since a comparison has been invited: - C# is an iteration of an iteration of an already industry accepted paradigm (and the first iteration's uptake is considerably more impressive). - Go is more or less the same thing, except they took out a lot of industry accepted paradigms (and enough people are actually complaining loudly about some of the removed bits that I think Go's uptake is going to plateau more quickly). - Swift is a super interesting case and maybe the best comparison to JS of all of these -- familiar syntax but with enough differences that are going to be unfamiliar that some developers would probably freak out and resist... if its only real competition weren't Objective C (so of course it's doing well :b) and its target market weren't already familiar with the underlying Cocoa libraries (which are almost 30 now). - C# and Swift were both released by deeply entrenched market-bendingly powerful industry patrons who were decades old (this shoe nearly fits golang, too). By contrast, JavaScript was released by a company barely a year old in an emerging market. A partner (another decades old entrenched player) of the neophyte company wanted the language nerfed and positioned as a toy, and got some of what it wanted. It was created very quickly. Within a year or two of release, tens of thousands of amateurs and professionals were doing something with it, most without having ever bothered to learn the specifics of the language at all. Within five years, thousands were actually doing reasonably complex applications with it. At about 10 years (right around the age Rails mania starts to hit the industry, right?) is when some significant portion of the industry starts to take notice that things like Google Maps can be built and (some) people start to consider that maybe if they actually took the time to learn the language and platform, they could do neat things too.... I'd say JavaScript fares pretty well by a number of standards for comparison. Not to say it couldn't be improved; it is being improved. Better error messages and stack traces are great ideas, type hinting could work out too.
- Ciantic 12y agoYou might be interested to know that Python too is going towards gradual typing, with PEP 484 https://www.python.org/dev/peps/pep-0484/ https://www.python.org/dev/peps/pep-0484/ it's trying to formalize the syntax from MyPy. I think it will happen since in September at the Python mailing list the Guido found a slew of bugs when using MyPy and started to advocate gradual typing.
- pjmlp 12y agoUau! 2s is considered ages to run?!