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).
2
votes
0answers
120 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 ...
-1
votes
2answers
128 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
37 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
478 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?
0
votes
0answers
20 views
Getting a ton of warnings when trying to compile Qt program [migrated]
Here are the warnings I'm getting when I'm compiling in debug mode: http://pastebin.com/raw.php?i=xNvn2TgM
When compiling in release mode, I get no errors. The program runs fine in both release mode ...
26
votes
9answers
1k 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. ...
9
votes
2answers
2k 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
507 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 ...
3
votes
1answer
125 views
upgrading to newer version of compiler
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 ...
11
votes
3answers
349 views
How to implement lazy evaluation of if()
I am currently implementing an expression evaluator (single line expressions, like formulas) based on the following:
the entered expression is tokenized to separate literal booleans, integers, ...
7
votes
5answers
834 views
When to pay for C++ compilers
Recently I have began to wonder when developers should pay for compilers. Compilers come for free with most platforms or there is a free version easily obtainable.
Example:
OS X - GCC and Clang/LLVM ...
2
votes
1answer
123 views
Are there any practical uses of allowing recursive inclusion of a file?
I am currently implementing NASM-like preprocessor for my assembler, and I am wondering what is the correct way of handling recursively included files. From what I see, there are two ways to deal with ...
-5
votes
3answers
396 views
How is an IDE compiled?
I'd like to know the general procedure of how an IDE is built/compiled/created.
Additionally, what are some tools/scripts used to create an IDE?
I don't mean to say that compiling IDE needs an IDE. ...
3
votes
2answers
295 views
What happens when using address before it's allocated?
The very simple piece of C++ code below is incorrect, it's easy to see why and tools like Valgrind will tell you. In running several C++ codes containing this kind of error, I noticed that each time, ...
18
votes
4answers
731 views
Detecting misusage of delete[] vs. delete at compile time
I'd like to know if it's possible to detect the delete error commented below at compile time? Especially, I'd like to hear about g++ compiler.
ClassTypeA *abc_ptr = new ClassTypeA[100];
...
7
votes
1answer
100 views
What is the current state of SECD and SKI machine use and research?
I'm doing some independent research/study with a professor who's a very functional guy. The goal is to examine more of what's happening behind the scenes with functional languages than we normally ...
3
votes
1answer
316 views
Online compilers and repls - not one big security hole?
There are plenty of compilers and REPL services on the web. For example: Fay ide.
I find that implementing some similar technology would be very interesting. But it seems like a major security hole. ...
0
votes
1answer
376 views
Fastest native C++ multi-platform compiler & IDE & debugger [closed]
If I'll begin developing cross platform applications, The complied file speed is very important for me .
I have research before than and find same result about IDE :
(I ignored eclipse because very ...
2
votes
2answers
226 views
Convert grammar into an LL(1) grammar which recognises the same language
I have the following sample question for a compilers exam and wanted to check my solution.
Convert the following grammar into an LL(1) grammar which recognises the same
language:
E -> E + T
E ...
0
votes
0answers
206 views
Steps in converting a grammar to LL(1) Grammar
I have the following question:
Convert the following grammar into an LL(1) grammar which recognises the same
language (you may assume that the grammar is unambiguous).
A -> int
A -> int + A
A ...
5
votes
3answers
192 views
Constructing a Finite State Automaton
I have an exam question that I am unsure of the answer. The question is:
In organisation X valid user names have the following structure. The
user name can be either the employee’s name followed ...
4
votes
1answer
786 views
First and Follow Sets for a Grammar
I'm studying for a Compiler Construction module I'm doing and I have a sample question as follows:
Calculate the FIRST and FOLLOW sets for the following grammar..
S -> uBDz
B -> Bv
B -> w
D ...
3
votes
1answer
204 views
Showing a grammar is ambiguous
I have the following question taken from a compilers course exam:
Show that the following grammar is ambiguous.
S = XcY
X = a
Y = b | Z
Z = bW
W = d | ϵ
I drew the following tree:
Am I correct ...
3
votes
1answer
338 views
Constructing a Deterministic Finite State Automaton for a given Regex
I have a couple of exam questions for my compilers class and wanted to check if my solutions are correct.
The first question is:
Consider a language in which numbers start with an optional minus
...
1
vote
1answer
231 views
The Jitter (the just-in-time compiler) in ASP.NET [closed]
I know that C# gets compiled to an IL then after that to a machine code depending on the machine using just-in-time compiler. My question will go to ASP.NET. Is it the same?
Does it require 3 steps? ...
2
votes
1answer
176 views
What follows after lexical analysis?
I'm working on a toy compiler (for some simple language like PL/0) and I have my lexer up and running. At this point I should start working on building the parse tree, but before I start I was ...
5
votes
4answers
297 views
Is the output of Eclipse's incremental java compiler used in production? Or is it simply to support Eclipse's features?
I'm new to Java and Eclipse. One of my most recent discoveries was how Eclipse comes shipped with its own java compiler (ejc) for doing incremental builds. Eclipse seems to by default output ...
19
votes
5answers
869 views
Is Google Closure a true compiler?
This question is inspired by the debate in the comments on this Stack Overflow question. The Google Closure Compiler documentation states the following (emphasis added):
The Closure Compiler is a ...
-3
votes
1answer
105 views
Compiler Dependencies [closed]
I'm a newbie researcher who's passion is programming languages (Web era). I'm wondering why all the Web frameworks and Web-based general purposes languages, have a huge number of dependencies when you ...
0
votes
5answers
228 views
Is comparing an OO compiler to a SQL compiler/optimizer valid?
I'm now doing a lot of SQL development at my new job where as before I was doing Object Oriented desktop app stuff. I keep running across very large scripts (thousands of lines) and wanting to ...
4
votes
3answers
336 views
Prerequisites to compiler theory? [closed]
It's not meant to be subjective or get advice on what would be the best path to take, but an objective list of things that must be known in order for me to pick up a book on compiler theory and ...
2
votes
2answers
439 views
How is it possible to write the compiler of a programming language with that language itself [duplicate]
Possible Duplicate:
How could the first C++ compiler be written in C++?
You probably heard that Microsoft released a new language called TypeScript which is a the typed superset of ...
0
votes
0answers
48 views
Built-in Context-and-Input-to-Output-Hashing in Compilers
Why doesn't (open source) compilers contain builtin funtionality for (shared) caching and reuse-fetching (using SHA1-hash of compiler-version, build-flags, target-platform and inputs) of executable ...
-3
votes
5answers
211 views
How do I make a .sh file that counts each time you compile? [closed]
I wanted to compile my program and I wanted to know how many times I have compiled it.
How do I make a .sh file to do that? (I'm using mac, is it .sh file?)
1
vote
5answers
3k views
How to write a very basic compiler [duplicate]
Possible Duplicate:
Best Online resources to learn about Compilers?
What would be the best way to learn about compilers, and executable formats?
Advanced compilers like gcc compile codes ...
0
votes
2answers
121 views
Calculations in Vector Register
How do vector registers work in terms of calculations and alloting data to them ?
Is there a detailed reference available somewhere explaining how vector registers work and how data is fetched from ...
2
votes
5answers
259 views
How are operators organized in memory
How are operators organized/saved in the memory in context of a programming language. Are they procedures/functions saved somewhere and compilers just manipulate things to call these procs whenever ...
4
votes
4answers
478 views
Could implicit static methods cause problems?
This is a purely hypothetical question.
Say I create a class method that contains no references to instance variables or other resources. For example (C#):
protected string FormatColumn(string ...
10
votes
3answers
4k views
Why would more CPU cores on virtual machine slow compile times?
[edit#2] If anyone from VMWare can hit me up with a copy of VMWare Fusion, I'd be more than happy to do the same as a VirtualBox vs VMWare comparison. Somehow I suspect the VMWare hypervisor will be ...
1
vote
3answers
249 views
Dynamic choice of compilers?
An application has the following logic:
client => created *.cpp => sent to the server => cl.exe + *.cpp =
*.exe
client => created *.cs => sent to the server => csc.exe + *.cs =
*.exe
client => ...
2
votes
1answer
382 views
High-level language to assembly
If assembly language is only a readable way to represent machine code, then why are HLLs converted to assembly first and then to machine code?
Shouldn't HLLs be directly converted to machine code?
5
votes
3answers
288 views
Compiler Linking: How to handle circular references?
I'm currently writing a compiler for a new language and I'm struggling with the linking aspect of new Types when there exists a circular reference.
I've created a dependency tree so that I can ...
3
votes
1answer
110 views
How to support mixed grammars?
I am currently writing a grammar for a programming language (PowerBuilder) and I am also collecting documentation about parsing and compilers creation.
Now I would like to add in my grammar (that ...
4
votes
2answers
522 views
Whats the difference between an interpreted language and one compiled to a VM?
It occurs to me that there's not a heck of a lot of difference between
$>python module.py
And:
$>javac module.java
$>java module.class
The former compiles to an intermediate language ...
5
votes
2answers
558 views
Writing a new programming language - when and how to bootstrap datastructures?
I'm in the process of writing my own programming language which, thus far, has been going great in terms of what I set out to accomplish. However, now, I'd like to bootstrap some pre-existing data ...
12
votes
6answers
1k views
What came first, the compiler, or the source?
I'm curious about the birth of the compiler. How did programming begin? Did people first build hardware that recognized a certain set of commands, or did people define a language and then build ...
1
vote
2answers
209 views
GCC: assembly listing for IA64 without an Itanium machine
I need to try the following thing: I would like to compile some simple C code samples and see the assembly listing generated by GCC for IA64 architecture, i.e. I just want to run GCC with the -S ...
4
votes
9answers
684 views
Why are effect-less functions executed?
All the languages I know of would execute something like:
i = 0
while i < 100000000
i += 1
..and you can see it take a noticeable amount of time to execute.
Why though, do languages do ...
32
votes
8answers
4k views
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 ...
10
votes
6answers
1k views
Why C++ to write a compiler?
I was wondering why C++ is a good choice to write a compiler. Of course C is good for this purpose too, because many compilers are written either in C or C++ but I am more interested in C++ this time. ...