1/53
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Programming language
A notation for computing to a computer what we want it to do.
“Hardwired” Programs
Pre 1940s computers required you to adjust the internal wiring to perform different tasks.
Assembly language
A set of mnemonic symbols for instruction codes and memory locations.
Assembler
A program that translates the symbolic assembly language code to binary machine code.
Loader
A program that loads the machine code into computer memory.
Mnemonic symbols shortcomings
Lacked abstraction of conventional mathematical notation
Each type of computer hardware architecture has its own machine language instruction set and requires its own dialect of assembly language
FORTRAN (FORmula TRANslation Language)
Developed by Backus in early 1950s
Reflected the architecture of a particular type of machine
Lacked the structured control statements and data structures of later high-level languages
Supported algebraic notation and floating point numbers
ALGOL
First language that was machine independent
First language to receive a formal specification or definition
Supported different numeric types and control statements
Introduced arrays
Compiler
Translates programming language statements into machine code.
Pascal
Language for teaching programming in the 1970s
Ada
Language for embedded applications of U.S. Dept. of Defense
Lambda Calculus
Computational model developed by mathematician Alonzo Church which is based on the theory of recursive functions
Lisp
Programming language that uses the functional model of computation
Data abstractions
Simplify the behavior and attributes of data for humans
Ex. numbers, character strings, search trees
Control abstractions
Simplify properties of the transfer of control
Ex. loops, conditional statements, procedure calls
Basic abstractions
collect the most localized machine information
Structured abstractions
Collect intermediate information about the structure of a program
Unit abstractions
Collect large-scale information in a program
Basic data abstraction
Hides internal representation of common data values
Variables: hide computer memory locations
Data types: names for kinds of data values
Declaration: process of giving a variable a name and data type
Data structure
Collects related data values into a single unit
Unit abstraction
Often associated with the concept of an abstract data type
Basic control abstractions
Statements that combine a few machine instructions into an abstract statement that is easier to understand
Syntactic sugar
A mechanism that allows you to replace a complex notation with a simpler, shorthand notation
Iterator
An object associated with a collection
Procedure/subprogram/subroutine
Groups a sequence of actions into a single action that can be called or invoked from other points in the program
Does not return anything
Function
Mathematical, returns one thing
Method
The message sent to an object to make it do something
Runtime environment
The system implementation of the program
Higher-order functions
Functions that can accept other functions as arguments and return functions as values
Unit
A stand-alone collection of procedures providing logically related services to other parts of a program
von Neumann bottleneck
Requirement that a program be described as a sequence of instructions
Imperative language
Three properties
Sequential execution of instructions
Use of variables representing memory locations
Use of assignment to change the values of variables
Language syntax
Similar to the grammar of a natural language
Language semantics
Meaning of a language
A language is successful if
It achieves the goals of its designers
It attains widespread use in an application area
It serves as a model for other languages that are successful
Writability
The quality of a language that enables a programmer to use it to express computation clearly, correctly, concisely, and quickly
Regularity
Refers to how well the features of a language are integrated
Three concepts:
Generality
Orthogonal design
Uniformity
A language designed with security in mind…
Discourages programming errors
Allows errors to be discovered and reported
Semantically safe
Languages that prevent a programmer from compiling or executing any statements or expressions that violate the language definition
Extensible language
A language that allows the user to add features to it
Macro
Specifies the syntax of a piece of code that expands to other standard code when compiled
Difference between imperative programming and functional programming
The concept of a variable
In math, variables always stand for actual values
In imperative programming languages, variables refer to memory locations that store values
Referential transparency
The property whereby a function’s value depends only on the values of its arguments (and nonlocal variables)
Value semantics
Semantics in which names are associated only to values, not memory locations
In functional programming, functions are…
First-class data values
They can be computed by other functions and parameters to other functions
LISP (LISt Processing)
First language that contained many of the features of modern functional languages
Tail recursive
When the recursive steps are the last steps in any function