martes, 23 de agosto de 2016

Making Compiler Design Relevant for Students who will (Most Likely) Never Design a Compiler

This week lecture was about how compilers phases (lexical, semantic.. etc) can be used in other kinds of activities. The paper is called "Making Compiler Design Relevant for Students who will (Most Likely) Never Design a Compiler" by Saumya Debray of the Department of Computer Science of the University of Arizona.
The concept behind the word "compiler" can be very difficult to express, throughout the major of Computer Sciences this word comes up quite a lot.  We use it but we don't fully understand it, that why this paper is so important, it clarifies the concept by defining the phases that it has to go through in order to become a compiler.
The first phase is the "lexical analysis" which takes an input and separates it in characters, and then they are parsed into groups of "tokens", that means, it takes the input, read it character by character and then grouped into a set of characters that mean something.
The second phase is the "semantic analysis", makes associations in a tree way, it links the defined variables with the same ones below in the code, so it knows what type the variable is, and how to used it, in other words it shows how it flows the information inside the input received.
The third phase is the "code generation" in which the tree generated in the previous phase is translated into assembly or machine code.
The fourth and last phase is the "Optimization" in which the compiler tries to optimize you code, that means, to make it run faster. It reduces  the cost of the generated code for some cost measure of interest.
In conclusion, this phases can be used in several similar processes like the construction of a program where you read some kind of input, process it and generate some kind of output, that means that you can use apply it in many cases.

If you are interested in reading this paper, here's the link: Making Compiler Design Relevant for Students.

No hay comentarios:

Publicar un comentario