compiler

Interesting compiler projects

I'm currently in the process of choosing a project for a grad-level compiler course to be done over the next 8 weeks. I'd like to do something related to optimization since I haven't worked much in that area before, but anything in the field is fair game. What was the most interesting compiler-related project you've done? What did you ...

?? Dynamic ?? parser

Does there exist a parser that generates an AST/parse tree at runtime? Kind of like a library that would accept a string of EBNF grammar or something analogous and spit out a data structure? I'm aware of antlr, jlex and their ilk. They generate source code which could do this. (like to skip the compile step) I'm aware of Boost::Spirit...

Equivalent of Class Loaders in .NET

Does anyone know if it possible to define the equivalent of a "java custom class loader" in .NET? To give a little background: I am in the process of developing a new programing language that targets the CLR, called "Liberty". One of the features of the language is its ability to define "type constructors", which are methods that are e...

Is there a FOSS batch compiling solution for Delphi that takes version as an input parameter?

Is there a FOSS batch compiling solution for Delphi that takes version as an input parameter? I am using Delphi 7 and this remains the most tedious operation. Are there any other solutions, workarounds to make this easy. ...

Why does GCC-Windows depend on cygwin?

I'm not a C++ developer, but I've always been interested in compilers, and I'm interested in tinkering with some of the GCC stuff (particularly LLVM). On Windows, GCC requires a POSIX-emulation layer (cygwin or MinGW) to run correctly. Why is that? I use lots of other software, written in C++ and cross-compiled for different platforms...

Can a recursive function be inline?

inline int factorial(int n) { if(!n) return 1; else return n*factorial(n-1); } As I was reading this, found that the above code would lead to "infinite compilation" if not handled by compiler correctly. How does the compiler decide whether to inline a function or not ? ...

implementing a compiler in "itself"

Hi, Intuitively, it would seems that a compiler for language Foo, cannot itself be written in Foo. More specifically, the first compiler for language Foo cannot be written in Foo, but any subsequent compiler could be written for Foo. But is this actually true? I have some very vague recollection of reading about a language whose first ...

Have you ever crashed the compiler?

Everyone (at least everyone who uses a compiled language) has faced compilation errors but how many times do you get to actually crash the compiler? I've had my fair share of "internal compiler errors" but most went away just by re-compiling. Do you have a (minimal) piece of code that crashes the compiler? ...

How to tell if .net app was compiled in DEBUG or RELEASE mode?

I have an application installed on my computer and I need to find out if it was compiled in DEBUG mode or not? I've tried to use Reflector, but it does not show anything specific. Here is what I see: // Assembly APPLICATION_NAME, Version 8.0.0.15072 Location: C:\APPLICATION_FOLDER\APPLICATION_NAME.exe Name: APPLICATION_NAME, Version=8....

What causes javac to issue the "uses unchecked or unsafe operations" warning

For example: javac Foo.java Note: Foo.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. ...

Is there a Ruby .NET Compiler?

Is there a .NET Framework compiler for the Ruby language? I've heard of the DLR (Dynamic Language Runtime), is this going to enable Ruby to be used with .NET development? ...

Good Book on C++ Internals?

I'm looking for a good book or website on how C++ works under the hood. Some topics might be virtual function lookup tables, function name mangling, class/struct relationship, etc. Even better, something that covers other languages as well (I'd love to know more about Perl's internals) Thanks! ...

What's the Compiler Book People are talking about when They say the "Dragon" book?

Also is there a better book you'd recommend for learning about compilers, or is that the one to get? ...

Tracking down intermittent 'Object reference not set to an instance of an object.' error on build

I could use some help trying to track down an intermittent error that I've been having with our ASP.Net project for quite some time. Intermittently when building the solution, the build will fail with the error "/: Build (web): Object reference not set to an instance of an object." The error has no associated file, line, column or proje...

Any way to cast with class operator only?

Kind of a random question... What I'm looking for is a way to express a cast operation which uses a defined operator of the class instance I'm casting from, and generates a compile-time error if there is not a defined cast operator for the type. So, for example, what I'm looking for is something like: template< typename RESULT_TYPE, ty...

Constants and compiler optimization in C++

I've read all the advice on const-correctness in C++ and that it is important (in part) because it helps the compiler to optimize your code. What I've never seen is a good explanation on how the compiler uses this information to optimize the code, not even the good books go on explaining what happens behind the curtains. For example, ...

Translate C# code into AST?

Is it currently possible to translate C# code into an Abstract Syntax Tree? Edit: some clarification; I don't necessarily expect the compiler to generate the AST for me - a parser would be fine, although I'd like to use something "official." Lambda expressions are unfortunately not going to be sufficient given they don't allow me to use...

Programmer's Notepad not Capturing Make Output?

I've been using Programmer's notepad for a while now, I find it to be an amazingly simple tool and I prefer to use it on projects where I know I don't need most of the standard IDE overhead. However, I've recently run into this problem when running the program on Windows Vista. I find that when running the built in "make" command, the o...

How to exclude files from Visual Studio compile?

I'm in the process of refactoring a project. I've got an entire subfolder which is known to be broken. Is there any declarative way to exclude that folder from the compile temporarily while I test the refactoring thus far? I realize I could delete the folder, but I'd like to do this through configuration if possible. ...

Is there an equivalent to -pedantic for gcc when using Microsoft's Visual C++ compiler?

I would like to have my warnings set to the highest level using Microsoft Visual C++ compiler. Similar to using -pedantic on gcc. What compiler switches do you use to have the most warnings enabled? ...