History of the JavaScript


JavaScript was born because of the Internet, followed by the advent of browsers. To review its history, we must start with the history of the browser.

At the end of 1990, CERN scientist Tim Berners-Lee invented the World Wide Web on the basis of the world's largest computer network-the Internet. From then on, you can browse web files on the Internet. The earliest web pages can only be viewed in the terminal of the operating system, that is to say, only the command line can be used. The web pages are displayed in a character window, which is of course very inconvenient.

At the end of 1992, the National Center for Supercomputer Applications (NCSA) began to develop an independent browser called Mosaic. This is the first browser in the history of mankind. From then on, the web page can be browsed in the window of the graphical interface.

In October 1994, a major NCSA programmer Marc Andreessen and venture capitalist Jim Clark established Mosaic Communications (Mosaic Communications), which soon changed its name to Netscape. The direction of this company is to develop a new generation of browser Netscape Navigator for ordinary users on the basis of Mosaic.

In December 1994, Navigator released version 1.0, with a market share of over 90% in one fell swoop.

Netscape quickly discovered that the Navigator browser needed a scripting language that could be embedded in web pages to control browser behavior. At that time, the Internet speed was very slow and the Internet fee was very expensive, and some operations should not be done on the server side. For example, if the user forgets to fill in the "user name" and clicks the "send" button, it is a bit too late to find this on the server. It is best to tell the user "please fill in the user name" before the user sends the data. This requires embedding a small program in the web page, allowing the browser to check whether each column is filled in.

The management's vision for this browser scripting language is: the function does not need to be too strong, the syntax is relatively simple, and it is easy to learn and deploy. That year coincided with the advent of Sun's Java language, and the marketing activities were very successful. Netscape decided to cooperate with Sun, the browser supports embedded Java applet (later called Java applet). However, there is controversy over whether or not to use Java as the browser scripting language. Later, I decided not to use Java because the web applet does not require the "heavy" syntax of Java. However, it is also decided that the syntax of the scripting language should be close to Java and can support Java programs. These ideas directly preclude the use of existing languages ​​such as Perl, Python, and TCL.

In 1995, Netscape hired programmer Brendan Eich to develop this web scripting language. Brendan Eich has a strong background in functional programming and hopes to implement this new language based on the Scheme language (a dialect of the LISP language, the originator of the functional language).

In May 1995, Brendan Eich designed and completed the first version of this language in only 10 days. It is a hodgepodge, with multiple sources of grammar.

-Basic syntax: draw lessons from C language and Java language. -Data structure: Drawing lessons from the Java language, including dividing values ​​into primitive values ​​and objects. -Usage of functions: Learn from Scheme language and Awk language, treat functions as first-class citizens, and introduce closures. -Prototype inheritance model: borrowing from the Self language (a variant of Smalltalk). -Regular expression: Borrowing from Perl language. -String and array processing: learn from Python language.

In order to keep it simple, this scripting language lacks some key features, such as block-level scope, modules, subtyping, etc., but you can use existing features to find solutions. This lack of functionality directly led to a significant feature of JavaScript later: for other languages, you need to learn various functions of the language, and for JavaScript, you often need to learn various problem-solving modes. And because of the diverse sources, it was destined from the beginning that the programming style of JavaScript is a mixture of functional programming and object-oriented programming.

Netscape's browser scripting language, originally named Mocha, was changed to LiveScript in September 1995. In December, Netscape and Sun (the inventor and owner of the Java language) reached an agreement to allow the language to be called JavaScript. In this way, Netscape can take advantage of the momentum of the Java language, while Sun has extended its influence to the browser.

The reason for this name is not because of how deep the relationship between JavaScript itself and the Java language is (in fact, the relationship between the two is not deep, see the next section for details), but because Netscape has decided to use the Java language to develop network applications Program, JavaScript can be like glue, connect various parts together. Of course, the later history is that the browser plug-in of the Java language failed, and JavaScript flourished instead.

On December 4, 1995, Netscape and Sun jointly released the JavaScript language, publicizing that JavaScript is a supplement to Java and is a lightweight Java designed to operate web pages.

In March 1996, Navigator 2.0 browser officially built-in JavaScript scripting language.

The relationship between JavaScript and Java

Here specifically talk about the relationship between JavaScript and Java. They are two different languages, but they are related to each other.

The basic syntax and object system of JavaScript is designed to imitate Java. However, JavaScript does not adopt Java's static typing. It is precisely because of the great similarity between JavaScript and Java that this language was renamed JavaScript from the beginning of LiveScript. Basically, the original meaning of the name JavaScript is "a scripting language much like Java".

The function of the JavaScript language is an independent data type and adopts an inheritance chain based on the prototype object (prototype). These are the two biggest differences between it and Java syntax. JavaScript syntax is much more free than Java.

