compiler

Release vs Debug Build Times

I have always believed that Debug builds are slower than Release builds since the compiler needs to additionally generate debugger information. I was recently surprised to hear one of my colleagues saying that release builds usually take more time. (I believe that it is only because of incremental linking/compiling). In general, which o...

Haskell - How to best to represent a programming language's grammar?

Hey, I've been looking at Haskell and I'd quite like to write a compiler (as a learning exercise) in it, since a lot of it's innate features can be readily applied to a compiler (particularly a recursive decent compiler). What I can't quite get my head around is how to represent a language's grammar in a Haskell-ian way. My first thoug...

Building Predictive Parser and parsing table

Hello, I'm trying to build a parser for the following grammar (dragon book ex. 4.4.1 pg. 231) S->0S1|01 So first I left factored the grammar (eliminate ambiguity for deciding which rule to choose) and the result: S->0S' S'->0S|1 And constructing the parsing table yielded (apologies for the formatting the table html markup was removed...

Best practices for a C++ portable opensource application

I am starting an open source cross platform project in C++. My development environment is Linux. There may be other developers who develop from different platforms as well. So I need some help in getting started with the configuration and development environment setup, so that all developers from multiple platforms can develop easily. ...

Visual Studio Play or Build to compile.

I recently had a problem with the Issue Tracker starter kit that seemed to be resolved by using the "build" option. Previously, I would typically use the "play" button to debug my app, then just stage the files when everything was working, assuming that the last time I hit the "play" button, it had fully compiled the app. Anyhow, I'm...

Compile to java bytecode (without using Java)

My compilers class is creating a language that we intend to compile to Java Bytecode. We have made plenty of progress and are nearing the time where it's time for code generation. We are having problems locating information on how to create .class files from our compiler. Do you have any resources that can give us some assistance? We al...

IS C++ converted into MSIL?

I have been a long time C# and .Net developer, and have been playing with the idea of learning c++. One of the primary reasons I have been thinking about this, is how much faster C++ can be over apps using the .Net framework. But am I right in assuming that if I write a C++ app in Visual Studio, and/or reference .Net libraries in a C++...

Flash Compiler/Interpreter Optimizations

I started working with ActionScript 3 / Flash 9 fairly recently, coming from a "real" programming background, and I have become a bit curious as to exactly what kind of machine code it ends up with at the end of the day. I would like to know what kind of optimizations the compiler makes when putting together the SWF with the optimize fl...

How would one go about testing an interpreter or a compiler?

Hello all! I've been experimenting with creating an interpreter for Brainfuck, and while quite simple to make and get up and running, part of me wants to be able to run tests against it. I can't seem to fathom how many tests one might have to write to test all the possible instruction combinations to ensure that the implementation is p...

How do languages like C# and Java avoid C/C++-like independent compilation?

For my programming languages class, I'm writing a research paper on some papers by some important people in the history of language design. One by CAR Hoare struck me as odd because it speaks against independent compilation techniques used in C and later C++ before C even became popular. Since this is primarily an optimization to speed...

Why does the order affect the rounding when adding multiple doubles in C#

Consider the following C# code: double result1 = 1.0 + 1.1 + 1.2; double result2 = 1.2 + 1.0 + 1.1; if (result1 == result2) { ... } result1 should always equal result2 right? The thing is, it doesn't. result1 is 3.3 and result2 is 3.3000000000000003. The only difference is the order of the constants. I know that doubles are impl...

How can I find the target Java version for a compiled class?

Duplicate: Tool to read and display Java .class versions If I have a compiled Java class, is there a way to tell from just the class file what its target version compatibility is? Specifically, I have a number of class files, compiled to Java 6, which are running under Java 5 and giving the the "Unrecognized version" error. I wan...

asp.net someusercontrol_ascx is defined in multiple places error

I've had this intermittent issue when using asp.net. My site is dynamically compiled. Sometimes when I modify a user control my web site complains that it is defined in multiple places. It almost seems like the old control did not get removed from the asp.net temporary files and the updated control is compiled to the same directory s...

VB Unreachable code error/warning

I've been mostly working with VB.Net for over a year and just noticed this Am I going insane, or does VB.Net NOT have an "Unreachable code" warning? The following compiles quite happily with nary a warning or error, even though there is a return between the two writeline calls. Sub Main() Console.WriteLine("Hello World") Retur...

How can I tell IIS to compile specific folders independently of the rest of my Web site?

Is there any way to get ASP.Net to compile different folders independently? I have a Web app that uses some commercial software. The admin UI for this software is in a single folder -- there are about a 1,000 files in there, all told. (I've looked through it -- it ain't the greatest code ever written...) This folder takes forever to ...

Compilers and negative numbers representations

Recently I was confused by this question. Maybe because I didn't read language specifications (it's my fault, I know). C99 standard doesn't say which negative numbers representation should be used by compiler. I always thought that the only right way to store negative numbers is two's complement (in most cases). So here's my question: ...

Are there any compiler development forums?

I am interested in in joining an already established compiler or interpreter development project but I haven't found any useful resources so far. I'm looking for something that has a smallish development team and where the work will be substantial (i.e. not working on bug fixes). SourceForge of course has a lot of projects but it definit...

More difficult to build: Emulator or compiler?

Given a proficient developer with 10-20 years of experience that has never built either a compiler or an emulator, which would be more of challenge? Could you compare the issues that would be road blocks for either. Thanks. ...

How is the order of Compilation of source files decided

I have a workspace containing many *.c files, which I compile. (I could use any toolchain say MSVC6.0, or gcc etc) Which source file is compiled first? How is the order of the files to be compiled subsequently decided? ...

Is this C# compiler behaviour a bug or a feature?

Why is the following code snippet valid in C#? This is a feature of the compiler or a bug? class A { public class B : A { } } class C : A.B { public void Foo(C.B b) { } } class D : A { public void Foo(D.B.B.B.B b) { } } See Also .NET Nested Classes ...