Home  >  Article  >  Web Front-end  >  What is the difference between lua and nodejs

What is the difference between lua and nodejs

青灯夜游
青灯夜游Original
2021-11-24 10:59:272310browse

Difference: 1. nodejs is a javascript running environment, while Lua is a lightweight and compact scripting language. 2. Lua is small and efficient. The statically linked Lua interpreter including the standard library is only 187K in size; while NodeJS is too heavy, and the compiled interpreter alone is several M in size.

What is the difference between lua and nodejs

The operating environment of this tutorial: windows7 system, nodejs version 12.19.0, Dell G3 computer.

NodeJS

Node.js was released in May 2009 and developed by Ryan Dahl. It is a JavaScript running environment based on the Chrome V8 engine and uses an event driver. , non-blocking I/O model, allowing JavaScript to run on the server-side development platform, which makes JavaScript a scripting language on par with server-side languages ​​such as PHP, Python, Perl, and Ruby.

Nodejs is based on the V8 engine. V8 is an open source JavaScript engine released by Google. It is the js interpretation part for the Chrome browser. But Ryan Dahl, a guy like a genius, moved this V8 to the server. , software used to make servers.

Lua

Lua is a lightweight and compact scripting language written in standard C language and open in source code form. It is designed to be embedded in applications. , thereby providing flexible expansion and customization capabilities for applications.

The Lua language is very small. The statically linked Lua interpreter including the standard library is only 187K in size (X86_64 after strip), and it is said to be very fast. Lua was designed to embed C language at the beginning. It has a complete interface to interact with C, making it very suitable as a glue language.

The connection and difference between lua and nodejs

The same thing between Lua and NodeJS: they are both single-threaded event models that combine dynamic and static languages.

The difference between Lua and NodeJS:

  • Node.js is a javascript running environment, while Lua is a lightweight and compact scripting language.

  • lua is small and efficient. The statically linked lua interpreter including the standard library is only 187K in size;

    And NodeJS is too heavy, just compiled The interpreter is several M in size (mainly because V8 is too large).

[Related tutorial recommendations: "nodejs tutorial"]

The above is the detailed content of What is the difference between lua and nodejs. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn