Questions tagged [compilation]

61 questions
282
votes
7 answers

How to write a very basic compiler

Advanced compilers like gcc compile code into machine readable files according to the language in which the code has been written (e.g. C, C++, etc). In fact, they interpret the meaning of the code according to library and functions of the…
Googlebot
  • 3,173
  • 5
  • 19
  • 14
168
votes
1 answer

Understanding the differences: traditional interpreter, JIT compiler, JIT interpreter and AOT compiler

I'm trying to understand the differences between a traditional interpreter, a JIT compiler, a JIT interpreter and an AOT compiler. An interpreter is just a machine (virtual or physical) that executes instructions in some computer language. In that…
Aviv Cohn
  • 21,190
  • 31
  • 118
  • 178
63
votes
9 answers

Novice programmer(s) frustrated by lack of a glossary of compiler errors

A friend of my family asked me for a bit of help as he learns to program (in the C language). As we were talking, he expressed frustration about having a hard time understanding the error messages his compiler (GCC) is giving him when he makes…
einpoklum
  • 2,478
  • 1
  • 13
  • 30
51
votes
4 answers

What is the difference between building and compiling ?

What's the difference between Building and Compiling.
38
votes
6 answers

Are long compiles a thing of the past?

There are countless war stories about how long a compile can take. Even xkcd made a mention of it. Now, I haven't been programming for a long time and have mostly just been exposed to Java and Python (and Python is an interpreted language, not a…
Thunderforge
  • 2,668
  • 3
  • 23
  • 30
23
votes
7 answers

Inline functions in C++. What's the point?

According to what I read, the compiler is not obliged to substitute the function call of an inline function with its body, but will do so if it can. This got me thinking- why do we have the inline word if that is the case? Why not make all function…
EpsilonVector
  • 10,763
  • 10
  • 56
  • 103
19
votes
11 answers

Does C++ compiler remove/optimize useless parentheses?

Will the code int a = ((1 + 2) + 3); // Easy to read run slower than int a = 1 + 2 + 3; // (Barely) Not quite so easy to read or are modern compilers clever enough to remove/optimize "useless" parentheses. It might seems like a very tiny…
Serge
  • 861
  • 2
  • 6
  • 12
15
votes
5 answers

Why is the output of a compiler called object code?

From the essay Programming Languages Explained by Paul Graham, published in Hackers & Painters: The high-level language that you feed the compiler is also known as source code, and the machine language translation it generates is called object…
13
votes
8 answers

Why doesn't my IDE do background compiling/building?

Today I develop on a fairly complex computer, it has multiple cores, SSD drives and what not. Still, most of the time I'm programming the computer is leasurely doing nothing. When I need to compile and run/deploy a somewhat complex project at best…
Homde
  • 11,104
  • 3
  • 40
  • 68
12
votes
3 answers

Do functional programming languages have more opportunity to do compile time optimization?

I was reading the book "Functional Programming for the Real World". It started with comparison between imperative and functional programming languages. And it stated how 'values' and 'expressions' in functional programming is different from…
Gulshan
  • 9,402
  • 10
  • 58
  • 89
12
votes
3 answers

Shipping my first class library. Any gotchas I need to be aware of?

I'm a Web Developer about to unlock the "First Class Library Published" achievement in my career and I'm sweating bullets (I was up all night stressing out). I'd love to tap the experience of the community to see if anyone has any suggestions or…
Mr. JavaScript
  • 347
  • 1
  • 11
12
votes
3 answers

Compiling vs using pre-built binaries performance?

Will performance be better (quicker) if I manually compile the source for a software component for the actual machine that it will be used on, compared to if the source was compiled on another platform perhaps for many different architectures? I got…
Niklas Rosencrantz
  • 8,008
  • 17
  • 56
  • 95
10
votes
4 answers

What is the meaning of the sentence "we wanted it to be compiled so it’s not burning CPU doing the wrong stuff."

I was reading this article. It has the following paragraph. And did Scala turn out to be fast? Well, what’s your definition of fast? About as fast as Java. It doesn’t have to be as fast as C or Assembly. Python is not significantly faster than…
user2434
  • 1,277
  • 1
  • 12
  • 14
9
votes
4 answers

Constants in C#

Why does the compiler store constant values in the assembly metadata? Are they directly embedded to Intermediate Language code from the assembly metadata?
Arun
  • 477
  • 1
  • 3
  • 14
7
votes
3 answers

Forth: How do CREATE and DOES> work exactly?

I am in the process of creating my own concatenative language, heavily based on Forth. I am having a little trouble understanding how the compiling words CREATE and DOES> work, and how they are implemented (How the state of Forth's run time…
Qqwy
  • 4,709
  • 4
  • 31
  • 45
1
2 3 4 5