Vous êtes sur la page 1sur 4

Lectur e 1 T he Pr ogr amming Langua ge Landscape

Why Study Languages?


History of Language Development
Language Evaluation Criteria
Language Influences
Hardware/Software Equivalence
Interpreters vs. Translators
Software Development as Domain Language Design
Language Execution Models
Binding Times
Language (programming) Paradigms

W hy Study Languages?
"The limits of my language are the limits of my world." -- Ludwig Wittgenstein
lot's of reasons
to be able to "say it well"
REALLY understand all features
good AND bad; no perfect languages
increase your "vocabulary"
easier to learn new languages
learn to design your own "little languages"

Histor y of Langua ge Development


One view of the history of computer science / programming
Evolution of ideas
Understand language in the context of the times
what was important? what was hard?
Language "family tree" (language ancestry)
A little drama: good ideas don't always win!
Some interesting personalities
Things change VERY quickly!

Language Evaluation Criteria (Is it good?)


WARNING: this is a religious topic for some people!
Factors (Sebesta)
readability (maintenance easy)
writability (programming easy)
reliability (debugging easy)
cost (paying for everything easy)
here's another list (Pratt/Zelkowitz)
clarity (simplicity, unity)
orthogonality
naturalness for application
support for abstraction
Language Evaluation Criteria (Is it good?)
ease of verification
environment
portability
more features (writability) => harder to learn (cost)
strong type checking (reliability) => limits flexibility (writability)
cost should be broadly understood
learning costs
coding costs
compilation costs
runtime overhead
maintenance costs
portability costs
buying, space??

Reliability

If it performs to its specifications under all conditions


Factors:
Type checking
Exception handling
Aliasing
Readability and writability
Language Influences
hardware architecture
programming methodologies
standardization (formal or defacto)
importance of application domain
strong promoter (usually an organization)
easy access to high quality compilers and tools

Har dwar e/Softwar e Equivalence


hardware and software are fundamentally interchangeable
hardware can be viewed as IMPLEMENTING a language (instruction set)
software can be viewed as EXTENDING the machine instruction set
software can be used to create a VIRTUAL COMPUTER
a programming language defines an ABSTRACT MACHINE
example:
early RISC chips had no multiply instruction (emulated)

Inter pr eter s vs. Tr anslator s (Compiler s)


interpreters run program
translator (compilers) transform programs from one form to another
the CPU is a hardware interpreter; it actually does something
hybrid systems: compile to byte-code, interprete byte-code

Softwar e Development as Domain Language Design


view software development as designing a special, domain-specific language!
procedures, objects are language "primitives"
application: compose domain-appropriate primitives
semantic gaps:
domain primitives <-> actual programming language
programming language <-> hardware
many "domain-specific" languages: Postscript, SQL
Language Execution Models (Semantics)
languages (usually) have an implied execution model
what does a for-loop actually do?
what does it mean to call a method in Java?
what happens when I do a type cast in C?
examples
the SQL "virtual machine": join, project, select
sending "messages" in Smalltalk
the "activation stack" in procedural languages
Binding Times
when do things actually happen? when are they set?
run time  "late" binding, more flexible, complex
compile time  "early" binding, more efficient, simple
(language implementation time)
(language definition time)
examples:
type checking
error detection
array size

Language (pr ogr amming) Par adigms


various ways to categorize or classify languages
often related to programming styles (techniques, paradigms)
imperative (procedural)
Fortran, Cobol, Basic, Algol, Pascal, C, Modula, Ada
influence: machine architecture
model: moving bits around, changing machine state
functional (applicative)
Lisp, Scheme, Miranda, Sisal, Haskell, APL, ML
influence: mathematics, lambda calculus

Language (pr ogr amming) Par adigms


model: evaluation, function or operator evaluation (application)
rule-based (declarative, logic, production/constraint systems)
Prolog
influence: logic, predicate calculus
model: proof, deduction / matching, backtracking
object-oriented
Simula, Smalltalk, Eiffel, Objective-C, C++, Java
influence: simulation, modeling, games
model: message-passing, interacting objects (properties, behaviors)
Language (pr ogr amming) Par adigms
languages SUPPORT (not require) style or paradigm
you can write "objects" in C
you make C++ look like Fortran
you can write "functional Java"
language "levels"
low-level: machine, assembly
high-level: general purpose, domain-specific
very-high level: application generators, scripting langauges
common domains
scientific computing
business applications
systems programming
artificial intelligence
parallel/distributed
real-time
embedded systems

Vous aimerez peut-être aussi