1 / 10

CS 331, Principles of Programming Languages

CS 331, Principles of Programming Languages. Chapter 1. Objectives. To introduce several different paradigms of programming To gain experience with these paradigms by using example programming languages To understand concepts of syntax, translation, abstraction, and implementation.

isabelm
Download Presentation

CS 331, Principles of Programming Languages

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. CS 331, Principles of Programming Languages Chapter 1

  2. Objectives • To introduce several different paradigms of programming • To gain experience with these paradigms by using example programming languages • To understand concepts of syntax, translation, abstraction, and implementation

  3. Paradigms of Programming? • There are several ways to think about computation: • set of instructions to be followed • set of expressions to be evaluated • a set of rules to be applied • a set of objects to be rearranged • a set of messages to be sent and received

  4. Some Programming Paradigms • Procedural • examples: C, Pascal, Basic, Fortran • Functional • examples: Lisp, ML • Object-oriented • examples: Simula, C++, Java • Rule-based • example: Prolog

  5. Why so many? • Most important: the choice of paradigm (and therefore language) depends on how humans best think about the problem • Other considerations: • efficiency • compatibility with existing code • availability of translation

  6. Models of Computation • RAM machine • procedural • DAGs • Smalltalk model of O-O • partial recursive functions • Lisp • Markov algorithms • Prolog is loosely based on these

  7. Lots of Languages • There are many programming languages out there • Lots of other PL-like objects • document languages, e.g. LaTeX, Postscript • command languages, e.g. csh, MATLAB • specification languages, e.g. Z, UML

  8. Translation • Compilation • Translate into instructions suitable for some other (lower level) machine • During execution, that machine maintains program state information • Interpretation • May involve some translation • Interpreter maintains program state

  9. Trade-offs • Compilation • lower level machine may be faster, so programs run faster • compilation can be expensive • examples: C (and maybe Java?) • Interpretation • more ability to perform diagnostics (or changes) at run-time • examples: Basic, shells, Lisp

  10. Web resources • Programming language research • http://www.cs.cmu.edu/afs/cs.cmu.edu/user/mleone/web/language-research.html • Free compilers and interpreters • http://cuiwww.unige.ch/OSG/info/FreeComp/fc/categorie.html

More Related