How do engines work?
Engines are complex. But their principles are simple. The engine (embedded in the browser) reads the text ("parses"). It then "compiles" the script into machine language. And then the device code runs very fast.
The engine applies optimization at every stage of the process. It even watches the compiled script at runtime, analyzes the data it goes through, and optimizes machine code based on this knowledge.
Add new HTML to the page, change existing content, change styles.
React to user actions, perform mouse clicks, pointer gestures, keystrokes.
Send requests over the network to remote servers, download and upload files (so-called AJAX and COMET technologies).
Receive and set cookies, ask the visitor questions, show messages.
Remember client-side data ("local storage").
Examples of these restrictions are:
- Modern browsers allow you to work with files, but access is limited, and access is restricted only if the user performs certain actions, such as "dropping" the file in the browser window or selecting it by tagging.
This restriction is for the safety of the user. A page from http://anysite.com opened by a user should not be able to access and steal another browser tab with the URL http://gmail.com.
Full integration with HTML / CSS.
Simple tasks are done simply.
Support is enabled by all major browsers by default.
This is to be expected, because projects and requirements are different for everyone.
Modern tools make printing very fast and transparent. It actually allows developers to code in another language and automatically turn it "under the hood".
Examples of these languages:
TypeScript focuses on simplifying "accurate data typing" to simplify the development and support of complex systems. Made by Microsoft.
Flow also adds data typing, but in a different way. Developed by Facebook.
Kotlin is a modern, concise, and secure programming language that can target the browser or Node.