In addition, the Java language needs to be compiled, while the JavaScript language is directly executed by the interpreter at runtime.

In short, the original design goal of JavaScript is a small, simple and dynamic language that has enough similarity with Java so that users (especially Java programmers) can quickly get started.

The relationship between JavaScript and ECMAScript

In August 1996, Microsoft imitated JavaScript and developed a similar language, named JScript (JavaScript is a registered trademark of Netscape, and Microsoft cannot use it), which was first built into IE 3.0. Netscape is facing the situation of losing its dominance of the browser scripting language.

In November 1996, Netscape decided to submit JavaScript to ECMA (European Computer Manufacturers Association), an international organization for standardization, hoping that JavaScript could become an international standard and resist Microsoft. ECMA's Technical Committee 39 (Technical Committee 39) is responsible for formulating and reviewing this standard. Its members are composed of engineers sent by major companies in the industry. There are currently 25 people in total. The committee meets regularly, and all e-mail discussions and meeting minutes are public.

In July 1997, the ECMA organization issued the first edition of standard document No. 262 (ECMA-262), which stipulated the standard for browser scripting language, and called this language ECMAScript. This version is ECMAScript version 1.0. The reason why it is not called JavaScript is due to trademarks. Java is a trademark of Sun. According to a license agreement, only Netscape can legally use the name JavaScript, and JavaScript has been registered as a trademark by Netscape. On the other hand, On the other hand, I want to reflect that the creator of this language is ECMA, not Netscape, which helps to ensure the openness and neutrality of this language. Therefore, the relationship between ECMAScript and JavaScript is that the former is the specification of the latter, and the latter is an implementation of the former. In everyday situations, these two words are interchangeable.

ECMAScript is only used to standardize the basic grammatical structure of the JavaScript language. The standards related to the deployment environment are stipulated by other standards. For example, the DOM standard is formulated by the W3C organization (World Wide Web Consortium).

The ECMA-262 standard was later approved by another International Organization for Standardization (ISO), and the standard number is ISO-16262.

JavaScript version

In July 1997, ECMAScript 1.0 was released.

In June 1998, ECMAScript version 2.0 was released.

In December 1999, ECMAScript version 3.0 was released, which became the prevailing standard for JavaScript and was widely supported.

In October 2007, the draft version of ECMAScript 4.0 was released, which greatly upgraded version 3.0. The official version is expected to be released in August of the following year. After the release of the draft, due to the aggressive goals of version 4.0, there were serious disagreements on whether to pass this standard. Big companies, headed by Yahoo, Microsoft, and Google, oppose the significant upgrade of JavaScript and advocate minor changes; Mozilla, headed by JavaScript creator Brendan Eich, insists on the current draft.

In July 2008, due to the fact that the parties had too much disagreement on what features should be included in the next version, and the debate was too radical, ECMA decided to suspend the development of ECMAScript 4.0 (that is, to abolish this version), and it will involve the improvement of existing functions. A small part was released as ECMAScript 3.1, and other radical ideas were expanded into later versions. Due to the atmosphere of the meeting, the project code of this version was named Harmony. Soon after the meeting, ECMAScript 3.1 was renamed ECMAScript 5.

In December 2009, ECMAScript version 5.0 was officially released. The Harmony project was divided into two. Some more feasible ideas were named JavaScript.next and continued to be developed, and later evolved into ECMAScript 6. Some less mature ideas were regarded as JavaScript.next.next, in the far future. Consider launching again. The overall consideration of TC39 is that ECMAScript 5 is basically compatible with ECMAScript 3. Major grammar corrections and new features will be added, which will be completed by JavaScript.next. At the time, JavaScript.next referred to ECMAScript 6. After the sixth edition is released, it will refer to ECMAScript 7. TC39 predicts that ECMAScript 5 will become the mainstream standard for JavaScript development in the middle of 2013 and will maintain this position for the next five years.

In June 2011, ECMAScript version 5.1 was released and became an ISO international standard (ISO/IEC 16262:2011). By the end of 2012, all major browsers supported all the features of ECMAScript version 5.1.

In March 2013, the ECMAScript 6 draft was frozen and no new features were added. The new features will be put into ECMAScript 7.

In December 2013, ECMAScript 6 draft was released. Then there was a 12-month discussion period to listen to feedback from all parties.

In June 2015, ECMAScript 6 was officially released and was renamed "ECMAScript 2015". This is because the TC39 committee plans to release a version of ECMAScript every year in the future, the next version will be released in 2016, called "ECMAScript 2016", in 2017, "ECMAScript 2017" will be released, and so on.


JavaScript has developed along with the development of the Internet. The rapid development of Internet peripheral technology has stimulated and promoted the development of JavaScript language. Next, review the development of peripheral applications of JavaScript.

