Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
18 Cards in this Set
- Front
- Back
Compare system programming languages and scripting languages.
|
System programming languages: Emphasize computing as a result. High-performance compilers.
Scripting languages: Emphasize automating as a process. Highly-portable interpreters |
|
What is a scripting language?
|
A language that coordinates other programs
Examples: A payroll system to process time data, scan paper forms, execute database queries, etc. A photojournalism system that downloads pictures from a camera, converts them to a different format, process them, etc. A dynamic web page that requires authentication, database lookup, remote communication, etc. |
|
Compare traditional programming languages and scripting languages.
|
Traditional programming languages stress efficiency, maintainability, portability, and the static detection of errors
Types are built around hardware-level concepts such as fixed-size integers, floating-point numbers, characters, and strings Scripting languages stress flexibility, rapid development, local customization, and dynamic runtime checking Types are built around high-level concepts such as tables, patterns, lists, and files |
|
What are the common characteristics of a scripting language?
|
Both batch and interactive use
Economy of expression Lack of declarations; simple scoping rules. Flexible dynamic typing Easy access to other programs Sophisticated pattern matching and string manipulation High level data types |
|
What are the four advantages of Lua?
|
Extensibility, simplicity, efficiency, and portability
easy to write modules that add functionality easy to embed Lua as a scripting language in another program such as a game or use it on a hardware device |
|
A Lua variable names a function, but it never holds...
|
the function itself, it only holds a reference to that function.
|
|
Copying tables in Lua by passing them with their variable names...
|
never happens. A variable cannot hold the table itself, it will just hold a reference to a table
This means that passing a table to a function or assigning a table to a new variable does not copy the table. |
|
What are closures and upvalues in Lua?
|
A function that preserves the context that it was created in is called a closure
The preserved variables that can be accessed by closures are called upvalues So a closure is a function that is bound by its scope, preserving local variables accessed by the function Executing a function() ... end expression generates a new closure of that function The original function acts as a prototype for that closure |
|
What does static typing mean?
|
The compiler can do all the checking at compile time
|
|
A collection of features is orthogonal if...
|
there are no restrictions on the ways in which the features can be combined (similar to the idea of vectors in a multi-dimensional space)
|
|
What is an ordinal type?
|
A type in which the range of possible values can be easily associated with the set of positive integers
|
|
What is an union?
What is a record? |
Union (variant record): a collection of fields where only one fields is valid at any given time
Record: a collection of fields, each of which belongs to a potentially different type |
|
A union's variables are allowed to...
|
store different type values at different times during execution
|
|
Different types of arrays
|
Static: subscript ranges are statically bound and storage allocation is static (before run-time)
Fixed stack-dynamic: subscript ranges are statically bound, but the allocation is done at declaration time Stack-dynamic: subscript ranges are dynamically bound and the storage allocation is dynamic (both are done at run-time) Fixed heap-dynamic: similar to fixed stack-dynamic: storage binding is dynamic but fixed after allocation (i.e., binding is done at runtime, and storage is allocated from the heap, not the stack) Heap-dynamic: binding of subscript ranges and storage allocation is dynamic and can change any number of times |
|
What is an associative array?
|
an unordered collection of data elements that are indexed by an equal number of values called keys
|
|
What is a dangling pointer?
|
A pointer that contains the address of a heap-dynamic variable that has been deallocated
|
|
Two fundamental abstraction facilities in programming languages
|
Data abstraction: Emphasized in programming languages from the 1980s
The essence of code reuse via object-oriented programming Process abstraction: Emphasized from the early days of programming languages The essence of code re-use via subprograms |
|
What are the two categories of subprograms?
|
* Procedures are collection of statements that define parameterized computations
* Functions structurally resemble procedures but are semantically modeled on mathematical functions |