First JavaScript

The guide

This article will introduce you to the origins of JavaScript for the first time, and in future articles we will learn the hard and heavy parts of JavaScript (closures,this pointing, prototypes, etc.). The contents of this article are as follows:

  1. The birth of JavaScript
  2. Browser features
  3. JS engine

The birth of JavaScript

The founder of JavaScript was Brendan Eich, who netscape hired in April 1995 to investigate the possibility of using Scheme as a web scripting language, but because Java was so popular at the time, Netscape wanted to ride the wave, so in May 1995, Netscape made the decision, The web scripting language of the future has to look like Java,Brendan In order to meet the company’s task, Eich wrote JavaScript in only 10 days, which is an incredible thing. Due to the short time and insufficient consideration of the language, the programs written with JavaScript are quite chaotic for a long time. In fact, JavaScript language Language is the idea of object-oriented programming, the language borrowed from C,JAVA,Scheme,Self language jointly decided. This is where JavaScript comes in.

Browser features

When the browser opens to display the web page, the following steps are performed: 1. Send request 2. Download HTML 3. Parse HTML 4. Download CSS 5. Parse CSS 6. If you want to display web pages smoothly, you also need the following modules: user interface module. Render engine module.JS engine module. Storage modules, etc. Functional modules are in different threads (smaller than processes).

JS engine

V8 engine is a JavaScript engine implementation originally designed by some language experts, acquired by Google, and subsequently open-source by Google. V8 is developed in C++ and compiles it to native machine code (ia-32, x86-64, ARM, or MIPS CPUs) before running JavaScript, compared to other JavaScript engines that convert it to bytecode or interpreted execution. Methods such as inline caching are used to improve performance. With these features, JavaScript programs run as fast as binary programs in V8. V8 supports many operating systems, such as Windows, Linux, Android, etc., and other hardware architectures, such as IA32,X64,ARM, etc., with good portability and cross-platform features. Compile: translate JS code into machine-code optimizations that the machine can perform; change the code to make it run more efficiently; perform the machine code garbage collection above; recycle JS memory for later use

conclusion

This article roughly introduces the source of JavaScript, at the same time a simple introduction of some JS engine and browser functions, for the future we in-depth study of JavaScript to do a simple foundation, we see next time remember to continue learning, continue to follow up! Come on!