Dana Vrajitoru
C311 Programming Languages

C311 Introduction

Why Study Languages?

Language Design

Types of Languages

Examples

Declarative Languages

Prolog examples

Imperative Languages

Compilation versus Interpretation

Execution Control

Interpretation Features

Typical Language Translation

  • The difference between interpreter and compiler is
    the complexity of the analysis and of the transformation.
  • Some languages are partially compiled (Java, Python).
  • Interpreters exist for C++, like the debuggers.
     

Compilation Phases

  • For a fully-compiled program, the virtual machine is the CPU.
  • In many cases the compilers generate assembly language instead of
    machine language (ML) which is more portable.
  • The library functions are usually precompiled.
  • Other forms of compilation: latex, printing (to PostScript).
     

Compilation Steps

Other Compilation Details

Example

int main()
{
  cout << "Hello world" << endl;
  return 0;
}

Parse Tree

Semantic Analysis