Home > Article > Web Front-end > What language is nodejs written in?
nodejs is written in C language. nodejs is a language developed in C that runs on the server side. The bottom layer of node is C; and nodejs is a JavaScript running environment based on the Chrome V8 engine, and V8 is developed in C.
The operating environment of this tutorial: windows7 system, nodejs version 12.19.0, Dell G3 computer.
Node.js is written and developed in C.
The bottom layer of Node.js is C (V8 is also written in C). The source code of node is on the GitHub website. Many files ending with the .cc suffix in the src folder of the project root directory have the word class in them (C has class but C does not).
nodejs is a language developed in C that runs on the server side. It can write website background programs and do server-side application development. Its syntax is JAVASCRIPT. If you know JS, you know NODEJS. It is different from ordinary JS is a script that runs on the client side, while JS in NODEJS runs on the server side. Let's put it this way, NODEJS is equivalent to languages such as PHP and ASP.
And Node.js is a JavaScript running environment based on the Chrome V8 engine. Node.js uses an event-driven, non-blocking I/O model.
V8 is developed in C and used in Google Chrome. Before running JavaScript, instead of other JavaScript engines converting it into bytecode or interpreting it for execution, V8 compiles it into native machine code (IA-32, x86-64, ARM, or MIPS CPUs) and uses the following Methods such as inline caching can be used to improve performance. With these features, JavaScript programs run as fast as binary programs under the V8 engine.
V8 implements ECMAScript as specified in ECMA-262, version 3 running on Windows XP and Vista, Mac OS X 10.5 (Snow Leopard and Linux) using IA-32 or ARM processors.
V8 can run independently or be embedded into any C application. The project is hosted on Google Code and is based on the BSD protocol. Any organization or individual can use its source code for their own projects.
What kind of applications is Node.js suitable for developing?
Good at I/O, not good at calculation. Because Node.js is best at task scheduling. If your business has many CPU calculation is actually equivalent to this calculation blocking this single thread, which is not suitable for Node development.
When the application needs to handle a large number of concurrent I/O, and before sending a response to the client, Node.js is very suitable when there is no need for very complex processing within the application. Node.js is also very suitable for working with web sockets to develop real-time interactive applications with long connections.
Node.js is not An independent language, unlike PHP, JSP, Python, Perl, and Ruby which are "both a language and a platform", Node.js uses JavaScript for programming and runs on the JavaScript engine (V8).
[Recommended learning: "nodejs tutorial"]
The above is the detailed content of What language is nodejs written in?. For more information, please follow other related articles on the PHP Chinese website!