Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
34 views

Programming Languages - Design - Implementation

The document provides an overview of programming languages, including their design, implementation, and goals. It discusses understanding how languages are structured with their syntax, semantics, and implementation. It also summarizes the most appropriate languages for different types of problems, such as procedural, object-oriented, functional, and rule-based languages. Finally, it outlines why studying programming languages is important and attributes of effective languages.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Programming Languages - Design - Implementation

The document provides an overview of programming languages, including their design, implementation, and goals. It discusses understanding how languages are structured with their syntax, semantics, and implementation. It also summarizes the most appropriate languages for different types of problems, such as procedural, object-oriented, functional, and rule-based languages. Finally, it outlines why studying programming languages is important and attributes of effective languages.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

PROGRAMMING

LANGUAGES – DESIGN
& IMPLEMENTATION
PREPARED BY:

ORLANDO C. CABILLOS
INSTRUCTOR
ORGANIZATION OF PROGRAMMING
LANGUAGES

• Understand how languages are designed and implemented

• Syntax -- What a program looks like


• Semantics -- What a program means
• Implementation -- How a program executes

• Understand most appropriate language for solving specific problems, For example:
• Pascal, C -- procedural, statement oriented
• C++, Java, Smalltalk -- Object oriented
• ML, Lisp -- Functional
• Prolog -- Rule-based
Language Goals
• During 1950s--1960s - Compile programs to execute efficiently.
• There is a direct connection between language features and hardware - integers, reals, goto
statements
• Programmers cheap; Machines expensive; Keep the machine busy

• But today
• Compile programs that are built efficiently
• CPU power and memory very cheap
• Direct connection between language features and design concepts - encapsulation, records,
inheritance, functionality, assertions
Why study programming languages?
• To improve your ability to develop effective
algorithms
• Improper use of recursion
• Object-oriented programming, logic programming, concurrent programming

• To improve your use of your existing programming


language
• Data structures for arrays, strings, lists, records
• Implementation details of recursion, object classes, subroutine calls, …
..cont….Why study programming
languages?
• To increase your vocabulary of useful
programming constructs
• Increase programming vocabulary and its implementation tech.
• Coroutine

• To allow a better choice of programming language


• Numeric computation : C, FORTRAN, Ada
• AI : LISP, Prolog
• Internet applications : Perl, Java
..cont….Why study programming
languages?
• To make it easier to learn a new
language
• To make it easier to design a new
language
• User interface design

• C / C++, COBOL, SMALLTALK


Additional Reference
Evolution of software architecture
• 1950s - Large expensive mainframe computers ran
single programs (Batch processing)
• 1960s - Interactive programming (time-sharing) on
mainframes
• 1970s - Development of Minicomputers and first
microcomputers. Apple II. Early work on windows,
icons, and PCs at XEROX PARC
• 1980s - Personal computer - Microprocessor, IBM PC
and Apple Macintosh. Use of windows, icons and
mouse
• 1990s - Client-server computing - Networking, The
Internet, the World Wide Web
• 2000s - ??? P2P
Attributes of a good language)

• Clarity, simplicity, and unity - provides both


a framework for thinking about algorithms and
a means of expressing those algorithms
• APL
• SNOBOL4

• Orthogonality -every combination of features


is meaningful
• Fewer exceptions
• Logical errors and inefficiency
cont…. Attributes of a good language

• Naturalness for the application - program


structure reflects the logical structure of
algorithm
• Sequential algorithm, concurrent algorithm, logic algorithm, non-
deterministic algorithm
• Appropriate data structures, operations, control structures, natural
syntax

• Support for abstraction - program data reflects


problem being solved
• Data abstraction <D,O,C>
• Encapsulation
cont…. Attributes of a good language
• Ease of program verification - verifying that
program correctly performs its required
function
• Verification/validation
• Comments, assert()
• Design specification

• Programming environment - external support for


the language
• Debugger, syntax-directed editor
• Supporting function, platforms
• Smalltalk
• Supporting all the software lifecycle phases
cont…. Attributes of a good language
• Portability of programs - transportability} of
the resulting programs from the computer on which
they are developed to other computer systems
• Transportability
• C, C++, Pascal, Java
• ML : single source implementation

• Cost of use - program execution, program


translation, program creation, and program
maintenance
• Code optimization, (Smalltalk, Perl), lifecycle costs
Language paradigms
• Imperative languages
• Goal is to understand a machine state (set of memory
locations, each containing a value)
• Statement oriented languages that change machine state
(C, Pascal, FORTRAN, COBOL)
• Syntax: S1, S2, S3, ...
• Applicative (functional) languages
• Goal is to understand the function that produces the
answer
• Function composition is major operation (ML, LISP)
• Syntax: P1(P2(P3(X)))
• Programming consists of building the function that
computes the answer
Language paradigms (continued)
• Rule-based languages
• Specify rule that specifies problem solution (Prolog,
BNF Parsing)
• Other examples: Decision procedures, Grammar rules
(BNF)
• Syntax: Answer  specification rule
• Programming consists of specifying the attributes of
the answer

• Object-oriented languages
• Imperative languages that merge applicative design with
imperative statements (Java, C++, Smalltalk)
• Syntax: Set of objects (classes) containing data
(imperative concepts) and methods (applicative
concepts)
The end!

You might also like