Tagged Questions

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
56 views

How is an IDE compiled?

What procedures are used to compile an IDE? For instance, Visual Studio 2012 is written in both C++ and C#, while Eclipse is written in Java. So then, is Visual Studio 2012 compiled from Visual Studio ...
0
votes
0answers
22 views

How to ignore the following compiler warning? [migrated]

When compiling the following piece of code (g++ 4.6), I get the (expected) warning message: ./test.cpp:3:7: attention : address of local variable ‘ii’ returned [enabled by default]. int *get_ii() { ...
3
votes
2answers
283 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
705 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
82 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
292 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. ...
-1
votes
1answer
204 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
151 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
145 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
157 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
234 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
183 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
157 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
166 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
161 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
222 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
823 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
99 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
213 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
309 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
407 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
41 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
201 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
1k 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
110 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
248 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
422 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
3k 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
243 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
313 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
275 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
100 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
459 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
535 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
196 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
674 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 ...
25
votes
4answers
2k 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. ...
2
votes
0answers
139 views

CoffeeScript translates to JavaScript. Is there something like it for C? [duplicate]

Possible Duplicate: Is there a language that transcompiles to C with a better syntax? There are many language implementations which compile to C. However, most of them have some language ...
1
vote
3answers
206 views

Integer sign and compilation via C

I'm writing a compiler that uses the time-honored strategy of using a C compiler as the back end, and I'm trying to figure out exactly how to handle integer sign. I'm using machine word integers as ...
7
votes
9answers
861 views

Why are virtual machines required?

Instead of compiling the source code for the respective OS (on which it is targeted), you compile once and run everywhere. For the sake of this question, I would call it VM (for example, both for ...
4
votes
3answers
895 views

Is there a language that transcompiles to C with a better syntax?

CoffeeScript is a language with a very clean Ruby-like syntax that transcompiles to JavaScript. Does the same thing exists with C? Then writing more readable and as fast as original C programs would ...
2
votes
5answers
438 views

How should I evaluate new browser languages?

In these days there are many projects whose aim is to bring new languages to the browser by compiling them to JavaScript. Among the others one can mention ClojureScript, CoffeScript, Dart, haXe, ...
7
votes
8answers
524 views

Are there any concrete examples of where a paralellizing compiler would provide a value-adding benefit?

Paul Graham argues that: It would be great if a startup could give us something of the old Moore's Law back, by writing software that could make a large number of CPUs look to the developer ...
2
votes
2answers
121 views

Syntax tree dump format

When writing a compiler, it is useful to include the ability to dump the abstract syntax tree in a human readable format, for debugging purposes. This output might also be useful for other tools like ...
4
votes
1answer
198 views

What would be the best way to learn about compilers, and executable formats? [closed]

I want to write my own compiler for my own language. Yes, it's going to be hard, and it will take long, but I think it will be worth it. I have looked into OSDev.org, and read about executable ...
8
votes
5answers
1k views

Interpreted vs Compiled: A useful distinction?

A lot of questions get asked here about interpreted vs compiled language implements. I'm wondering whether the distinction actually makes any sense. (Actually the questions are usually about ...
7
votes
3answers
2k views

Why doesn't Python need a compiler?

Just wondering (now that I've started with C++ which needs a compiler) why Python doesn't need a compiler? I just enter the code, save it as an exec, and run it. In C++ I have to make builds and all ...
4
votes
1answer
223 views

Visualizing a CUP grammar

I am implementing a grammar in CUP, and it would often be helpful to see everything at a glance. This could also be useful in finding errors quickly. Are there any programs out there that will ...

1 2 3