Scripting Languages Flashcards
(41 cards)
What is a scripting language?
A programming language that supports scripts: programs written for a special run-time environment that automate the execution of tasks that could alternatively be executed one-by-one by a human operator.
Scripting languages are often ___ (rather than ____).
interpreted, compiled
Scripting languages are often interpreted, rather than compiled.
What is a compiled language?
One where the program, once compiled, is expressed in the instructions of the target machine; this machine code is undecipherable by humans.
What is an interpreted language?
One where the instructions are not directly executed by the target machine, but instead read and executed by some other program (which normally is written in the language of the native machine).
How is code executed via compilation?
It is executed natively through the operating system after it is converted to machine code.
How is code executed via interpolation?
It is evaluated line by line through a program which handles executing the code instead of the operating system itself.
Can you easily classify a programming language as either compiled or interpreted?
Not usually- most programming languages have both compiled implementations and interpreted implementations. Languages are often referred to as one or the other for the sake of simplicity and clarity.
What is the major advantage of compiled languages over interpreted languages?
their execution speed.
Why are compiled languages usually faster than interpreted languages?
Because they are converted directly into machine code.
Why do lower-level languages tend to be compiled?
Because efficiency is usually more of a concern than cross-platform support. Also, because compiled languages are converted directly into machine code, this gives the developer much more control over hardware aspects such as memory management and CPU usage.
What are some examples of pure compiled languages?
C, C++, Erlang, Haskell, Rust, Go.
What is a pitfall of a compiled language?
You need to manually compile a program in order to run it.
What is a pitfall of a compiled language involving debugging?
While you debug the program, you need to recompile the program each time you want to test your new changes.
Are compiled languages platform-independent?
No, the compiled machine code is specific to the language that is executing it.
What is an example of a technology that is narrowing the execution time gap between interpreted and compiled languages?
just-in-time compilation.
What is just-in-time compilation?
Compilation done during execution of a program- at run time- rather than prior to execution.
What are some examples of interpreted languages?
PHP, Perl, Ruby and Python.
What are some programming concepts that interpreted languages make easier?
Platform independence, reflection, dynamic typing, smaller executable program size and dynamic scoping.
How does just-in-time compilation work?
it converts frequently-executed sequences of interpreted instruction into host machine code.
What are bytecode languages?
a type of programming language that fall under the categories of both compiled and interpreted languages because they employ both compilation and interpretation to execute code.
What are the most common examples of bytecode languages?
Java and the .Net framework.
What is the first step in a bytecode language?
In a bytecode language, the first step is to compile the current program from its human-readable language into bytecode.
What is bytecode?
Bytecode is a form of instruction set that is designed to be efficiently executed by an interpreter and is composed of compact numeric codes, constants, and memory references.
Where is the bytecode passed after compilation?
the bytecode is passed to a virtual machine which acts as the interpreter, which then proceeds to interpret the code as a standard interpreter would.