simplicity
language with a minimal set of features, with rules on how to apply them and combine them as simply and clearly as possible
orthogonality
the way different constructs can be combine, and how simple these combinations are to understand
level of abstraction
the features provided to create abstractions (C=simple with low lv of ab. while Java=not simple with high lv of ab)
portability
to what degree can the program created in the language be moved from one system to another
cost
cost of using the language in a project (development, compilation, maintenance, execution)
expressivity
how easy it is to come up with different solutions to a problem
von neuman architecture
most common form of computer architecture on modern machines
compiler
take source code and turn it into machine code
interpreter
program that takes source code and executes it
virtual machine
code is compiled into byte code (instructions are sent to a simulated computer)
syntax
how we create the program
lexicon
alphabet, rules for names, reserved words, case sensitive
grammar
rules to create valid sentences
semantics
the meaning of what is used to create the program
variable
a name of a memory location of a particular data type that can be destructively updated
binding
connection between a name and a property
memory binding
(memory allocation) process of reserving and associating with a name
static memory allocation
memory is allocated before execution by the compiler (fast runtime)
dynamic memory allocation
memory is allocated while program is running (overhead when finding memory during runtime)
process memory block
stack/heap/data/text
type binding
association of a name to a type (lexical/syntactic/semantic/translation/optimization/transcription)
static typing
name are assigned a type before the program is run
dynamic typing
name is assigned a type while the program is running
explicit vs implicit typing
if the language requires the use of a syntactic feature to specify the type then the language is explicit
scope bind
process of associating a name with he a scope
scope
region/block area in the code where names are visible
static scope
(lexical scoping) the scope of a name is defines while the code is being written with lexical features
dynamic scoping
visibility of names is determined during run time by looking at the stack activation records.
symbol table
symbol/l-value: value of the memory location that will hold the variable you want to store/r-value: actual value you want to store
expression
sequence of symbols that yields a value (arithmetic / boolean)
arithmetic expression
deals with numbers
boolean expression
deals with relational and logical expressions
operator
a syntactic feature in a language that represents a function that takes input and produces a value
unary
deals with 1 operand ex: !
binary
deals with 2 operands
ternary
deals with 3 operands ex: ?
N-ary
deals with N amount of operands
prefix
operator is place before the operands ex: + 3 4
infix
operator is place between the operands ex: 3 + 4
suffix
operator is place after the operands ex: x++
type
the … of a name is a property that describes the nature of the data associated with the name, and how it should be handled
primitive type
part of the definition of the language, not made of other types, atomic (int, float, char, bool)
user defined type
a type created by a user, mechanism used to create this type is high complexity can go from simple enumeration to abstract data types ADT
arithmetic expression
any expression that yields a numerical type ( + , - , / , ** , % )
order of evaluation
in what order are operands evaluated L>R or R>L
precedence
a mechanism to sort ambiguous expressions by creating hierarchy of operands where the position of the hierarchy determines the relative binding strength of the operator (1. expo 2. mod 3. mul/dif 4. add/sub)
parentheses
if order of evaluation and precedence yields an expression with semantics different from desired, this can be used to override and impose a particular order of operation
side effect
an expression is said to be … free (aka pure) if the evaluation results in visual change (destructive update) in memory
referential transparency
if substitution if the expression but the value it yields results in a program with the same semantics then it is…
overloading of operands
if the operand performs more than one function depending on the type ex: in java, + can be used: (int + int)addition or (str + str)concatenation
type conversion
when a program requires to convert a numerical type into another
type coercion
conversion is implicit / automatic
casting
(explicit type coercion) conversion is explicit and performed with syntactic features from the language
mixed-mode expression
an expression where then is more than one type of operand
overflow
when an arithmetic expression results in a number greater than the maximum representable number in the current data format
underflow
occurs then a floating point operation results in a number that is less than the minimum representable number (mantissa + exponent)
relational expression
greater than, less than, equal to, not equal to
logical expression
and, or, not , implication
short-circuit evaluation
lazy evaluation which given a logical operation, if the evaluation of the first operand is enough to determine the value , then the second operand is not evaluated
string
a sequence of characters usually enclosed by some syntactical delimiters ex: “ “
implementation:
array: fixed size
linked list: slow access to characters
mutability
when it is possible to change string length and content
arrays
simplest data structure in most imperative languages and are indexed sequence of elements on the same type
allocated in contiguous blocks of memory
once located, size can not be modified