In 1996, the first version of the CSS style sheet standard was released.

In 1997, DHTML (Dynamic HTML, dynamic HTML) was released, allowing the content of web pages to be changed dynamically. This marks the official application of the DOM model (Document Object Model).

In 1998, Netscape company open sourced the browser, which led to the birth of the Mozilla project. A few months later, AOL announced the acquisition of Netscape.

In 1999, IE 5 deployed the XMLHttpRequest interface, allowing JavaScript to issue HTTP requests, creating conditions for the later popular Ajax applications.

In 2000, the KDE project rewrote the browser engine KHTML, laying the foundation for the later WebKit and Blink engines. On October 23 of this year, KDE 2.0 was released, and the KHTML browser was included for the first time.

In 2001, after a lapse of five years, Microsoft released Internet Explorer 6, the next version of the Internet Explorer browser. This was the most advanced browser at the time, and it later dominated the browser market for many years.

In 2001, Douglas Crockford proposed the JSON format to replace the XML format for data exchange between servers and web pages. JavaScript can natively support this format without the need for additional deployment code.

In 2002, the Mozilla Project released the first version of its browser, which was later named Firefox.

In 2003, Apple released the first version of the Safari browser.

In 2004, Google released Gmail, which led to the birth of the concept of Internet applications (Web Application). Since Gmail was released on April 1, many people thought it was just a joke at first.

In 2004, the Dojo framework was born, which provided the same interface for different browsers and provided convenient calling methods for main functions. This marks the beginning of the era of JavaScript programming frameworks.

In 2004, the WHATWG organization was established to accelerate the standardization process of the HTML language.

In 2005, Apple established the WebKit engine based on the KHTML engine.

In 2005, the Ajax method (Asynchronous JavaScript and XML) was officially born, and Jesse James Garrett invented the vocabulary. The sign of its popularity is that the Google Maps project released in February adopted this method extensively. It has almost become the standard practice of a new generation of websites, and has contributed to the advent of the Web 2.0 era.

In 2005, the Apache Foundation released the CouchDB database. This is a database based on JSON format, and JavaScript functions can be used to define views and indexes. It is essentially different from traditional relational databases, marking the birth of NoSQL databases.

In 2006, the jQuery library was born, authored by John Resig. jQuery provides a very powerful and easy-to-use interface for manipulating the DOM structure of web pages, becoming the most widely used function library, and greatly reducing the application difficulty of the JavaScript language, which promotes the popularity of this language.

In 2006, Microsoft released IE 7, marking the restart of browser development.

In 2006, Google launched the Google Web Toolkit project (abbreviated as GWT), which provided the ability to compile Java into JavaScript, creating a precedent for converting other languages ​​into JavaScript.

In 2007, the Webkit engine was deployed in the iPhone. It was originally based on the KDE project, first adopted by Apple in 2003, and open source in 2005. This marks the beginning of the JavaScript language that can be used in mobile phones, which means that it is possible to write programs that can be used on both desktop computers and mobile phones.

In 2007, Douglas Crockford gave a speech titled "JavaScript: The Good Parts", which was published by O'Reilly Publishing the following year. This marked the beginning of the software industry to take the JavaScript language seriously and to re-understand its syntax.

In 2008, the V8 compiler was born. This is developed by Google for the Chrome browser. Its characteristic is to make JavaScript run very fast. It improves the performance of JavaScript, promotes the improvement and standardization of grammar, and changes the poor impression of JavaScript from the outside world. At the same time, V8 is open source. Anyone who wants a fast embedded scripting language can use V8, which expands the application field of JavaScript.

In 2009, the Node.js project was born. The founder was Ryan Dahl. It marked that JavaScript can be used for server-side programming, and the front-end and back-end of the website can be developed in the same language. Moreover, Node.js can withstand a large amount of concurrent traffic, making it easy to develop some large-scale real-time applications on the Internet.

In 2009, Jeremy Ashkenas released the initial version of CoffeeScript. CoffeeScript can be converted to JavaScript to run, but the syntax is more concise than JavaScript. This started the trend of converting other languages ​​to JavaScript.

In 2009, the PhoneGap project was born. It introduced HTML5 and JavaScript to mobile device application development, mainly for iOS and Android platforms, making JavaScript available for cross-platform application development.

In 2009, Google released Chrome OS, which claims to be an operating system developed based on a browser, allowing direct use of JavaScript to write applications. Similar projects include Mozilla's Firefox OS.

In 2010, three important projects were born, namely NPM, BackboneJS and RequireJS, which marked the era of modular development of JavaScript.

In 2011, Microsoft released the Windows 8 operating system, using JavaScript as one of the application development languages ​​to directly provide system support.

