domingo, 22 de marzo de 2020

3 Internals of GCC


In “Internals of GCC” by Software Engineering Radio with Morgan Deters as guest we can see a general view of how GCC compiler works. Morgan Deters says: “A compiler has to read a plain text, source file, and understand what that means […] anytime you use a variable it has to figure out which variable you’re referencing, how to access that variable, whether it’s a local variable or global variable […] and it has to understand the semantic content […] generally, compilers will produce some sort of internal representation to mull over this information, to understand it better themselves” And, the GCC comprehends a vast array of programming languages which can be implemented in a large scale of processors.

The GCC (Gnu Compiler Collection) can be run on various platforms and is very flexible. Its input and output support all kinds of code structure. Therefore, Deters promotes its usage for many different architectures. The compiler passes through various iterations or RTL (register transfer language) to produce a low level syntax tree produced from the source code that will be executed in the target language.

The GCC has a front-end, middle-end and back-end. Which Deters explains in a modular fashion. The front-end is language dependent but architecture independent. The middle-end can operate on anything. And, the back-end is language neutral but architecture specific. And by architecture, Deters means a specific instruction set common in a family of chips (example. Intel’s 32 bit chips). This means the GCC compiler is highly usable because of its easy integration to most types of software and hardware.

Although, not all of it is good news. By optimizing all of these things to a general and simple integration process, some of nodes of the high level tree are basically displaced to give way to a simple syntax which recurses in itself multiple times, and thus, making the code much faster but less efficient. Anyway, this seems like an excellent option for those who need to share their work to multiple platforms so their code can function anywhere.

No hay comentarios:

Publicar un comentario

7 Lin Clark on WebAssembly

Typically, we use an array of code to create a website. HTML is used for its structure, CSS for styling and Javascript for the website’s beh...