domingo, 22 de enero de 2017

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

As a computer science student on my last semesters I find compilers design really interesting. First of all, I have been creating software all my program and never had an idea how that code is translated to machine code. My laptop is like a black box in which I install a programming language (Java, Python, Ruby, etc.), my professors teach me how to write code and then I compile and run it (It seems like magic!). 

One year ago I had a class in which I had to practice with regular expressions using finite automatas. The exercises that we needed to solve were for example, finding if a text had a phone number or an email. This is a good way to start using them but when I discovered that they are used to read a source file to create machine code it made it more interesting. Thinking in all the code I have written and compiled makes me feel grateful with the people that spent a lot of their time designing those compilers. 

Image: https://imgs.xkcd.com/comics/compiling.png

One of the main things that made it more interesting was to hear my compiler design teacher saying that designing a compiler is like a dragon (Some of the compiler design books have dragons in their covers). Now this course seems like a challenge and it will be incredible to learn how this likeness is represented in real terms. Going through the lexical analysis and parsing, then the syntax analysis, afterwards the semantic analysis and the code generation (which is done typically using a post-order traversal), without forgetting about code optimization which the name sounds intriguing.  

How a compiler optimizes code? this is a question which I hope to solve by taking this course. As the article says, compilers normally treat optimization to make code run faster but now that we have a great amount of embedded systems which doesn't have a lot of memory, optimization seems to change its focus. Learning how this optimization occurs will help me design better tools for any scenario that I find in my way. Maybe I will need to think on new ways to develop them but I am quite sure that this will help. I'm also looking forward to learn about lex, yacc and bison to able to parse things faster.

Image: http://vignette3.wikia.nocookie.net/new-monster/images/a/ac/EUROPEAN_DRAGONS.jpg/revision/latest?cb=20130629102722


References:

Debray, S. 2002. "Making Compiler Design Relevant for Students who will (Most Likely) Never Design a Compiler". University of Arizona. Consulted January 21st 2017 in: http://webcem01.cem.itesm.mx:8005/s201711/tc3048/making_compiler_design_relevant_for_students.pdf




No hay comentarios:

Publicar un comentario