Programming Languages definitions

5.0(1)
studied byStudied by 29 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/56

flashcard set

Earn XP

Description and Tags

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

57 Terms

1
New cards
programming language
A formal language which comprises a set of instructions that produce various kinds of output. Consists of instruction for computers
2
New cards
Program
instructions for a computer to execute
3
New cards
high-level language
Language that allows you to write precise instructions in a human-readable form
4
New cards
Program Design
Design of a language driven to fix a problem
5
New cards
Program Philosophy/Paradigm
* Imperative (Procedual)
* Declarative (Functional)
* Logical/Constrained-based (OOP)
6
New cards
Computer Architecture
Language must be made to work how the hardware architecture works
7
New cards
Language Implementation Technology:
Compilers, Interpreters, Virtual Machines
8
New cards
Compiler:
Translates source code into executable machine code run directly by the hardware
9
New cards
Interpreter:
Reads and executes each line of code as it reads it during run time.
10
New cards
Virtual Machine
Executes a compiled intermediate level code, byte code, which is interpreted by the virtual machine
11
New cards
Desirable design features of a language:
* Simplicity
* Orthogonality
* Level of Abstraction
* Portability
* Cost \*Expressiveness
12
New cards
simplicity
Feature set is short and to the point
13
New cards
Orthogonality:
Different factors combine to produce something meaningful
14
New cards
level of abstraction:
The amount of complexity by which a system is viewed or programmed. Higher level, less detail. Lower level, more detail.
15
New cards
Portability
Ability to move program from one system to another
16
New cards
Expressivity
The amount of ways that the same problem can be solved.
17
New cards
Memory Allocation
* Static Allocation
* Dynamic Allocation
18
New cards
Static Allocation:
Memory is allocated at compilation time (predetermined)
PROS:
*Faster
CONS:
*Needs to know amount of memory in advance
*Prone to memory waste
19
New cards
Dynamic Allocation:
memory space is only allocated when required at runtime.
PROS:
*Do not need to know amount of memory in advance
*Use only what is needed
CONS:
*Slower
20
New cards
Memory Allocation Implementation:
* Compiler: Static and Dynamic


* Interpreter: Dynamic


* Virtual Machine: Static and Dynamic
21
New cards
Names:
User generated ID's (function names, class names, variable names)
22
New cards
case sensitive:
Distinguishing upper- and lowercase characters. Easier to
implement.
23
New cards
case-insensitive:
Both the uppercase and lowercase forms of a character are considered by a computer program to be the same
24
New cards
reserved words
Words that have predefined meanings that cannot be changed.
*Keywords: private, void, static, etc.
25. Identifiers: names given to entities, such as variables, functions, structures,
etc.
25
New cards
Variable:
Location in memory that is subject to destructive update which is bound to a name. Value can change overtime.
26
New cards
L-Value:
address location of variable in memory
27
New cards
R-value:
Actual value that is stored in the memory address location
28
New cards
Aliasing
One part of memory has multiple names leading to it
29
New cards
Symbol Table
A data structure that links names to information about the objects denoted by the names. Keeps track of binding between name and memory
locations.
30
New cards
Storage
*Statically Allocated Variables
*Dynamically Allocated Variables
31
New cards
Binding
the association of a name with a variable or value. Also, the time when
it happens
32
New cards
Types of binding
*Static binding
*Dynamic binding
33
New cards
Static Binding:
Binding performs before program runs
34
New cards
Dynamic Binding:
Binding performs while program is running
35
New cards
Static Typing:
Types are checked before program runs
PROS:
*Faster Execution time
*Readability in increased
CONS:
*No flexibility
*More initial overhead
36
New cards
Dynamic Typing:
Types are checked while program is running
PROS:
*Flexibility (no need to explicitly write type annotation)
*Less initial overhead before deployment
CONS:
*Slower Execution Time
*Decreased Readability
37
New cards
Type annotation:
*Explicit
*Implicit
38
New cards
Explicit Typing:
Language demands the programmer explicitly state type
39
New cards
Implicit Typing:
Language does no demand explicit denotation of data
40
New cards
Destructive Updates
Any change to a memory location that replaces the current value
41
New cards
Scope
Region in program in which the lifetime of a name is defined. Lexical region in which a name is visible/usable
*Nested functions
*Blocks
*Order of declaration
*Global variables
42
New cards
Static Scope
Region is defined using lexical features, delimiters.
*A region in a text of the program
*Implemented using "blocks"
43
New cards
Dynamic Scope
: Value is determined by the identifier associated with the most
recent environment
44
New cards
Scope Blocks:
Lexical region in program where a name is visible
45
New cards
Constants:
Value can not be changed
46
New cards
Data Types:
Primitive Data Types
*Integral numbers
*Floating point numbers
*Boolean types
*Character
47
New cards
Integral Numbers:
Int: 32 bits \= 4 bytes
Byte: 8 bits \= 1 byte
Short: 16 bits \= 2 bytes
Long: 64 bits\= 8 bytes
48
New cards
floating point numbers:
Float: 32 bits \= 4 bytes
Double: 64 bits \= 8 bytes
49
New cards
Boolean type
Boolean: 8 bits \= 1 byte
bool: 8 bits \= 1 byte
50
New cards
Character:
character: 8 bits \= 1 byte
char: 8 bits \= 1 byte
51
New cards
string type:
-a string is a sequence of characters
-the String type is used to declare variables that store strings
-is not a primitive type: it is known as a class or reference type
-one or more characters in double quotes
-strings as character arrays
52
New cards
Types of strings:
-Dynamic size up to a bound (array)
-Constant size (immutable)
53
New cards
Pointer
Special variables that allow access to l-values of memory locations
54
New cards
Syntax
the rules for combining words into grammatically sensible sentences
in a given language
55
New cards
Semantics:
the set of rules by which we derive meaning from morphemes,
words, and sentences in a given language; also, the study of meaning
56
New cards
lexicon:
Valid words of the language. A dictionary; a specialized vocabulary
used in a particular field or place
57
New cards
grammar:
a set of rules that specify how the units of language can be combined to produce meaningful messages and sentences.