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

10
votes
2answers
603 views

Anyone know of any parallelizing compilers following the approach of the Dragon Book?

In Compilers: Principles, Techniques, & Tools, Aho et al describe an approach for optimizing for parallelism (chapter 11 in the second edition). Is anyone aware of any existing compilers which ...
15
votes
1answer
1k views

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?
3
votes
2answers
485 views

Google Closure Compiler - what does the name mean?

I am curious about the Google Closure Compiler. Why did they name it that? Does it have anything to do with lexical closures? EDIT: I tried researching it in the FAQ and documentation, as well as ...
2
votes
4answers
1k views

Computation Program Not Running at 100% CPU Utilization

I have a program which has a GUI and performs some very heavy mathematical computations for a couple of minutes and then outputs a result. When I try to directly interface it through its DLL's, it ...
8
votes
4answers
11k views

Writing a lexer in C++

What are good resources on how to write a lexer in C++ (books, tutorials, documents), what are some good techniques and practices? I have looked on the internet and everyone says to use a lexer ...
2
votes
2answers
25k views

How Does A Compiler Work? [closed]

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 ...
8
votes
4answers
558 views

Why aren't VM languages compiled just once?

(First of all, I should make clear that compilers and virtual machines (aka) are a completely unknown field for me) As I understand it, every time a Java/C#/... application is run, a VM is invoked ...
7
votes
6answers
674 views

What is the industry definition of an interpreter (as opposed to a compiler)?

In my compiler design courses, I have learned about and worked with a clear academic definition of an interpreter and a compiler, with an interpreter being a program Pi from a language M capable ...
4
votes
3answers
1k views

Do You Have To Know CIL To Make A Compiler for .NET?

