The A-Z of Programming Languages: JavaScript

Brendan Eich created JavaScript in 1995 with the aim to provide a "glue language" for Web designers and part time programmers. It has grown to become one of the most widely used languages on the planet.

Have you ever seen the language used in a way that was not originally intended? If so, what was it? And did it or didn't it work?

The Java VM (Orto) mentioned above is one example. I did not intend JS to be a "target" language for compilers such as Google Web Toolkit (GWT) or (before GWT) HaXe and similar such code generators, which take a different source language and produce JS as the "object" or "target" executable language.

The code generator approach uses JS as a "safe" mid-level intermediate language between a high-level source language written on the server side, and the optimized C or C++ code in the browser that implements JS. This stresses different performance paths in the JS engine code, and potentially causes people to push for features in the Ecma standard that are not appropriate for most human coders.

JS code generation by compilers and runtimes that use a different source language does seem to be "working", in the sense that JS performance is good enough and getting better, and everyone wants to maximize "reach" by targeting JS in the browser. But most JS is hand-coded, and I expect it will remain so for a long time.

It seems that many cross-site scripting exploits involve JavaScript. How do you feel about this? Are there plans to solve some of these problems?

Yes, we have plans to address these, both through the standards bodies including the W3C, and through content restrictions that Web developers can impose at a fine grain. See the document:

and the Mozilla bug tracking work to implement these restrictions:

When do you expect the next version of JavaScript to be released? Do you have in mind any improvements that will be incorporated?

I expect the 3.1 edition of the ECMA-262 standard will be done by the middle of 2009, and I hope that a harmonized 4th edition will follow within a year. It's more important to me (and I believe to almost everyone on the committee) that new editions of the specification be proven by multiple interoperating prototype implementations, than the specs be rushed to de-jure approval by a certain date. But the 3.1 effort seems achievable in the near term, and a harmonized major 4th edition should be achievable as a compatible successor in a year or two.

The improvements in the 3.1 effort focus on bug fixes, de-facto standards developed in engines such as SpiderMonkey (e.g. getters and setters) and reverse-engineered in other browsers, and affordances for defining objects and properties with greater integrity (objects that can't be extended, properties that can't be overwritten, etc.).

The improvements for the harmonized major edition following 3.1 simply build on the 3.1 additions and focus on usability (including new syntax), modularity, further integrity features, and in general, solutions to "programming in the large" problems in the current language.

Join the newsletter!


Sign up to gain exclusive access to email subscriptions, event invitations, competitions, giveaways, and much more.

Membership is free, and your security and privacy remain protected. View our privacy policy before signing up.

Error: Please check your email address.

Tags a-z of programming languages

More about AppleBillBorland AustraliaGoogleMicrosoftMozillaW3C

Show Comments