Questions tagged [compiler]

A compiler is a computer program that transforms source code written in one programming language into another computer language.

A compiler is a computer program that transforms source code written in one programming language into another computer language. The most common reason for wanting to transform source code is to create an executable program.

496 questions
57
votes
9 answers

Are Intel compilers really better than the Microsoft ones?

Years ago, I was surprised when I discovered that Intel sells Visual Studio compatible compilers. I tried it in particular for C/C++ as well as fantastic diagnostic tools. But the code was simply not that computationally intensive to notice the…
user7071
21
votes
2 answers

What exactly is a compile target?

I keep hearing the term and all google searches lead me to articles on compilers. I just wanna understand what the term compile target means :| UPDATE: To give some context: I've heard it said that web assembly is a compile target for for other…
19
votes
2 answers

How Does A Compiler Work?

Note: I am surprised that this hasn't been asked before, and if it has I could not find it in a search. I've been on tons of websites, I've read tons of articles, and I have heard tons of explanations. Most of them were good, but they were all…
Dynamic
  • 5,746
18
votes
4 answers

Why is it so hard to recruit for compiler[-related] jobs?

Last week, a few colleauges and I were participating in career fairs at three major universities (two here in the US and one in England), where we were trying (without much success) to recruit for several compiler positions, ranging from internship,…
17
votes
10 answers

Compiler Warnings

Many compilers have warning messages to warn the programmers about potential runtime, logic and performance errors, most times, you quickly fix them, but what about unfixable warnings? How do you deal with unfixable warnings? Do you re-write a…
Ming-Tang
  • 856
15
votes
1 answer

Are there any podcasts (not lectures) about compiler development?

There are several podcasts with lectures from universities. I am looking for "other" podcasts. So are there any non-lecture podcasts about compiler development?
14
votes
8 answers

Are compilers used outside of development?

As far as my understanding goes, compilers are meant for developers compiling their code into executable (machine-code) files. Compilers don't extend to a client's machine or end-user system. Instead, developers just use the compiler to convert…
Pankaj Upadhyay
  • 5,070
  • 12
  • 44
  • 60
5
votes
4 answers

Can someone provide a short code example of compiler bootstrapping?

This Turing award lecture by Ken Thompson on topic "Reflections on Trusting Trust" gives good insight about how C compiler was made in C itself. Though I understand the crux, it still hasn't sunk in. So ultimately, once the compiler is written to do…
Jatin
  • 819
4
votes
1 answer

I want to write a data processing & analysis programming language that compiles to SAS. How to go about choosing a language to write my compiler in?

As a side project I wrote a simple macro in SAS to add syntatic sugar to SAS code. I hate how verbose SAS is sometimes! So my macro looks like this %macro md(code); /* expects a superquoted string */ * append a b; %if…
xiaodai
  • 149
3
votes
1 answer

Compiler Optimizations before IR/CFG phase

I understand Control-Flow Graph (CFG) optimizations and that they typically operate on SSA Intermediate Representations (IR). I am wondering though if the compiler optimizes the AST in any way before the IR, or does any optimizations before the…
Lance
  • 2,587
  • 19
  • 35
3
votes
1 answer

Is the microsoft C compiler (cl.exe) a compiler driver or a compiler?

gccand clang are both known to be compiler drivers. As such, the gcc executable does not compile anything itself. Rather, it calls the compiler (cc1), assembler (as) and linker (ld) with the right flags as needed. Is this setup true also for the…
Baruch
  • 157
2
votes
1 answer

Rough explanation of Control-Flow Graph navigation algorithm

Wondering at a high level how you are supposed to go about navigating a Control-Flow Graph (CFG) to perform operations such as dead code elimination. This diagram shows a dead-code elimination problem, how to figure out these variables are related…
Lance
  • 2,587
  • 19
  • 35
2
votes
2 answers

Implementing naive register allocation for x86 machines

I'm writing a toy compiler targeting on x86-64 machines. But I confront several problems when implementing register allocation with linear intermediate representation. I use NASM and GCC to generating executable file. In intermediate representation…
1
vote
10 answers

Compiler time versus programmer time

I want to briefly discuss managed or interpreted languages. It's said that they're worth developing in, because the CPU time is worth less than the programmer time required to develop in a faster language. I'm curious if the same thing could be said…
DeadMG
  • 36,902
1
vote
0 answers

How to practically implement a symbol table during compiler design?

I was trying compiler design with flex and bison. This is my first attempt in that sense. For my compiler, I wanted to build a symbol table which would help in building a proper compile-time type-system. When I sat to implement it, I noticed, it…
1
2