170 likes | 429 Views
Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages. Jeremy R. Johnson (Guest Lecturer). Basic Info. Instructor Sam Moelius Email: smoelius@cs.drexel.edu Office Hours: TBD Text Concepts of Programming Languages, 5 th Ed. Robert W. Sebesta
E N D
Programming Language Concepts(CS 360)Lecture 1: Overview, Grammars, and Little Languages Jeremy R. Johnson (Guest Lecturer) Programming Language Concepts
Basic Info • Instructor • Sam Moelius • Email: smoelius@cs.drexel.edu • Office Hours: TBD • Text • Concepts of Programming Languages, 5th Ed. • Robert W. Sebesta • Addison Wesley • Web Page • TBD • Mailing List • TBD Programming Language Concepts
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. Programming Language Concepts
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) Programming Language Concepts
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 Programming Language Concepts
Course Objectives • Understand how to compare and evaluate different programming languages and know what factors need to be taken into account. • Be comfortable with the major programming paradigms and be able to use at least one language from each paradigm. • Understand some of the issues involved in implementation of programming languages; this should help them program more efficiently. • Be familiar with elementary concepts of formal language theory such as context-free grammar. • Be able to formally specify the syntax of programming languages. • Be familiar with the essentials of lexical analysis and elementary parsing procedures. • Understand dynamic and static scope, dynamic and static binding and the issues they give rise to. • Understand the advantages and disadvantages of strong/weak type checking. • Understand the different methods of parameter passing and how they might be implemented and understand some of the issues involved in calling subroutines. • Understand generic programming. Programming Language Concepts
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) Programming Language Concepts
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 Programming Language Concepts
Grading Policy • Assignments (Programming & Description & Evaluation) • 5 @ 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. Programming Language Concepts
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 Programming Language Concepts
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 Programming Language Concepts
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 Programming Language Concepts
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 Programming Language Concepts
Compilation Source Program Results Lexical Analyzer Computer User Inputs Lexical Units Syntax Analyzer Machine Language Code Generator Parse Tree Symbol Table Intermediate Code Generation Optimizer Intermediate Code Programming Language Concepts
von Neumann Architecture • Fetch-Execute Cycle • Initialize PC, Registers • Repeat • Fetch Instruction • Increment PC • Decode Instruction • Execute Instruction Memory Control ALU I/O CPU Programming Language Concepts
Interpretation Source Program Interpreter User Inputs Results Programming Language Concepts