The Community for Technology Leaders

Java Script: Designing a Language in 10 Days

Charles Severance, University of Michigan

Pages: pp. 7-8

Abstract—The evolution and use of JavaScript, a language developed in 10 days back in 1995, is really just getting started.

Enter Javascript

Knowing that Java was a rich, complex, compiled language aimed at professional programmers, Netscape and others also wanted a lightweight interpreted language to complement Java. This language would need to appeal to nonprofessional programmers much like Microsoft's Visual Basic and interpretable for easy embedding in webpages. According to Eich,

If I had done classes in JavaScript back in May 1995, I would have been told that it was too much like Java or that JavaScript was competing with Java … I was under marketing orders to make it look like Java but not make it too big for its britches … [it] needed to be a silly little brother language.

Given all these requirements, constraints, and limitations, Eich needed to produce a working prototype on atight schedule that would meet both Sun's needs and the Netscape 2.0 Beta release schedule.

Technical Inspirations

Although the schedule and constraints might have been impossible for most programmers, Eich had a long history of building new programming languages, starting from his experience as a student at the University of Illinois, where he built languages just to experiment in syntax. At Silicon Graphics, he created languages that could be used to build extensions for network monitoring tools.

Clearly, building "yet another" language wasn't the hard part for Eich—the hard part was producing a rich and powerful language while being prohibited from using the object-oriented syntax reserved for Java. He wanted to embed advanced features in JavaScript without using language syntax so the language would initially appear simple and lightweight, yet sophisticated programmers would be able to exploit its underlying power.

Like many other languages, Java-Script took its basic syntax from the C language, including curly braces, semicolons, and reserved words. It was to be a light, friendly version of C with simpler semantics and better dynamic memory characteristics. Because a typical webpage's lifetime lasted from a few seconds to a few minutes, JavaScript could take a very simplified approach to concurrency and memory management.

Eich built a simplified object model that combined structs from the C language, patterns from SmallTalk, and the symmetry between data and code offered by LISP. The Hypercard event model inspired the pattern for adding events to the HTML document. Object-oriented patterns were possible but via runtime semantics with prototypes (as in Self) instead of compiler-supported class syntax (as in Java and C++.

An Overnight Success?

Virtually all successful programming languages need a version 2.0 before they really hit their stride, but we have yet to see—and will likely never see—a JavaScript 2.0. Nothing built in 10 days is perfect, but once something is released into the wild, bugs or imperfections quickly become essential features and are nearly impossible to change. According to Eich, … JavaScript had enough good stuff at the beginning to survive. If you think back to the 1990s, JavaScript was cursed because it was mainly used for annoyances like little scrolling messages in the status bar at the bottom of your browser or flashing images. With JavaScript getting some evolutionary improvements [during the late 1990s] through the [ECMA] standards process, it became fast enough and good enough in 2004 and 2005 to beget the Web 2.0 revolution.

Although the original version of JavaScript might not have been perfect, its initial adoption was for rather simple applications, so it had time to slowly evolve behind the scenes and address its early weaknesses. Moreover, because JavaScript's richness was in its runtime support rather than in its language syntax, improving JavaScript implementations without requiring changes to the syntax of existing JavaScript programs was relatively straightforward.

The Modern Era

JavaScript had been in browsers for almost a decade when the Ajax revolution started, moving JavaScript into the mainstream as an essential part of application development. Microsoft triggered Ajax's domination in Web interfaces by adding the XMLHTTP-Request feature to its Internet Explor-er browser. Other browsers quickly added similar features to allow Java-Script to retrieve data from servers and update the HTML document without requiring a full-page request-response cycle. With this innovation, highly interactive user interface functionality moved into the browser to create increasingly rich desktop-like experiences in applications such as Google Mail and Google Maps.

As the amount of code and data needed for each page increased, it exposed the weaknesses of the JavaScript runtime's browser implementations. Instead of restarting the JavaScript runtime every minute or so, the same webpage would stay in a browser for several minutes with large, dynamic, in-memory data elements and nearly continuous background communication with servers. Google built its own Chrome browser and the V8 JavaScript interpreter to put the browser marketplace on notice that low-performance JavaScript implementations wouldn't be tolerated. The market quickly followed suit and improved JavaScript interpreter performance across the board.

Projects such as Node.js make it possible to use JavaScript as the language for building a Web application's server elements. Because JavaScript has been event-based from the beginning, building highly scalable Web applications using JavaScript without managing the complexities of multithreading becomes quite natural.

As HTML5 emerges, it's entirely possible that JavaScript will soon become a dominant programming language for both mobile and desktop applications. The evolution and use of JavaScript is really just getting started, which is impressive for a language developed in 10 days back in 1995.

To view my interview with Eich, visit /

Computing Conversations, a monthly multimedia-enhanced column, is intended to put a more human face on the technologies we're using in computer science. Future installments will present both full interviews and edited video segments featuring the founders and leaders in our field (

About the Authors

Charles Severance, editor of the Computing Conversations column and Computer's multimedia editor, is a clinical associate professor and teaches in the School of Information at the University of Michigan. Contact him at
55 ms
(Ver 3.x)