In 2011, Google released the Dart language in order to end the monopoly of the JavaScript language in the browser and provide more reasonable and powerful syntax and functions. The Chromium browser has a built-in Dart virtual machine, which can run Dart programs, but Dart programs can also be compiled into JavaScript programs to run.

In 2011, Microsoft engineer Scott Hanselman proposed that JavaScript will be the assembly language of the Internet. Because it is everywhere, and it is getting faster and faster. Programs in other languages ​​can be converted into JavaScript language and then run in the browser.

In 2012, the single-page app framework (single-page app framework) began to rise, and both the AngularJS project and the Ember project released version 1.0.

In 2012, Microsoft released the TypeScript language. The language is designed to be a superset of JavaScript, which means that all JavaScript programs can be run in TypeScript without modification. At the same time, TypeScript adds a lot of new syntax features, the main purpose is to develop large-scale programs, and then can be compiled into JavaScript to run.

In 2012, the Mozilla Foundation proposed the asm.js specification. asm.js is a subset of JavaScript. All programs that conform to asm.js can be run in the browser. Its special feature is that the syntax is strictly limited and can be quickly compiled into machine code with good performance. The purpose of this is to provide a compilation specification for other languages ​​so that it can be compiled into efficient JavaScript code. At the same time, the Mozilla Foundation also initiated the Emscripten project. The goal is to provide a cross-language compiler that can convert LLVM bitcode into JavaScript Code, run in the browser. Because most of the LLVM bit code is generated from the C/C++ language, this means that C/C++ will be able to run in the browser. In addition, Mozilla also has LLJS (JavaScript to C code) project and [River Trail](https://github.com/RiverTrail/RiverTrail/ wiki) (an ECMAScript extension for multi-core processors) project. Currently, Language List that can be compiled into JavaScript, with a total of nearly 40 languages.

In 2013, the Mozilla Foundation released the mobile operating system Firefox OS. The entire user interface of the operating system uses JavaScript.

In 2013, ECMA officially launched the [International Standard] of JSON (http://www.ecma-international.org/publications/standards/Ecma-404.htm), which means that the JSON format has become as important and important as the XML format. It's official.

In May 2013, Facebook released React, the UI framework library, introduced a new JSX syntax, which enabled the UI layer to be developed with components, and introduced the concept that web applications are state machines.

In 2014, Microsoft launched WinJS, a JavaScript Windows library, marking that Microsoft fully supports the integration of JavaScript and Windows operating systems.

In November 2014, due to dissatisfaction with Joyent's monopoly on the Node project and the slow progress of the project, some core developers left Node.js and created the io.js project, which is a more open and updated Node. The js version was released to version 2.0 in a short time. Three months later, Joyent announced that it gave up control of the Node project and transferred it to the newly established and open Node Foundation. Subsequently, the io.js project announced its return to Node, and the two versions will be merged.

In March 2015, Facebook company released the React Native project, transplanting the React framework to the mobile phone, which can be used to develop mobile apps. It converts JavaScript code into Objective-C code on the iOS platform or Java code on the Android platform, thus opening a way for the development of high-performance native apps in the JavaScript language.

In April 2015, the Angular framework announced that version 2.0 will be developed based on Microsoft's TypeScript language, which is equivalent to introducing strong typing for the JavaScript language.

In May 2015, Node module manager NPM surpassed CPAN, marking that JavaScript has become the language with the most software modules in the world.

In May 2015, Google's Polymer framework released version 1.0. The goal of this project is that the production environment can use WebComponent components. If the goal can be achieved, Web development will enter a new stage of component-based development.

In June 2015, the ECMA Standardization Organization formally approved the ECMAScript 6 language standard and named it "ECMAScript 2015 Standard". The JavaScript language has officially entered the next stage, becoming an enterprise-level language for the development of large-scale applications. It took 10 years for this standard to be proposed and approved, and it has been 20 years since the birth of the JavaScript language.

In June 2015, Mozilla released the WebAssembly project based on asm.js. This is an intermediate code format of a JavaScript engine, all of which are binary, similar to Java bytecode, which is conducive to loading JavaScript scripts on mobile devices, and the execution speed is increased by 20+ times. This means that future software will release JavaScript binary packages.

In June 2016, the "ECMAScript 2016 Standard" was released. Compared with the version released the previous year, it only adds two minor features.

In June 2017, the "ECMAScript 2017 Standard" was released, and the async function was officially introduced, resulting in a fundamental change in the writing of asynchronous operations.

In November 2017, all major browsers support WebAssembly, which means that any language can be compiled into JavaScript and run in the browser.

-Axel Rauschmayer, The Past, Present, and Future of JavaScript -John Dalziel, The race for speed part 4: The future for JavaScript -Axel Rauschmayer, Basic JavaScript for the impatient programmer -resin.io, Happy 18th Birthday JavaScript! A look at an unlikely past and bright future