A compiler is a computer program (or set of programs) that transforms source code written in a programming language (the source language) into another computer language (the target language, often having a binary form known as object code).

learn more… | top users | synonyms

0
votes
2answers
53 views

Storing tokens during lexing stage

I am currently implementing a lexer that breaks XML files up into tokens, I'm considering ways of passing the tokens onto a parser to create a more useful data structure out of said tokens - my ...
3
votes
2answers
187 views

Are (C) object files created with different compilers binary-compatible?

I understand that C++ compilers are not compatible with each other. However, I was unable to find anything on this topic for C in particular. I know that the C standard leaves a lot of room for ...
-4
votes
0answers
53 views

Can I get right guidance to enter software development? [closed]

I am beginner in software development As a beginner I know C/C++ not at expertise level But I am liking Python Give me right guidance
1
vote
1answer
114 views

LLVM case: is the success due to the algorithms? [closed]

I'm not sure if this is a subjective question, I hope not but I'm not proficient with LLVM so I'm just wondering: how come it's become so popular and so widespread used in the industry? Were the ...
-1
votes
1answer
175 views

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 ...
-3
votes
3answers
158 views

Why can't we program without compiling (using an IDE/debugger)? [closed]

I find it very interesting that even people who design a particular framework still have to rely on compiling to ensure the code is correct. I don't mean for 100s of lines of code, but 2-10 lines. I ...
4
votes
0answers
177 views

Why do some embedded projects shun cross-compiling?

As I've been getting into embedded systems I've noticed that some projects (Arch Arm and OpenBSD for example) frown upon cross compiling. What is the reasoning for this? Is a cross-compiled binary ...
0
votes
3answers
258 views

How does assembly relate to machine/binary code

How does assembly relate to machine/binary code. For example here is how to print to the screen in mikeOS(a small pure assembly OS), mikeOS it uses NASM to assemble. BITS 16 ORG 32768 ...
1
vote
1answer
152 views

Does understanding how compilers work make me a better programmer? [closed]

According to this article regarding the top 5 skills needed by every programmer , understanding how the compilers works is among one of them . Compilers - One interesting thing about compilers is ...
0
votes
2answers
181 views

How do we go from assembly to machine code(code generation) [closed]

I know this is abstract as it's all about signals and switch - (electronics) - underneath, but is there a easy way to visualize the step between assembling code to machine code. For example if you ...
2
votes
4answers
168 views

Does boostrapping limit the achievable speed of the new compiler?

I have a good grasp on how the C compiler was boostrapped from itself and how that must have been very efficient, since the first pre-bootstrapping version was written in assembler, which is as low ...
4
votes
4answers
547 views

Why don't compilers support non-English keywords? [closed]

When you read C, C#, Java, Python, PHP and many other programming languages all the syntax is written in English. Simple code like this if (X+1 > 4) { } while (A == true) { } Is written in ...
4
votes
3answers
312 views

Why do some compilers generate direct machine code?

I was taking this course - CMU 18-447, Computer Architecture at Carnegie Mellon to brush my knowledge and concepts. They say that most of the machine level details and implementations is taken care ...
16
votes
4answers
745 views

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

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 ...
1
vote
5answers
228 views

How to alter the code at runtime in an interpreter?

While reading the difference between Compiler and interpreter , I found the following differences fromt he internet. Advantages of using compiler: Since compiler converts the program to native code ...
1
vote
4answers
489 views

Why languages that compile to C/C++ generate unreadable, cryptic code?

I'm willing to compile certain language to C or C++ for some speedups. My idea was, though, to generate readable code and use structures such std::vector and similar wherever I can, expecting CLANG to ...
0
votes
3answers
364 views

Are VB.NET to C# converters actually compilers?

Whenever I see programs or scripts that convert between high-level programming languages they are always labelled as converters. "VB.NET to C# converter" on Google results in expected, useful hits. ...
1
vote
3answers
185 views

