305 Concepts of programming language Midterm

305 Concepts of programming language Midterm

memorize.aimemorize.ai (lvl 286)
Section 1

Preview this deck

Actual/Formal Parameter

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

5 years ago

Date created

Mar 1, 2020

Cards (105)

Section 1

(50 cards)

Actual/Formal Parameter

Front

Positional- first to first, safe and effective ; Keyword by same name, advantages-Parameters can appear in any order, thereby avoiding parameter correspondence errors, Disadvantages-User must know the formal parameter's names

Back

Functional

Front

a style of building the structure and elements of computer programs—that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data

Back

Algol

Front

ALGOrithmic Language, mid-1950s, rise to BCPL, B, Pascal, PL/I, Simula, C and more. Developed jointly by a committee of European and American computer scientists in a meeting in 1958, Three different syntaxes: a reference syntax, a publication syntax, and an implementation syntax

Back

Exception Handling

Front

Intercept run-time errors and take corrective measures; make program robust

Back

Case sensitivity identifiers

Front

What are these advantages to? -Variable identifiers may look different than identifiers that are names for constants -It greatly increases the space of total possible variable names

Back

flaws in software in 1970s

Front

lack type checking; inadequacy in control statements

Back

Dynamic scoping disadvs

Front

Poor readability (can't determine type from code); Unintended consequences; Cannot type-check at compile time.

Back

Concurrent

Front

form of computing in which several computations are executing during overlapping time periods—concurrently—instead of sequentially (one completing before the next starts)

Back

Coroutines

Front

a subprogram that has multiple entries and controls them itself - supported directly in Lua; called symmetric control; repeatedly resume each other

Back

Imperative

Front

uses statements that change a program's state. In much the same way that the imperative mood in natural languages expresses commands, an imperative program consists of commands for the computer to perform; designed for von-Neuman

Back

interpreted language

Front

entire process must be repeated every time the program is run, even if the code did not change; executes the program step-by-step; ability to modify programs during runtime by adding or changing functions; avoids explicit program compilation and translation happens 'on-the-fly'; slower to execute because each statement is read and executed by another program

Back

Expressivity

Front

"A set of relatively convenient ways of specifying operations, Strength and number of operators and predefined functions

Back

Fortran

Front

by IBM in the 1950s; proposed by John W. Backus Scientific applications (over 50 years), floating point computations and arrays; first widely used programming language supported across a variety of computer architectures

Back

Ada

Front

by Jean Ichbiah of CII Honeywell Bull under contract to the United States Department of Defense in 1977 to 1983; strong typing, modularity mechanisms (packages), run-time checking, parallel processing exception handling, and generics. Ada 95 added support for object-oriented programming, including dynamic dispatch.

Back

fully qualified reference

Front

fully qualified reference to a record field is one in which all intermediate record name, from teh largest enclosing record to the specific field, are named in the reference; must include all record names

Back

Functions Design Issues

Front

Are side effects allowed?Parameters should always be in-mode to reduce side effect (like Ada)?What types of return values are allowed?Most imperative languages restrict the return types, C allows any type except arrays and functions, C++ is like C but also allows user-defined types, Java and C# methods can return any type (but because methods are not types, they cannot be returned), Python and Ruby treat methods as first-class objects, so they can be returned, as well as any other class, Lua allows functions to return multiple values

Back

Data Abstraction

Front

encapsulates the data and its associated processes together and also controls access to data

Back

Basic

Front

By John G. Kemeny and Thomas E. Kurtz in 1964, Enable students in fields other than science and mathematics to use computers, Microcomputers, for the Dartmouth Time-Sharing System, based on FORTRAN II, with some influences from ALGOL 60.

Back

mixed-mode

Front

can have operands of different types

Back

coercion

Front

An implicit type conversion ; Disadvantage-They decrease in the type error detection ability of the compiler

Back

Associative Arrays

Front

Design issues:What is the form of references to elements?Is the size static or dynamic?

Back

Language Evaluation Criteria

Front

Readablitiy, Writability, Reliability, Cost, Portability, Generality, Well-definedness

Back

Metaprogramming

Front

the writing of computer programs with the ability to treat programs as their data. It means that a program could be designed to read, generate, analyse or transform other programs, and even modify itself while running

Back

C

Front

By Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs; Systems programming; Unix written in C; standardized by the American National Standards Institute and International Organization for Standardization; imperative (procedural) language; not initially designed with portability in mind.

Back

dynamic binding

Front

if binding it first occurs during run time begins and can be changed throughout program execution.

Back

Case sensitive identifiers

Front

What are these disadvantages to? -Allows programmers to create variable names that are similar to keywords, which makes the program harder to read -Programmers can make variables with names that look very similar

Back

Iterative Statements

Front

The repeated execution of a statement or compound statement is accomplished either by iteration or recursion; Design issues for iteration control statements:How is iteration controlled?Where is the control mechanism in the loop?

Back

Deep binding

Front

The environment of the definition of the passed subprogram, Most natural for static-scoped languages

Back

Control Structure

Front

a control statement and the statements whose execution it controls

Back

Closures

Front

A subprogram and the referencing environment where it was defined -only needed if a subprogram can access variables in nesting scopes and it can be called from anywhere

Back

Aliasing

Front

Presence of two or more distinct referencing methods for the same memory location; is known to decrease the reliablility of programs

Back

Array

Front

Design Issues:What types are legal for subscripts?Are subscripting expressions in element references range checked?When are subscript ranges bound?When does allocation take place?Are ragged or rectangular multidimensional arrays allowed, or both?What is the maximum number of subscripts?Can array objects be initialized?Are any kind of slices supported?

Back

elliptical reference

Front

When the referencing can omit any or all of the enclosing record names, as long as the resulting reference is unambiguous.

Back

denotational semantics

Front

each phrase in the language is interpreted as a conceptual meaning that can be thought of abstractly

Back

dynamically typed

Front

The type of all variables within the program is determined at runtime and can vary.; Advantages-Support for recursion, Storage for locals is shared among some subprograms; Disadvantades-Allocation/deallocation, initialization time, Indirect addressing, Subprograms cannot be history sensitive

Back

Cost

Front

Training programmers; Writing programs; Compiling programs; Executing programs; Language implementation system: availability of free compilers; Reliability: poor reliability leads to high costs; Maintaining programs

Back

Generality

Front

The applicability to a wide range of applications

Back

Counter-Controlled Loops

Front

A counting iterative statement has a loop variable, and a means of specifying the initial and terminal, and stepsize values; Design Issues:What are the type and scope of the loop variable?Should it be legal for the loop variable or loop parameters to be changed in the loop body, and if so, does the change affect loop control?Should the loop parameters be evaluated only once, or once for every iteration?

Back

Enumeration Types

Front

enum days {mon, tue, wed, thu, fri, sat, sun}; Design issues-it constant allowed to appear in more than one type definition, and if so, how is the type of an occurrence of that constant checked?Are its values coerced to integer?Any oter type coerced to an enumeration type?

Back

arithmetic expressions

Front

Design issues-Operator precedence rules?Operator associativity rules?Order of operand evaluation?Operand evaluation side effects?Operator overloading?Type mixing in expressions?

Back

event-driven

Front

a programming paradigm in which the flow of the program is determined by events such as user actions (mouse clicks, key presses), sensor outputs, or messages from other programs/threads; used in graphical user interfaces

Back

COBOL

Front

by CODASYL 1959; Business applications (over 50 years), Reports, decimal numbers and characters; standardized in 1968; imperative, procedural and, since 2002, object-oriented

Back

Logically-Controlled Loops

Front

Repetition control is based on a Boolean expression; Design issues:Pretest or posttest?Should the logically controlled loop be a special case of the counting loop statement or a separate statement?

Back

Ad hoc binding

Front

The environment of the call statement that passed the subprogram

Back

declarative

Front

a style of building the structure and elements of computer programs—that expresses the logic of a computation without describing its control flow

Back

LISP

Front

by John McCarthy in 1958; Artificial intelligence, pioneered many ideas in computer science, including tree data structures, automatic storage management, dynamic typing, conditionals, higher-order functions, recursion, and the self-hosting compiler; homoiconicity

Back

Logic

Front

set of sentences in logical form, expressing facts and rules about some problem domain; include Prolog, Datalog. In all of these languages, rules are written in the form of clauses:

Back

Guarded Commands

Front

each line in the selection statement, consisting of a Boolean expresion (a guard) and a statement of statement sequence

Back

dangling pointer

Front

pointing to a heap-dynamic variable which has be deallocated; Problem: Tombstone: extra heap cell that is a pointer to the heap-dynamic variable, The actual pointer variable points only at tombstones, When heap-dynamic variable de-allocated, tombstone remains but set to nil, Costly in time and space ; Locks-and-keys: Pointer values are represented as (key, address) pairs, Heap-dynamic variables are represented as variable plus cell for integer lock value, When heap-dynamic variable allocated, lock value is created and placed in lock cell and key cell of pointer

Back

associativity of the $ and #

Front

<tac> → <tic> $ <tac> (right) ; <tic> → <tic> # <toe> (left)

Back

Section 2

(50 cards)

Shallow binding

Front

The environment of the call statement that enacts the passed subprogram, Most natural for dynamic-scoped, languages

Back

Pass-by-Value (in mode)

Front

Disadvantages (if by physical move): additional storage is required (stored twice) and the actual move can be costly (for large parameters); Disadvantages (if by access path method): must write-protect in the called subprogram and accesses cost more (indirect addressing)

Back

Overloaded Subprograms

Front

DisAdvantages= Users can define nonsense operations, Readability may suffer, even when the operators make sense

Back

Multiple-Way Selection Statements

Front

Design Issues:What is the form and type of the control expression?How are the selectable segments specified?Is execution flow through the structure restricted to include just a single selectable segment?How are case values specified?What is done about unrepresented expression values?

Back

Subtype polymorphism

Front

means that a variable of type T can access any object of type T or any type derived from T (OOP languages)

Back

subprogram Function declarations

Front

In C and C++ are often called prototypes; A subprogram declaration provides the protocol, but not the body, of the subprogram

Back

static binding

Front

if binding first occurs before run time begins and remains unchanges throughout program execution.

Back

Record Types

Front

Design issues:What is the syntactic form of references to the field? Are elliptical references allowed

Back

numeric type

Front

booleans; ints and floating-ponte have it built from the bit type.

Back

non-deterministic

Front

the method of choice between these alternatives is not directly specified by the programmer

Back

single language for all programming domains

Front

It would justify the development of numerous language dependent software development aids; It would simplify programmer recruiting; It would increase code portability; It would dramatically cut the costs of programming training

Back

Smalltalk

Front

product of research led by Alan Kay at Xerox Palo Alto Research Center, object-oriented, dynamically typed, reflective programming language, Simula-like class inheritance model of execution, everything is an object

Back

Object-Oriented

Front

based on the concept of "objects", which may contain data, in the form of fields, often known as attributes; and code, in the form of procedures, often known as methods; fundamentals 1.Date Abstraction 2.Inheritance 3. Dynamic method binding or polymorphism

Back

polymorphism

Front

the ability in computer programming to present the same programming interface for differing underlying forms (data types, classes)

Back

Pass-by-Value-Result (inout Mode)

Front

combination of pass-by-value and pass-by-result; Disadvantages-Those of pass-by-result and Those of pass-by-value

Back

Support for abstraction

Front

The ability to define and use complex structures or operations in ways that allow details to be ignored

Back

Orthogonality

Front

Small set of primitive constructs can be combined in a relatively small number of ways; Every possible combination is legal; ex. Logic and arithmetic expressions can be intermixed; VAX used it as design criterion

Back

Unions Types

Front

Variables are allowed to store different type values at different times during execution; require that each union include a type indicator called a discriminant; Design issue:Should type checking be required?

Back

Pointers

Front

Design Issues:What are the scope of and lifetime of a pointer variable?What is the lifetime of a heap-dynamic variable?Are pointers restricted as to the type of value to which they can point?Are pointers used for dynamic storage management, indirect addressing, or both?Should the language support pointer types, reference types, or both?

Back

subprogram formal parameter

Front

a dummy variable listed in the subprogram header and used in the subprogram

Back

Readablitiy

Front

Overall simplicity, Orthogonality, Data types, Syntax considerations; easy to read code has more re-usablility

Back

subprogram header

Front

the first part of the definition, including the name, the kind of subprogram, and the formal parameters

Back

referential transparency

Front

The ability to substitute expressions of equal value and have the program produce the same result, Advantages-Semantics of a program is much easier to understand if it has referential transparency

Back

Simula

Front

By Ole-Johan Dahl and Kristen Nygaard in 1960s, first object-oriented, simulating discrete event systems, SIMULA standardized by Standards Group in Feb 1968.

Back

subprogram actual parameter

Front

represents a value or address used in the subprogram call statement

Back

Pass-by-Name (Inout Mode)

Front

Formals are bound to an access method at the time of the call, but actual binding to a value or address takes place at the time of a reference or assignment

Back

Pass-by-Reference (Inout Mode)

Front

Advantage: Passing process is efficient (no copying and no duplicated storage); Disadvantages, Slower accesses (compared to pass-by-value) to formal parameters, Potentials for unwanted side effects (collisions), Unwanted aliases (access broadened)

Back

Portability

Front

The ease with which programs can be moved from one implementation to another

Back

Reliability

Front

Type checking, Exception handling, Aliasing, Readability and writability; if under all condition, the program performs according to its specifications

Back

Reference Counter

Front

Reference counters: maintain a counter in every cell that store the number of pointers currently pointing at the cell; Disadvantages: space required, execution time required, complications for cells connected circularly; Advantage: it is intrinsically incremental, so significant delays in the application execution are avoided

Back

short circuit evaluation

Front

Determining the value of a boolean expression without needing to use all of the operators

Back

subprogram parameter profile

Front

(aka signature) of a subprogram is the number, order, and types of its parameters

Back

Type Checking

Front

Testing for type errors; important to maintain the reliability of the code.

Back

Typeless language advantages

Front

easier to learn as a first programming language; provides great flexibility for the programmer; useful for very low-level languages used for systems programming; Programmers can make changes to existing code in less time

Back

statically typed

Front

The type of all variables within the program is set at compile time. Advantages and disadvantages are the opposite of those for stack-dynamic local variables

Back

subprogram

Front

"two categories 1.Procedures are collection of statements that define parameterized computations 2.Functions structurally resemble procedures but are semantically modeled on mathematical functions"

Back

selection statement

Front

"provides the means of choosing between two or more paths of execution; Two general categories 1.Two-way selectors- if, then,else... 2. Multiple-way selectors, switch , case, default...case, then, else, end...Allow the selection of one of any number of statements or statement groups"

Back

Two-Way Selection Statements

Front

Design Issues:What is the form and type of the control expression?How are the then and else clauses specified?How should the meaning of nested selectors be specified?

Back

User-Located Loop Control

Front

"break"; Design issues for nested loops, Should the conditional be part of the exit?Should control be transferable out of more than one loop?

Back

Scripting Languages

Front

"smaller with relatively simple syntax and semantics; support libraries (usually) need not be nearly as large; easier to create and write a new language; focused on specific domains or more narrow applications; faster to develop smaller projects"

Back

Simplicity

Front

Manageable set of features and constructs , Minimal feature multiplicity and operator overloading

Back

Syntax considerations

Front

Identifier forms: flexible composition, Special words and methods of forming compound statements, Form and meaning: self-descriptive constructs, meaningful keywords

Back

scripting

Front

programs written for a special run-time environment that automate[1] the execution of tasks that could alternatively be executed one-by-one by a human operator

Back

subprogram protocol

Front

a subprogram's parameter profile and, if it is a function, its return type

Back

PL/I

Front

designed for scientific, engineering, business and system programming uses; data processing, numerical computation, scientific computing, and system programming; it supports recursion, structured programming, linked data structure handling, fixed-point, floating-point, complex, character string handling, and bit string handling; The first compiler was delivered in 1966. The Standard for PL/I was approved in 1976

Back

Subprograms Design Issues

Front

Are local variables static or dynamic? Can subprogram definitions appear in other subprogram definitions? What parameter passing methods are provided?Are parameter types checked?If subprograms can be passed as parameters and subprograms can be nested, what is the referencing environment of a passed subprogram?Are functional side effects allowed?What types of values can be returned from functions?How many values can be returned from functions?Can subprograms be overloaded?Can subprogram be generic?If the language allows nested subprograms, are closures supported?

Back

narrowing conversion

Front

converts a value to a type that cannot store even approximations of all of the values of origenal type

Back

Pass-by-Result (Out Mode)

Front

Require extra storage location and copy operation

Back

Program Design Methodologies

Front

New software development methodologies (e.g., object-oriented software development) led to new programming paradigms and by extension, new programming languages

Back

Side Effects

Front

Two possible solutions to the problem 1., Write the language definition to disallow functional side effects, No two-way parameters in functions, No non-local references in functions, Advantage: it works!, Disadvantage: inflexibility of one-way parameters and lack of non-local references; 2.Write the language definition to demand that operand evaluation order be fixed, limits some compiler optimizations, Java requires that operands appear to be evaluated in left-to-right order

Back

Section 3

(5 cards)

"Von Neumann architecture

Front

1945; any stored-program computer in which an instruction fetch and a data operation cannot occur at the same time because they share a common bus. This is referred to as the von Neumann bottleneck and often limits the performance of the system; Imperative structure is dictated by it; The prevalent computer architecture that languages are developed around - Data and programs stored in memory, Memory is separate from CPU, Instructions and data are piped from memory to CPU, Basis for imperative languages Variables model memory cells, Assignment statements model piping, Iteration is efficient; strogest influence on language design

Back

Writability

Front

Simplicity and orthogonality, Support for abstraction, Expressivity

Back

Web Software

Front

Eclectic collection HTML, scripting PHP, general-purpose Java

Back

Well-definedness

Front

The completeness and precision of the language's official definition

Back

widening conversion

Front

converts a value to a type that can include at least approximations of all of the values of origenal type

Back