Intro to Compliers

Compliers

  • Just input a program, then executable

Interpreters

  • Interpreters is online, meaning the work that it does all part of running your program.

Five phases

  • Lexical Analysis: divides program text into “words” or “tokens”
  • Parsing: to understand sentences structure
  • Semantic Analysis: try to understand the sentence meaning.
  • Optimization: automatic modify programs so that they run more fast and use less momery.
  • Code Generation: a translation into another language.

Economy

Why are there so many programming languages?

  • Application domains have distinctive/conflicting needs.

Why are there new programming languages?

  • Programmer training is the domain cost for a programming languages.
  • Widely used language are slow to change.
  • Easy to start a new language.
  • Productivity > Training cost
  • Languages adpoted to fill a void.

What is a good programming language?

  • There is no universally accepted metric for language design.
  • A good language is one people use?

COOL Overview (A language)

  • COOL – Classroom origin oriented language
  • Designed to be implementable in a short time
  • Give a taste of implementa