Lecture1 4
Lecture1 4
recipes
Each
programming
language
provides
a
set
of
primi%ve
opera%ons
Each
programming
language
provides
mechanisms
for
combining
primi%ves
to
form
more
complex,
but
legal,
expressions
Each
programming
language
provides
mechanisms
for
deducing
meanings
or
values
associated
with
computa%ons
or
expressions
Aspects
of
languages
Primi%ve
constructs
Programming
language
numbers,
strings,
simple
operators
English
words
Programming
language
well
get
to
specics
shortly,
but
for
example
3.2 + 3.2 is
a
valid
Python
expression
English
cat
dog
boy
is
not
syntac%cally
valid,
as
not
in
form
of
acceptable
sentence
Aspects
of
languages
Sta%c
seman%cs
which
syntac%cally
valid
strings
have
a
meaning
English
I
are
big
has
form
<noun>
<intransi%ve
verb>
<noun>,
so
syntac%cally
valid,
but
is
not
valid
English
because
I
is
singular,
are
is
plural
Programming
language
for
example,
<literal>
<operator>
<literal>
is
a
valid
syntac%c
form,
but
2.3/abc is
a
sta%c
seman%c
error!
Aspects
of
languages
Seman%cs
what
is
the
meaning
associated
with
a
syntac%cally
correct
string
of
symbols
with
no
sta%c
seman%c
errors
English
can
be
ambiguous
I
cannot
praise
this
student
too
highly
Programs dont have seman%c errors, but meaning may not be what was intended
Our
goal
Learn
the
syntax
and
seman%cs
of
a
programming
language
Learn
how
to
use
those
elements
to
translate
recipes
for
solving
a
problem
into
a
form
that
the
computer
can
use
to
do
the
work
for
us
Computa%onal
modes
of
thought
enable
us
to
use
a
suite
of
methods
to
solve
problems