Entry #2: Making Compiler Design Relevant for Students

“Making Compiler Design Relevant for Students who will (Most Likely) Never Design a Compiler“ is an article written by Saumya Debray in which he invites the students to understand why the Compiler Design course is so important and explains that the professors should teach in a way that their students develop skills instead of the idea of just teaching knowledge.

The article shows that a compiler can be seen as a translator or as a process that can transform data expressed in one language into the same data expressed in another language. This comparison illustrates the similarity of the behavior, but also considering all the technical translation problems that can be found in common components of a language, such as ambiguity, context, and metaphors.

Based on this idea of a translator, we can better understand the phases that need to be executed to obtain a result these are: Lexical Analysis and Parsing, Semantic Analysis, Code Generation, and Code Parsing.

The Lexical Analysis divides the input into groups of adjacent characters called 'tokens'. Then, the Syntax Analysis is constructing sentences from the sequence of tokens obtained from the Lexical Analysis. The Semantical Analysis is computing, processing and propagating data that is not part of the context-free syntax of the given language and it gives meaning to the group of sentences from the previous step. 

In the Code Generation step, the translator passes through the tree representation of the program to generate machine code for the target machine. Optimization or Code Parsing is the last step and its purpose is to reduce the cost measure such as time of execution, size and battery consumption of the code.

Compilers design is very relevant because it brings a different perspective of how code is analyzed and how an algorithm is working to find a solution to a problem.

Debray, S. (n.d.). Making Compiler Design Relevant for Students who will (Most Likely) Never Design a Compiler. Recovered from http://34.212.143.74/s202011/tc3048/making_compiler_design_relevant_for_students.pdf

Comentarios

Entradas populares de este blog

Entry #7: Building Server-Side Web Language Processors

Entry #4: Internals of GCC