Preparations Flashcards
What is a runtime environment?
It is an execution environment that lets an application program access system resources and provides the tools the application needs to operate.
What is a runtime environment in simple words?
It turns an application from a set of instructions into something that performs actual work.
What is a programming language?
A programming language is a set of syntactic and semantic rules that describe a formal language and must be able to express the steps that a machine needs to perform to convert some input to an output.
Before the computer can perform those steps, what does it need to happen?
The program needs to be converted to a form the computer can understand.
What programs do we need for this conversion?
Compilers and interpreters.
What do compilers and interpreters do?
At their most basic level, compilers and interpreters are similar: they both translate a program written in a specific programming language to something that the computer can execute, typically referred to as “1s and 0s” since all information on digital computers gets stored as 1s and 0s.
How do compilers and interpreters differ?
They differ primarily in what they do with those 1s and 0s.
What do compilers do?
Compilers produce an output file that the computer can run directly, perhaps after some additional processing called linking.
What do interpreters do?
Interpreters, however, don’t produce 1s and 0s that the computer can run directly - instead, the interpreter runs the interpreted code directly, or perhaps passes it on to a companion program.
Is JavaScript an interpreted language?
YES!
However, for performance reasons, most modern JavaScript engines employ a special kind of compiler called a Just In Time (JIT) compiler that takes the interpreted code one step further and lets the computer run the result.
What does an Application Programming Interface (API) do?
When an application accesses an operating system’s resources, something must ensure that the operating system provides them in a regulated and safe manner.
The API provides that functionality.
What does an API do in other terms?
It describes the scheme and format that a programmer can use to securely access resources, with the operating system acting as an intermediary.
What does a runtime environment do?
A runtime environment typically adds another layer of abstraction on top of the operating system’s API to make these resources available with a higher-level (i.e., more accessible) API.
What is a runtime environment composed of?
The compiler/interpreter and the operating system’s APIs together make up a runtime environment.
In other words, they provide the tools that an application needs to run.
What is a development environment?
A runtime environment with debugging and profiling tools.
For our purposes, we’ll treat the developer tools as part of the runtime environment.
What are the two major runtime environments in JavaScript?
The browser and Node.js.
What is the browser?
The web browser was the original JavaScript runtime environment, and it’s still the most dominant.
JavaScript running in the browser is far more ubiquitous than JavaScript running anywhere else.
Almost every browser has a JavaScript engine built into it.
What are the two main purposed of the browser?
1) to programmatically alter web pages based on user actions.
2) to exchange messages with a server over a network.