Assume one wants to create a simple .NET language, or slightly more difficult, a compiler for an existing .NET language. Do you absolutely need to be familiar with the CIL (Common Intermediate ...
2
votes
4answers
399 views

What programs emit C++ code and pass it to mainstream compilers?

I suspect there're programs that instead of emitting machine code instead emit C++ code and then start a mainstream C++ compiler to compile it to machine code. I can't find any notable examples ...
3
votes
1answer
821 views

Io (Language) IDE/Compiler

Can you recommend a free compiler/IDE for writing some simple Io programs? I want to learn the language at home in my spare time.
2
votes
3answers
244 views

Is it worth evaluating compiler optimization on trivial cases?

I'm currently testing Visual C++ 10 on some trivial pieces of code. For example, like this one (taken from here): int main() { int i; clrscr(); ...
33
votes
3answers
11k views

How could the first C++ compiler be written in C++?

Stroustrup claims that Cfront, the first C++ compiler, was written in C++ (Stroustrup FAQ). However, how is it even possible that the first C++ compiler be written in C++? The code that makes up the ...
11
votes
8answers
1k views

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. ...
5
votes
6answers
2k views

How can variables be created at runtime?

Is it possible to define variables dynamically? Last night I was writing some code (C and VB2010) and I ran into a problem related to defining variables in my program. The variables needed depend on ...
11
votes
2answers
964 views

What is the relationship between the Dynamic Language Runtime and C# 4.0?

Let's say I wanted to create a dynamic language compiler/interpreter, a Scheme interpreter perhaps, on the .NET platform as it exists today. Would I be better off using the Dynamic Language Runtime ...
4
votes
3answers
727 views

Role of linking, object files and executables

For a C or assembly program that does not require any other library, will linking be necessary? In other words, will conversion from C to Assembly and/or from Assembly to an object file be enough ...
3
votes
1answer
3k views

Understanding Application binary interface (ABI)

I am trying to understand the concept of Application binary interface (ABI). From The Linux Kernel Primer: An ABI is a set of conventions that allows a linker to combine separately compiled ...
11
votes
3answers
721 views

How does a static type system affect the design of a prototype-based language?

The Wikipedia article on prototype-based languages contains the following paragraph: Almost all prototype-based systems are based on interpreted and dynamically typed languages. Systems based on ...
1
vote
3answers
1k views

Compiler/OS Design - Where to start [closed]

I have a fairly strong background in C and Assembly and I am starting to look into basic compiler and operating systems design, but my biggest problem is where I should really start, seeing as both ...
6
votes
1answer
3k views

Is Objective-C an Interpreted or Compiled language?

I want to know if Objective-C is an interpreted or a compiled language.
11
votes
7answers
2k views

Which computer science subjects are required to follow introductory course in compilers?

I am non computer science undergraduate and work as a web-developer(java, python, AS3 etc.) as a professional. I take 1 course per semester at my local university. I had taken Artificial ...
1
vote
4answers
494 views

Does a prose to code compiler exist? [closed]

I have seen some horrible code in my time including people virtually duplicating the code in comments // add 4 to x x+=4; // for each i in 0 to 9 for (int i = 0; i < 10; i++) { // multiply x ...
3
votes
1answer
562 views

Is it possible to take a binary compiled for ARMv7 architecture and convert it to ARMv6?

Is it possible to take a binary compiled for ARMv7 architecture and convert it to ARMv6 ? Are there any tools that can do this?
4
votes
2answers
761 views

How do you write a code analysis & refactoring tool to interface with Visual Studio?

Recently while working on a project of mine and doing some refactoring I got an idea to write a custom tool to help me analyze my code in a very specific context and perform some very custom ...
9
votes
5answers
565 views

Basic features for a basic language? DSL suggestions?

I've finally begun to understand the complexity behind creating an interpreter and a compiler. I've built several versions of TinyBasic, 1964 (Dartmouth) Basic, and my own expansions on those ...
16
votes
4answers
2k views

GCC vs clang/LLVM — pros and cons of each [closed]

What are the pros and cons of GCC vs clang/LLVM?
5
votes
8answers
1k views

How useful are compile-time functions?

How useful are compile time functions? Personally I haven't worked in any language that supports them but they seem nifty in some cases. For those who don't what I mean, a compile-time function is ...
2
votes
6answers
405 views

What should be done when upgrading compiler introduces bug in existing project?

We've 4 embedded firmware at hand. Two of them are released, are in maintenance phase. Other two are going to be released. The released product uses OKI 411 micro, where as yet to be released products ...
10
votes
5answers
3k views

Do Fortran compilers really generate faster code than C compilers?

When I was studying in the university I often heard the idea that Fortran compilers produced faster code than C compilers for an equivalent program. The key reasoning went like this: a Fortran ...
18
votes
5answers
5k views

Are C++ templates just a kind of glorified macros?

From different comparisons among C++ templates and C#/Java generics like this one- ...
44
votes
19answers
4k views

How come compilers are so reliable?

We use compilers on a daily basis as if their correctness is a given, but compilers are programs too, and can potentially contain bugs. I always wondered about this infallible robustness. Have you ...
12
votes
13answers
1k views

Is it true that first versions of C compilers ran for dozens of minutes and required swapping floppy disks between stages?

Inspired by this question. I heard that some very very early versions of C compilers for personal computers (I guess it's around 1980) resided on two or three floppy disks and so in order to compile ...
14
votes
9answers
3k views

Career advice: PhD in theory of programming languages [closed]

I'm very interested in the theories of programming languages and going to apply a PhD in this topic, but I want to know more about the career after the graduate education. besides being a professor, ...
10
votes
4answers
2k views

Compiler Jobs - How Much Education Is Needed

I was motivated by the Compiler Construction As A Subject question and thought I would ask this one. I have heard from a few people that they have a good "compiler team" (don't ask where I heard it, ...
6
votes
6answers
1k views

What is the advantage of learning about and understanding compiler construction?

I'm a undergraduate in my 3rd year of a Software Engineering degree. From this year on, my university has introduced a new course called 'Compiler Constructions', which teaches you the basics of the ...
9
votes
2answers
812 views

How should compilers report errors and warnings?

I don't plan on writing a compiler in the near future; still, I'm quite interested with compiler technologies, and how this stuff could be made better. Starting with compiled languages, most ...
1
vote
1answer
373 views

How does compiler handle exceptions that are implicit? Looking for design strategies

Throughout the function handleException, the exception encountered is implicit. How does the compiler handle such implicit passing of exceptions? [For e.g. in C++ methods, this pointer is passed to ...
12
votes
12answers
1k views

Are there any compilers that attempt to fix syntax errors on their own? [closed]

I heard a while back that there used to be a compiler that attempted to fix syntax errors by analyzing context and inferring what was intended. Does such a compiler really exist? Obviously it has ...
15
votes
5answers
9k views

JIT compiler for C, C++, and the likes

Is there any just-in-time compiler out there for compiled languages, such as C and C++? (The first names that come to mind are Clang and LLVM! But I don't think they currently support it.) ...
22
votes
4answers
26k views

Is Python Interpreted or Compiled?

This is just a wondering I had while reading about interpreted and compiled languages. Ruby is no doubt an interpreted language, since source code is compiled by an interpreter at the point of ...
1
vote
1answer
343 views

Could you blend java and javascript? [closed]

As a developer who spends most of my time in either Java or Javascript these days, I have this fantasy about a language that blends the two of them together. I'm always missing something from one or ...
19
votes
1answer
8k views

What are the main advantages and disadvantages of LL and LR parsing?

When building a parser to a programming language what I earn and what I lost choosing one or the other?
5
votes
5answers
1k views

How do I learn linking compiling, makefile quickly? Any book recommendations? [closed]

I'm very good at programming in C++ but when it gets to linking and the other important stuffs I feel very ignorant. I want to learn allegro without wasting time. So please suggest a book or a ...
43
votes
12answers
11k views

Should I use a parser generator or should I roll my own custom lexer and parser code?

What specific advantages and disadvantages of each way to working on a programming language grammar? Why/When should I roll my own? Why/When should I use a generator?
10
votes
3answers
1k views

Is Clang/LLVM ready for prime time? [closed]

Clang is able to be used instead of gcc? What your experience on that? What disadvantages there are yet? Performance of compilation is very better than gcc but about performance of code generated ...
7
votes
9answers
830 views

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 ...
4
votes
7answers
422 views

Not specifying a return in a function, good or bad?

I have coded like this many times, and I've never encountered an issue, but the compiler always warns when it expects a return and there is none. For instance, look at this: -(NSString ...
10
votes
2answers
1k views

Compiler optimization examples [closed]

I'd like to see (good) examples of optimizations performed by compilers (static and JIT). Why? To learn what we don't have to optimize ourselves (often leading to better code) To be amazed
5
votes
4answers
548 views

Programming as a conversation [closed]

I have often wondered if it would be possible to write a programming language that would work as a conversation. I would tell the computer that I want to store coordinates and it would ask what ...