Making compiler design relevant for students who will (most likely) never design a compiler.

Imagine preparing yourself for over six months to fight dragons and at the time to go fight one you realized someone else has already kill them all. Does all the learned knowledge has being a waste of time? Wait and read.

In computer science our dragon is our compiler, and we will learn how to design one without necessary designing one, the importance lies on the principles, techniques, and tools discussed in compiler design courses that are applicable to a wide variety of situations.

The execution of a compiler conceptually consists of four phases:

  • Lexical analysis and parsing: we examine the input to be translated dividing in groups of adjacent characters, called tokens which form the units for the remainder of the translation process.
  • Semantic analysis: refers to the computation and propagation of information that is not part of the context-free syntax of the language.  A common way of handling such information is using "attribute grammars," which associate properties ("attributes") with grammar symbols and specify rules, called semantic rules, for computing their values.
  • Code generation: is the process of traversing the tree representation of a program to generate assembly or machine code for the target machine. Like an instance of the process of translating from a representation of a source language entity to that of a corresponding target language entity.
  • Code optimization: aims to reduce the "cost" of the generated code for some cost measure of interest. Traditionally, the cost measure most often used has been execution time; however, even within mainstream compiler research, other measures of cost have recently been gaining credence: these include code size (for limited-memory processors, e.g., in embedded and mobile systems) and energy usage (e.g., for battery-operated portable computers).

Compiler design courses are applicable to a wide variety of situations besides designing a compiler, it's fair to say that not all students will be involved in the design of a compiler. However, the tools and skills these courses provide are reason enough to include them in the computer science students classes.

References:
http://34.212.143.74/s201913/tc3048/making_compiler_design_relevant_for_students.pdf




Comentarios

Entradas populares