Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages - PowerPoint PPT Presentation

About This Presentation
Title:

Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages

Description:

Lecture 1: Overview, Grammars, and Little Languages. Jeremy R. Johnson (Guest ... All work must be completed independently unless explicitly stated other wise. ... – PowerPoint PPT presentation

Number of Views:343
Avg rating:3.0/5.0
Slides: 17
Provided by: JeremyR91
Category:

less

Transcript and Presenter's Notes

Title: Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages


1
Programming Language Concepts(CS 360)Lecture
1 Overview, Grammars, and Little Languages
  • Jeremy R. Johnson
  • (Guest Lecturer)

2
Basic Info
  • Instructor
  • Sam Moelius
  • Email smoelius_at_cs.drexel.edu
  • Office Hours TBD
  • Text
  • Concepts of Programming Languages, 5th Ed.
  • Robert W. Sebesta
  • Addison Wesley
  • Web Page
  • TBD
  • Mailing List
  • TBD

3
Course Description
  • Introduces the design and implementation of
    modern programming languages formal theory
    underlying language implementation concerns in
    naming, binding, storage allocation and typing
    semantics of expressions and operators, control
    flow, and subprograms procedural and data
    abstraction functional, logic, and
    object-oriented languages. Students will
    construct an interpreter for a non-trivial
    language.

4
Course Prerequisites
  • CS 171 (Prog. I), 172 (Prog. II), and 260 (Data
    structures)
  • Comfortable with an object-oriented language
    (ideally should have seen at least two languages)
  • Ideal
  • CS 281 (Systems Architecture I) understanding
    of the underlying of basic computer architecture
    (assembly language, machine organization)
  • CS 270 (Foundations of Computer Science) should
    be comfortable with the mathematical tools used
    to describe and analyze programming languages
    (logic, recursion material on finite state
    machines and grammars useful but will be covered
    in this class)

5
Course Themes
  • Tools to evaluate design of languages
  • Tools for describing and analyzing languages
  • syntax
  • semantics
  • Tools to design new languages
  • Programming Paradigms
  • Implementation of programming languages

6
Course Objectives
  1. Understand how to compare and evaluate different
    programming languages and know what factors need
    to be taken into account.
  2. Be comfortable with the major programming
    paradigms and be able to use at least one
    language from each paradigm.
  3. Understand some of the issues involved in
    implementation of programming languages this
    should help them program more efficiently.
  4. Be familiar with elementary concepts of formal
    language theory such as context-free grammar.
  5. Be able to formally specify the syntax of
    programming languages.
  6. Be familiar with the essentials of lexical
    analysis and elementary parsing procedures.
  7. Understand dynamic and static scope, dynamic and
    static binding and the issues they give rise to.
  8. Understand the advantages and disadvantages of
    strong/weak type checking.
  9. Understand the different methods of parameter
    passing and how they might be implemented and
    understand some of the issues involved in calling
    subroutines.
  10. Understand generic programming.

7
Tentative Topics
  • Week 1 Overview and introductions to grammars
    (ch. 1 3)
  • Week 2 Functional Languages (ch. 15)
  • Week 3 Logic Programming Languages (ch. 16)
  • Week 4 Syntax, Types, Scanning, and Parsing (ch.
    3-5)
  • Week 5 Midterm (more on types and type checking)
  • Week 6 Data types and Memory allocation (ch. 6)
  • Week 7 Program semantics and interpreters (ch.
    3)
  • Week 8 Control Structures. Iteration versus
    Recursion and their implementation. Templates in
    C and generic programming and its advantages
    and pitfalls (ch. 7-9).
  • Week 9 Subroutines and Parameter Passing
    Methods, Implementing subroutines (ch. 9-10).
  • Week 10 Abstract data types and object-oriented
    programming (ch. 11-12)

8
Course Benefits
  • Easier to express ideas
  • Improved background for selecting appropriate
    languages
  • Easier to learn new languages
  • Understand the significance and impact of
    language choices and constructs
  • Design new languages (little languages, interface
    specifications, protocols)
  • Overall advancement of computing

9
Grading Policy
  • Assignments (Programming Description
    Evaluation)
  • 5 _at_ 10 each
  • Midterm Exam
  • 25
  • Final Exam
  • 25
  • Grades will be determined using a curve with the
    weighted average equal to a B provided the
    average shows understanding of the material.
  • All work must be completed independently unless
    explicitly stated other wise. Not following this
    rule is subject to receiving a 0 for the first
    offense and subsequent offenses may lead to a
    lower or failing grade.

10
Outline (Ch. 1)
  • Programming Domains
  • Programming Paradigms
  • Language Evaluation Criteria
  • Readability
  • Writability
  • Reliability
  • Cost
  • Influences on language design
  • Computer architecture
  • Programming methodologies
  • Language categories
  • Imperative
  • Functional
  • Logic
  • Object-oriented
  • Implementation methods
  • Interpreter
  • Compiler
  • Hybrid

11
Programming Domains
  • Scientific Computing
  • FORTRAN
  • C, C
  • Matlab, Maple, Mathematica
  • Business Applications
  • COBOL
  • Spreadsheet, DB, SAP
  • Systems Programming
  • assembly
  • PL/S, BLISS, C
  • Scripting Languages
  • sh, ksh, bash
  • awk, perl, python
  • Artificial Intelligence
  • lisp, prolog
  • Special-purpose languages

12
Programming Paradigms
  • Imperative (procedural)
  • Algol, C, FORTRAN, Pascal
  • Data Abstraction
  • Modula-2
  • Object Oriented
  • Simula 67, Smalltalk, C, java, Ada 95, Eiffel
  • Functional
  • Lisp, Scheme, ML
  • Logic (declarative rule based)
  • prolog
  • Parallel
  • Hardware Description Languages
  • Markup
  • Special-purpose

13
Evaluation Criteria
  • Readability
  • Simplicity
  • Orthogonality
  • Control statements
  • Appropriate data types
  • Syntax considerations
  • Writability
  • Simplicity and orthogonality
  • Support for abstraction
  • Expressivity
  • Reliability
  • type checking
  • exception handling
  • Aliasing
  • Cost
  • readability and the learning curve
  • writability and naturalness of the language for
    the application
  • compilation and execution time

14
Compilation
Source Program
Results
Lexical Analyzer
Computer
User Inputs
Lexical Units
Syntax Analyzer
Machine Language
Code Generator
Parse Tree
Intermediate Code Generation
Symbol Table
Optimizer
Intermediate Code
15
von Neumann Architecture
  • Fetch-Execute Cycle
  • Initialize PC, Registers
  • Repeat
  • Fetch Instruction
  • Increment PC
  • Decode Instruction
  • Execute Instruction

Memory
Control
ALU
I/O
CPU
16
Interpretation
Source Program
Interpreter
User Inputs
Results
Write a Comment
User Comments (0)
About PowerShow.com