domingo, 5 de febrero de 2017

Internals of GCC

Internals of GCC

On the podcast, Morgan Deters that is in the Washington University in St. Louis talk about the Gnu compiler collection (GCC). He talk about why compilers are relevant for us, a topic that has been treated before.

Usually we do not care about compilers, we are busy trying to make a program but we rarely tink about the tolos that make all work.

GCC is a compiler collection that supports many languages such as C, C ++, Objective C, Chill, Fortran, Ada, etc.

GCC is capable of receiving a source program in any of these languages and generate a binary executable program in machine language, which is going to run in our computer. First the compiler needs to read a plain text, this is the source file, and then  understand what does it mean, the compiler needs to know the variables, the type and understand the semantic of the content.

He explains that to be able to have a general purpose compiler, it was decided to divide it into various layers, the front, middle and back layer.

The middle layer takes the input of this first layer and optimizes it in order to make it better for the assembler to analyze it, finally at the backend we specify the architecture in what our code must be executed.

And in the back layer an optimization  is made to the machiine code.
That is the reazon why we could have diferent languages in the front layer. Another thing I find really usefull is that GCC is flexible and portable, it can run in many platforms of Unix, Mac OS and Windows. 


The code optimization, one of the most used and valued parts is, in my point of view not enoough understood for programmers. Honestly now i am a little afraid of the idea of make a compiler …

No hay comentarios:

Publicar un comentario