programming language concepts definations
TRANSCRIPT
8/19/2019 Programming language concepts definations
http://slidepdf.com/reader/full/programming-language-concepts-definations 1/5
Six Exception handling
• Try - Marks the protected block, where an exception may occur
• Throwable - is the superclass of all exceptions
• Exception - An exception is a program execution event that must not or cannot be
handled in normal control flow• Throw - actually raises the exception
• Throws - identifies the list of exceptions that can be thrown
• Catch - Exception handler
Static Variables
• A C function’s local variable can remember its value from one invocation to the next, if it
is designated static
•
!ortran calls it save" Algol calls it own
• C clears the static variable upon the owning function’s first invocation
• A static variable is invisible outside the function, so its data abstraction exceeds global
variables
• A static variable obviously cannot be changed outside the function, because it is invisible
there
Unbounded for Loop
• C’s for is an unbounded iterator, because its body can change its expressions#
for $i % initial" i &% final" i '% step( ) body *
• +he first expression is initially evaluated +he body executes only once, if the last
expression is ero therwise, it repeatedly executes the last expression, while the middle
expression is true
• C’s for is an abbreviation of#
i % initial"
while $i &% final( )body" i '% step"*
Imperative Language
• .nspired by computer hardware architectures
• /ot environment functions
• /ot memory functions
8/19/2019 Programming language concepts definations
http://slidepdf.com/reader/full/programming-language-concepts-definations 2/5
eclarative Language
• !unctional" eg, 0.12
• 0ogic programming" eg, 2rolog
• 0ike the language of mathematics and abstract logic
• 1tateless• /ot environments
• $Almost( no memory functions
!ostfix
• +he postfix or reverse 2olish notation puts the operator after its operands, also without
parentheses" eg, the infix expression $a ' b( 3 $c ' d( translates into a b ' c d ' 3
• 2rogrammable 4ewlett-2ackard calculators use reverse 2olish notation
• .n both 2olish notations, one operator can apply to any number of operands
• 2olish also is easier for computers to evaluate
"eap
• 5locks grow according to the !ibonacci series" ie, slower than powers of 6
• +his offers less internal fragmentation than the buddy system
Static Chain !ointer
• 7hen a called function is declared inside the calling function $eg, fcn5 inside fcnA(, the
called function’s $5’s( static chain pointer must point at the caller’s $A’s( activation
record
• 7hen a called function is declared outside the calling function $eg, fcn5 outside fcnE(,
the caller $E( calculates the called procedure’s $5’s( static chain pointer by dereferencing
its own static chain pointer a number of times e8ual to their nested separation
ynamic Chain !ointer
• 9ariables’ current values can be stored in the stack’s activation records
• r 0.12 stores them in an association $linked( list for each environment Each branch is
labeled with a variable name, and its leaves include type, location, active:inactive flag
8/19/2019 Programming language concepts definations
http://slidepdf.com/reader/full/programming-language-concepts-definations 3/5
efinitions
; #epresentational gap# 0owered by ob<ect and operation names echoing re8uirements
6 Visibility# 7herever an ob<ect’s declared value can be seen= Scoping rules# 4ow coders predict where an ob<ect’s declared value can be seen> $liases# Multiple pointer names referring to a single ob<ect
? !arameter# An ob<ect possibly renamed inside a function
@ Language layers# 2rogramming languages whose abstraction increases as they range
farther away from the computer hardware
%peration# An - method $verb(B !hysical machine# Computer hardware and firmware
%b&ect# An - data item $noun(
;D $bstract re'uirements# /enerally written in natural language -- prototype demos are
better
;; !ointers# 0ocations of command se8uences or data in memory
;6 ata abstraction# 2rogrammers hiding language developers’ actual ob<ects by changing
their names to nouns in the customer’s re8uirements;= !rimitive operations# 2rogramming languages’ operations, whose names are reserved
words, system functions or symbols;> Control abstraction# 2rogrammers hiding language developers’ actual operations by
changing their names to verbs in the customer’s re8uirements;? eclaration# Code segments in which programmers’ or language writers’ abstract names
are associated with memory locations
;@ (ames# Code segments in which programmers’ or language writers’ abstract names areassociated with memory locations
; Environments) Code segments in which programmers’ or language writers’ abstract
names are associated with memory locations;B (aming# declaring an ob<ect’s label upon block entry
; %b&ect creation# allocating ob<ect’s memory at runtime
6D #eference# invoking, assigning or using an ob<ect by name6; eactivation# preventing references to external ob<ects
66 #eactivation# enabling references to external ob<ects
6= Unnaming# destruction of an internal name upon block exit
6> %b&ect access# coding an abstract name reads data from memory
6? %b&ect modification# assigning abstract name stores data in memory6@ %b&ect destruction# deallocating ob<ect’s memory at runtime
6 %b&ect lifetime# ob<ect passed by value outlives assoc’n dealloc6B angling reference# deallocating an ob<ect passed by reference
8/19/2019 Programming language concepts definations
http://slidepdf.com/reader/full/programming-language-concepts-definations 4/5
%b&ect (ame *inding
• 7hen the language is designed $F'’ binds to add $((
• 7hen coder writes program $partial binding(
• At compile time $relative memory addressing(
• At daily build $absolute addresses, 1 service calls(• At runtime $all dynamic allocations--all static allocations occur earlier(
+ourteen efinitions
; Undecidability) Many important properties of programs cannot be discovered
automatically by an algorithm
6 Computability# 7e can be sure a function is computable, when we see a program
compute it
= !artiality# A function can be defined for some but not all possible arguments
> Turing completeness# All functions that can be computed by other programminglanguages also can be computed by the ultimately simple +uring Machine
? The halting problem# A static semantic analyer cannot discover an infinite loop that
depends upon user input
@ !rogramming languages, expressive power# !lexibility of use, pragmatics and
abstraction principles
Existing languages, e'uivalence# Every programming language can be interpreted into
every other
B Turing,s finite state machine# A controller that reads programs and data from a paper
tape and overwrites the tape with intermediate results and the programs’ ultimate outputs
-ore functions than algorithms# 7e 1oftware Engineers will never run out of problems
to solve
;D Church,s thesis# 7e probably never will discover an intuitively computable function that
is not programmable
;; Static semantic analy.er# A program that checks code against programming standards,
which have been shown to prevent errors
;6 ynamic semantic analy.er# A program that exposes runtime errors by executing code
in a controlled testing environment
;= !ragmatic test engineers# Artists who derive test cases from customer re8uirements,
which anticipate all operational modes
;> Software testing as art# Every combination of inputs cannot be tested, so a few benign
errors remain in every software product
/rammar# A set of correct phrases
8/19/2019 Programming language concepts definations
http://slidepdf.com/reader/full/programming-language-concepts-definations 5/5
• 0exical /Ga finite alphabet and all correctly spelled words
• 1yntaxGcorrect phrases comprised of words
• !or example, an easy-to-read recipe for cooking s8uash
Semantics# +he singular meaning $significance( of each correct phrase
• A $dictionary or thesaurus( mapping from a little known word or phrase to commonlyknown words and phrases
• A mapping from a program to the mathematical function$s( that the program represents
• !or example, an understandable definition of the word HrecipeI
!ragmatics# +he many effective ways in which programmers can use correct sentences
comprised of correct phrases
• !or example, an author may guess how cooks will use her recipe
Implementation# 1oftware and procedural language designers create processes that change
states and data
• !or example, a recipe process that transforms raw s8uash into food
Compiler) Microprogram that executes instructions one at a time
Interpreter) Machine-specific binary code that hardware executes directly