attempts to
play

Attempts to A means of formal and exact communication define a - PowerPoint PPT Presentation

A tool for humans to tell the computer what to do Attempts to A means of formal and exact communication define a between humans Programming A way of describing an abstract machine Language A way of describing computation that


  1. ● A tool for humans to tell the computer what to do Attempts to ● A means of formal and exact communication define a between humans Programming ● A way of describing an abstract machine Language ● A way of describing computation that is readable by both man and machine 18

  2. ● Reasons to study programming languages – Learning new programming languages Why – Borrowing ideas from other languages programming – Ability to express ideas languages? – Choice of programming language – Understanding the implementation behind languages – Designing your own "programming language" 19

  3. ● "Theory of programming languages" – Syntax, value/reference semantics, type 3 topics of systems, language design criteria the course ● Programming issues – Paradigms, typing, variable lifetimes, parameter passing, type inference... ● "Looking under the hood" – How compilers/interpreters work (on general level) – Data representations, memory allocation, activation records, machine language, virtual machines, binary compatibility... 20

  4. ● "Good engineering involves compromise at every turn. A good, working, finished product MOTTO is never pure by the standards of any one idiom or methodology. The art of good engineering is not the art of discovering and applying the one right idiom over all others. The art of good engineering is to know what your options are, and then to choose your trade-offs wisely rather than letting others choose them for you." ● http://www.artima.com/cppsource/ type_erasure.html 21

  5. Design issues: 1. simplicity, regularity, uniformity Design of 2. orthogonality languages 3. expressiveness 4. support for software engineering practices 5. efficiency 6. error detection and debugging, safety 7. correctness 8. standardization 9. recently: ecosystem : libraries, editors, debuggers, ... 22

  6. ● No language exists in vacuum, languages: ● are often based on other languages History of ● steal features from other languages languages ● try to steal programmers from other languages ● try to fix stupid features in other languages 23

  7. ● Languages often evolve ● Need for new features, fixing old errors Evolution ● Downwards compatibility is a problem! ● Compromises: added complexity, lack of orthogonality... ● deprecated/compatability features, e.g., C+ + auto_ptr, register-keyword ● New features get adopted, e.g. type inference (compiler deduces types of variables etc. instead of having to write types explicitly) is spreading to mainstream languages 24

  8. ● An (imaginary) machine that can execute programs in a certain language Abstract ● A way of specifying the semantics (meaning) of machines the language ● Hardware machine + compiler ● Intermediate (virtual) machine + compiler ● Pure interpreter "The semantic descriptions in this International ● Standard define a parameterized nondeterministic abstract machine. ... conforming implementations are required to emulate (only) the observable behavior of the abstract machine..." (C++14 standard draft, 1.9/1) 25

  9. ● Expressiveness – Efficiency ● Intuitiviness – Implementability Compromises ● Intuitiviness – Unambiguousness in languages ● Unambiguousness – Optimisability ● Flexibility – Checkability ● Portability – Efficiency ● Generality – Ease of expression 26

  10. ● Interpreted – Dynamic typing Compiled vs. – Portability interpreted – Run-time error checking – Flexibility ● Compiled – Static typing – Machine dependent – Error checking by compiler – Efficiency These are the two extremes. In many languages we are often somewhere between! 27

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend