compiler

Is C inefficient compared to Assembly?

Possible Duplicate: When is assembler faster than C? Hello, This is purely a theory question, so, given an "infinite" time to make a trivial program, and an advanced knowledge of C and Assembly, is it really better to do something in Assembly? is "performance" lost when compiling C into Assembly (to machine code)? By perfor...

What compiler tools are used by "official" language developers?

There are many lexical analyzer and parser generators out there - lex/flex and yacc/bison, jflex and javacup, gplex and gppg, etc. I'm wondering what tools are used by the official developers of languages - do Sun and Microsoft use any of these in developing Java and .NET, or do shops of that size use only custom internal tools? ...

Good, small Haskell compiler for linux?

I have SEVERE space restraints as far as linux goes, since I run linux off a 4GB flash drive. I know GHC is the preferred compiler for Haskell, but the GHC package is 280MB, which is way too big for me. Is there a smaller Haskell compiler for linux that works fine? ...

C# Property Access Optimization

In C# (or VB .NET), does the compiler make attempts to optimize property accesses? For eg., public ViewClass View { get { ... Something is computed here .... } } if (View != null) View.Something = SomethingElse; I would imagine that if the compiler could somehow detect that View remains con...

Compiler problem in a (very) simple C++ program that gets numeric input from a file.

#include <iostream> #include <fstream> #include <cstdlib> using namespace std; const int FILENAME_MAX=20; int main() { ifstream input; char name[FILENAME_MAX + 1]; int value; do { cout << "Enter the filename (maximum of " << (FILENAME_MAX+1) << " characters: "; cin >> name; input.ope...

C++ int a[n] working in g++ but not with vs2008

I have the following code: ... int n; cin >> n; int numbers[n]; ... It compiled with netbeans on mac using g++ (I think) and it didn't compile using vs2008 on windoze. Why is it so hard to make it work with every compiler? The size of the array is known before allocating it. EDIT: I know abot std::vector. Actually this was part of a...

xcode 3.2.3 compiler warning

'ld: warning: directory '/Volumes/Skiiing2/CD/ViewBased/Unknown Path/System/Library/Frameworks' following -F not found' I am getting this error for quite some time now... I also upgraded to latest xcode 3.2.3 with latest iphone os 4.0 but still getting this error. I found some posts about it telling to remove invalid framework search p...

Left recursion in grammar with "." operator

So, I'm writing an LL(1) parser (for kicks) and I ran into a problem with the member selection operator ("." as in "var.function()"). Here's a simplified grammar I'm trying to analyze with the parser: postfix_expression : postfix_expression '(' ')' | postfix_expression '.' identifier | identifier ; The above grammar i...

How can I validate CSS within a script?

Is there a library out there which will validate CSS? The only tools I can find to do so are web sites. If one of these sites has an API, that would fit the bill, too. I have a script that serves as a CSS compiler. It sets various variables according to settings for a theme, and generates and writes a CSS file. Before committing to wri...

compiling error with vector in c++

I'm stuck! I have this very simple test code and I can't get it to compile! I have used the same code many times before but now it won't work! I have this simple program #include <vector> #include <iostream> #include "Rswap.h" using namespace std; int main(){ Rswap test(); cin.get(); return 0;} And then the rswap.cpp... #include ...

Which compiler for default templates args in function

Hi, Is there a compiler which would complile function template definition with new C++ feature namely default templates arguments in function definition? ...

Will F# ever be open-sourced?

There was discussion in early 2009 about whether Microsoft would release the source for the F# compiler under the MS-PL/another license. A StackOverflow thread mentioned the state as of then. Since then a lot has happened. We've seen an official release of F# with the .NET Framework 4.0 (and Visual Studio 2010), and for all I know, it's...

How use to write programme that involve with a lot of active calculation? In excel 1M+ Row and 20+ column

First, I dont have any experience with programming. If I ever start, then this would be probably my first. I keep looking for answer until I found this site. I am looking outside the box because in excel doing a data of 1 million + row and 20 + column would take a very long time just to wait for the calculation to be done and the copy ...

What compilers can detect pure mathematical functions and optimize them (without telling you so)?

I have seen that GCC is not able to detect pure mathematical functions and it needs you to provide the attribute "const" to indicate that. What compilers can detect pure mathematical functions and optimize them (without telling you so)? ...

Lua to JVM compiler?

Is there a compiler for Lua that compiles to JVM bytecode (and would thus be able to run on Google app engine)? ...

By design, why does the C# compiler allows any float or double values to be divided by zero?

Hi all, By design, why does the C# compiler allows any float or double values to be divided by zero? class Program { static void Main(string[] args) { double x = 0.0 / 0; float y = 1f / 0; } } ...

Strange visual studio 2008 C++ compiler error

I have three lines of code: //int pi; activation->structSize = sizeof(rmsActivationT); int pi; //program wont compile with this here every time I uncomment the second int pi and comment the first int pi I get this error: syntax error : missing ';' before 'type'. When i uncomment this first int pi and comment the second int pi, my c...

Invalid operands to binary

Hi, I have a method to check weather a number is even or odd: -(BOOL)numberIsEven:(unsigned int *)x { if (x & 1) { return TRUE; } else { return FALSE; } } however whenever I compile it I get the error: Invalid operands to binary % So it's compiling into assembly as a modulus function and failing, somehow, however if...

Objective-C preprocessor available?

Does anyone know if the source code for Objective-C is still available from when it was just a pre-processor? Would be curious to see how it was implemented back then. Thanks. ...

How do I keep a constant definition in a header file and not have it linked into every library?

Here's the scenario. We use Visual C++ 9. There's a C++ library intended to be used by many other libraries. Its interface is in a header: #pragma once //CommonLibraryHeader.h CSomeClass GetSomeClassFunction(); //is defined in some .cpp file const CSomeClass MagicValue( 100, 200 ); //some predefined value that the previous function ret...