Requiring a specific order of compilaiton

When designing a compiled programming language, is it a bad idea to require a specific order of compilation of separate units, according to their dependencies? To illustrate what I mean, consider C. ...
0
votes
1answer
208 views

How small is the footprint of a small C compiler?

This week I could optimize using a reduced C library that allowed a drastic shrinkage in code size - from about 60 K to about 6 K and then we could load the code in the 8 K on-chip memory of an FPGA ...
0
votes
3answers
162 views

What process do typical (the majority) of high level language compilers use when changing a source-code's variable name to a machine code name?

Do long (very long) variable names slow down the compilation of source code? I'm aware that the length of variables has 0% impact on interpretation as the compiler changes them to machine code which ...
6
votes
1answer
165 views

.NET BCL Change Analysis - Uses Beyond Sating Curiosity

This is part of a series of questions which focuses on the Abstraction Project, which aims to abstract the concepts used in language design in the form of a framework. There is a sister project to ...
1
vote
2answers
144 views

Will a binary include methods that are not called in the source code?

[Potentially misleading title, but I'm not sure how best to word it.] Theoretical question on compilers and language design. Say I'm re-implementing a method in a code base. Instead of removing or ...
3
votes
1answer
281 views

Does setting a function public affect the C# compiler's ability to inline the function as an optimization?

This could be either for the .NET or Mono compilers. I know that under certain conditions the compiler can inline functions (e.g. small, single call site, etc.) as an optimization. However, if the ...
7
votes
1answer
251 views

How to use BDD to unit test a compiler?

My team is writing a compiler for a domain-specific language (DSL) which will be integrated into an IDE. Right now, we are focused on the analysis phase of the compiler. We are not using any existing ...
15
votes
5answers
872 views

Does Scrum make sense when implementing a new compiler backend?

I have an existing language that I need to port to a new platform. I'll probably attempt this by changing the backend of the existing compiler. It is a significant amount of work to re-write the ...
1
vote
1answer
148 views

Compiler design decision for dynamic method invocation

I asked about Compiler interpretation of overriding vs overloading on StackOverflow, and got good answers, but this led me to another question that I'm not sure is appropriate for SO, but I think is ...
5
votes
2answers
463 views

Learning YACC nowadays, does it make sense? [closed]

I have a huge project that is using YACC and I would need to fix a bug in it. I might ask someone else who wrote that to fix it but I'm interested in how compilers work. Does it make sense to learn ...
0
votes
2answers
166 views

Building a tool to fix compiler errors automagically

When a program doesn't compile, error messages are sometimes esoteric. Often a simple Google search leading to a site like stack exchange solves the problem. Now why can't we automate this? How ...
25
votes
10answers
3k views

Can compilers and interpreters have bugs, and what can we (as users) do to deal with them? [closed]

If a compiler's work is essentially translating source code into machine level code, can there be any glitch in a compiler, i.e. a faulty "translation?" The same goes for an interpreter: can it fail ...
10
votes
2answers
463 views

Can and do compilers convert recursive logic to equivalent non-recursive logic?

I've been learning F# and it's starting to influence how I think when I'm programming C#. To that end, I have been using recursion when I feel the result improves readability and I can't envision it ...
12
votes
2answers
735 views

What does scannerless parsing have to do with the “Dangling Else Problem”?

I do not understand this sentence from the Wikipedia article on the Dangling Else problem: [The Dangling Else problem] is a problem that often comes up in compiler construction, especially ...
0
votes
2answers
419 views

embedding programming languages into other languages [duplicate]

In C/C++, there is a keyword that allows you to enter assembly language directly into a method. Example int Main() { __asm // notify the compiler that this block is assembly language. { ...
-1
votes
1answer
176 views

Recompiling a java project while it is running

I have a Java program that takes about an hour to run. While it is running, if I change the source code and recompile it, will this affect the above run?
2
votes
0answers
180 views

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 ...
0
votes
2answers
1k views

How would I make a compiler in C++? [closed]

This probably been asked for but I can't google "How to make a compiler in C++" because I will just get "How to compile C++" as the results. Anyway, for my question, I'd like to make a simple ...
1
vote
1answer
197 views

Cross Compile Arm Program to Intel

I have searched around for a way to run a program meant for ARM processors on an Intel computer, but I can only find ways to do the reverse, to compile Intel programs for ARM. Are there any ...
12
votes
1answer
417 views

Disadvantages of functional intermediate form

I'm writing an optimizer for a language similar to JavaScript, and need to choose an intermediate code representation. The obvious/typical choice these days is Static Single Assignment (SSA). ...
7
votes
5answers
362 views

Is it a good idea to read compiler source code? [closed]

I'm a junior in college majoring in Computer Science. Apart from writing lots of code, I want to start reading source code written by others to improve my coding skills and learn better/different ways ...
4
votes
1answer
699 views

Homogeneous vs. heterogeneous AST representation

What are the reasons to choose a homogeneous vs. a heterogeneous AST representation for implementing a complex domain-specific programming language? Just to be very clear about what I'm asking, here ...
0
votes
4answers
122 views

Use functions inside a loop declaration

What's the best practice? This : for ($i = 0; $i < count($array); $i++) { //stuff } Or, what I usually do : $count = count($array); for($i = 0; $i < $count; $i++) { //stuff } Is it the ...
10
votes
4answers
1k views

Is it possible to use the Intel C/C++ compiler on Linux to create object files to be linked on Windows?

Why? Depending on your source the Intel compiler is likely or most definitely the compiler generating the fastest executables for the x86 architecture (5 to 100 % execution time improvement). Intel ...
-3
votes
2answers
282 views

Why do people tend to gravitate to older versions of visual studio? [closed]

I'm starting to pick up all of the perks of C++11, and being a 2010 user i'm considering installing 2012 instead for better c++11 support. But why is it that 2012 doesn't seem as popular as 2010? Am i ...
11
votes
3answers
1k views

Writing a Compiler Compiler - Insight on Use and Features

This is part of a series of questions which focuses on the sister project to the Abstraction Project, which aims to abstract the concepts used in language design in the form of a framework. The ...
0
votes
2answers
224 views

How the cross programming language compiler or translator works [closed]

These days there are more cross programming language compilers (specially from some 'X' language to JavaScript). I wonder how these are developed? What are the general steps to be taken care to write ...
0
votes
0answers
38 views

how to compile the code remotly and show results to the user [duplicate]

It's just a how-to question, want to know the right path to explore, can anyone guide me how the sites like http://jsfiddle.net or http://ideone.com/ works, meaning by the user inputs the code in ...
3
votes
1answer
753 views

What is the Ken Thompson Hack? [duplicate]

I read some stuff like cm bell labs but i couldn't get it all. How does it work really? What is the logic in that?
30
votes
11answers
2k views

What is the difference between “Syntax” and “Syntactic Sugar”

Background The Wikipedia page on Syntactic Sugar states: In computer science, syntactic sugar is syntax within a programming language that is designed to make things easier to read or to express. ...
17
votes
2answers
6k views

What is ASM.js and what does it mean for everyone?

I'm starting to hear rumblings about this project called ASM.js. Currently their web site is terrible and confusing. Here's what I know from my research on the web. It is a subset of JavaScript that ...
10
votes
2answers
774 views

Why can't a compiler avoid importing a header file twice by its own?

New to C++! So I was reading this: http://www.learncpp.com/cpp-tutorial/110-a-first-look-at-the-preprocessor/ Header guards Because header files can include other header files, it is possible ...
2
votes
1answer
136 views

upgrading to newer version of compiler [closed]

I had legacy code that was originally build for some quite old version of compiler. We are talking about native code, not managed. Now it is ported to almost newest version of the compiler. Every ...