1 / 24

CSI 511 - Fall 2002

An overview of programming languages and systems concepts, including language taxonomy, design principles, and the differences between compilers and interpreters. This course is geared towards graduate students lacking a computer science undergraduate degree.

dlambert
Download Presentation

CSI 511 - Fall 2002

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSI 511 - Fall 2002 Dr. William A. Maniatty Assistant Prof. Dept. of Computer Science University At Albany Programming Languages and Systems Concepts Fall 2002 Monday Wednesday 2:30-3:50 LI 99

  2. Administrative Stuff Grading Policy • Grading Scale as per Syllabus • 2 Exams, 25 % each (Midterm and Final) • 4 Projects, 10% each • 1 Presentation 10% This is a Graduate Course, for Researchers • Oriented to CS grads lacking CS undergrad • Review Classical and Current Literature • Explore state of the art

  3. Goals of the Course What is a programming Language? • A notation used to express programs (source code) • A framework in which programs run • Compilation - Program translated into another language and executed. • Interpreter - Program is evaluated on the fly. • Not the Operating System (Run time).

  4. Prerequisites • Mathematics • Graph Theory • Combinatorics • Computer Science • Automata Theory • Computer Architecture • Data Structures/Algorithms • Miscellaneous • Technical Writing

  5. Who Should Take this Course? • To succeed you should have: • Motivation -Willing to work hard • Preparation - Have good background • Aptitude - Ability to learn and get results • Should have a B or better average in • Data Structures • Discrete Math • Computer Architectures

  6. Academic Honesty • Our reputation is all we have got. • I want my students to do well. • We Need Employer's and School's Trust • Cheaters subject to failure and sanctions. • So Protect our Reputation • Try projects early • If stuck see TA or the Prof. • Set an example and encourage integrity • Don't panic, some assignments are hard • To test limits of the best students.

  7. Design Principles • Technical Factors • Ease of use • Problem type (Form Follows Function) • Expressiveness (How general is it?) • Ease of writing good interpreter/compiler • Performance • Flexibility/Evolution (established languages) • Non Technical Factors • Inertia • Large Supporters/Visibility (new languages) • Compiler/Interpreter Availability • Personal Preference/Evangelism

  8. Programming Language Taxonomy • Imperative (Focus on Control Flow) • Procedural (von Neuman) • Object Oriented • Declaritive • Functional • Data Flow • Logic, Constraint Based

  9. Imperative Languages • Focus on Control Flow (Instructions) • Procedural (von Neumann) • Describes Actions on data • Assembly, Fortran, Basic, Pascal, C, Bourne Shell • Object Oriented • Language Support for Grouping Data and Operations Together (Encapsulation) • Simula 67, Small Talk, C++ (Hybrid), Eiffel, Java

  10. Declarative Languages • Declarative = Data Driven • Functional - Based on Churches Lamda Calculus: Lisp, ML, Haskell • Data Flow -Pipelined data operations • Logical, Constraint Based - Give rules and initial condition, derive path to goal. • Prolog and Spread Sheets (Visicalc/Lotus/Excel) • Relational -Database Query - SQL

  11. Why Should I study Programming Languages? • To allow Informed Design Decisions • Gives insight when debugging • Permits effective use of compilers/linkers interpreters and language oriented tools. • Helps to understand how langauge features work. • Learn features, emulate missing features.

  12. Binding Time • Binding assigns values to language objects • Instruction Addresses • Data Values • Data Addresses • Binding can be • Early - Performance improved • Late - Increased Flexibility

  13. Compilers Vs. Interpreters • Is Translation Separate from Execution? • Yes -Compiler • No - Interpreter • Combined Approach Often Used (Java)

  14. Why Interpret? • Flexibility (provided by late binding) • Run Time Environment Support • Scripting (Perl, Shells, Python,TCL) • Dynamic Environments (Basic, APL, LISP) • Virtual Machines (JVM, Emulators, CPUs).

  15. Why Compile? • Fundamental Engineering Principles • Correctness -Early static error checking • Cost -Can reduce cost of code distribution • Performance - Make the common case fast • Compile Once (Cost) , Run Many Times (Benefit)

  16. Multi-Pass Compilers • How to handle complexity? • Libraries (keep language simple, e.g. Java) • Layering (Focus on one problem at a time) • Results in Multiple (pipelined) phases

  17. Intermediate Code • Some Optimizations easier at that level • Portability Easier (Pascal) • Intermediate Code Can be Interpreted

  18. Target Languages • Many compilers emit assembly code • Can be highly optimized • Others emit higher level langauges • Exploits existing optimizers • Increases Portability, reduces complexity

  19. Phases of Compilation • Layering induces phases of compilation

  20. An Example • Consider the Pascal Program

  21. Syntax Analysis (Front End) • Scanning identifies terminals (tokens) • Parsing identifies nonterminals

  22. Semantic Analysis • Semantic Analysis is back end • Uses Abstract Syntax Tree (AST)

  23. Optimization • Goal: Reduce Resource Consumption • Memory (data and/or instructions) • Run Time • Golden Rule: Never break working code. • Sad Truth: Most programs are broken. • No guarantees about broken programs

  24. Summary • We will focus on imperative languages • They are by far more common • But we will look at Declaritive approaches too • Want to understand design and implementation • Explore common techniques • Often with imperative language application

More Related