compiler

Digital Mars D compiler; acquiring ASM output

I am reading the book from Andrei Alexandrescu about the D programming language. He's an excellent writer and does a pretty good job at explaining aspects of the D language. I however find certain constructs hard to understand when I cannot imagine the ASM output or consequences of certain keywords (such as in, out, etc. or other constru...

Detecting compiler versions during compile time

This is both a question and a reference and I am hoping that people can build upon this so that it can be reused by people with similar questions. How can we reliably detect a particular version of a C/C++/ObjC compiler? Now I know the answer for Visual Studio and partially know the answer for Xcode. Now for the Visual Studio compiler...

Production usage of compiling Ruby Red to javascript

There has been a lot of discussion over this ability (such as in this SO question, or this github thread) to compile ruby to Javascript. The original version of Red is quite old, but Julius Eckert seems to have picked it up and made it far more usable (and even presented it) After seeing the community backing up compiling other language...

smart automatic C code generator with nested if in python

I'm generating automatic C++ code from python, in particular I need to select some events for a list of events. I declare some selections: selectionA = Selection(name="selectionA", formula="A>10") selectionB = Selection(name="selectionB", formula="cobject->f()>50") selectionC = selectionA * selectionB # * means AND this generate the C...

Is it possible to read an LLVM bitcode file into an llvm::Module?

I'm writing a compiler with LLVM. Each source file is compiled into an LLVM bitcode file. Eventually the linker links and optimizes all the bitcode files into one final binary. I need a way to read the bitcode files in the compiler in order to access the type information. The LLVM documentation shows a class called BitcodeReader, but th...

What is the behavior of integer division in C?

i.e. - int result; result = 125/100; or result = 43/100; Will result always be the floor of the division? What is the defined bahavior? If you could point me in the right direction, i would appreciate it. Thank You. ...

Distributing a statically linked ELF 32bit Binary - Will it run on all platforms?

My team is ready to release the first version of our Linux program and would like to do so in the easiest possible manner (for users). The program needs no external files, no install, and is statically linked. ELF 32-bit LSB executable, Intel 80386, version 1 (GNU/Linux), statically linked, for GNU/Linux 2.6.15, not stripped My quest...

The stack is created by compiler or OS/architecture

This question is a follow up of my previous question http://stackoverflow.com/questions/3572610/stack-growth-direction I would like to know whether stack is created by a compiler or OS/architecture ? Also how does OS knows about these compiler specific things ? For ex: C++ allows variables to create data on stack and heap while java a...

Start Java main in another process (VM)

Hi, I have a server client project and for testing purposes I want to start the server in a whole new process. The problem is, I have just a main() method in project, no jar. So my guess would be something like Runtime.getRuntime().exec("javac MyServer.java"); Runtime.getRuntime().exec("java class MyServer"); But I am really not sure ...

standalone grammar and parser for php

i'm looking for a ready-made grammar and parser for php (at least 5.2), ideally an utility/library that can parse php code into a readable AST, e.g. xml. The parser itself doesn't have to be written in php, the source language doesn't matter much. ...

Loading numpy into IronPython

Hi, I've recently installed Ironpython + tools and having trouble loading external modules (numpy). this is my test code: import numpy numpy.test() when writing my simple test, intellisense can find numpy, however when it's run from vs2010, I get: ImportException was unhandled by user code: No module named numpy IronPython Consol...

Statically Linked ELF 32 bit Binary - Distro Specific

Hi All, I've already determined that statically linked programs can't always run between different distros. My question here, is if it is safe to distribute a statically linked program that is distro specific. For example, I'd have an Ubuntu version of the binary, and a Redhat version of the binary and the user just downloads the cor...

Formally constructing Control Flow Graph

Hi, Im writing a compiler for university project, and I would like to transform my Abstract Syntax Tree into a Control Flow Graph(CFG). Im thinking that the nodes(V) in the CFG should be nodes from the AST. I know algorithmically how to construct the edge set (G=(V,E)) but Im having a hard time writing the process a bit more formally ...

Javascript Compiler / Lexer

I'm looking for a free open-source Javascript/ECMAScript compiler or lexical analyzer, in order to compile javascript code to an executable that can run on Linux. I understand that I will probably need to add some objects/APIs for the javascript code to be able to perform operations within the O/S. I was hoping that some of this work h...

Dynamically compiling and running shaders from file in XNA

Hello, im wondering if its possible to dynamically compile a pixel-shader from file and apply it to a mesh. First I'll just start with some background information. I have a system which creates HLSL pixel-shaders based on a range of data which is not really important to the question. What is important is that these shaders do not use te...

How can I disable compiler warnings in Eclipse on a file specific basis?

In my Eclipse project are a handful of generated .java files that I need to use for SQLJ and I can't move to a separate project (due to Administrative Overhead). These files are also regularly regenerated so editing them is unfortunately out. Unfortunately these files generate a few hundred java compiler warnings which drown out the use...

shared_ptr: horrible speed

When comparing two variants of pointers (classic/shared_pt) I was surprised by a significant increase of the running speed of the program. For testing 2D Delaunay incremental Insertion algorithm has been used. Compiler settings VS 2010 (release) /O2 /MD /GL, W7 Prof, CPU 3.GHZ DualCore Results: shared_ptr (C++ 0x00): N[points] ...

Why is it so hard to make 64-bit versions of software?

What are all the aspects must be taken into account when designing your software into 64-bit environment, and why wouldn't the same code work as 32-bit and 64-bit (when talking about applications)? Drivers obviously are a different beast, missing 64-bit drivers are infamous problem for almost all hardware. What's so different in that do...

Any good IDEs for basic C programming?

Possible Duplicate: What is the best IDE for C Development / Why use Emacs over an IDE? I'm looking for a C IDE that I can use for my Computer Science class. An ideal IDE would feature a built-in compiler and debugger within the program, as Eclipse for Java, or Visual Studio for C#, already do. Do any such IDEs exist, or am I...

Visual COBOL for 2010 visual studio

Hi, I just installed trail version of Visual COBOL with visual studio 2010 from Micro Focus. I am trying to compile one of my old COBOL programs into .NET assembly. When I compile, it creates .IDY file exension file in the bin floder. I want to decompile assembly to C# code. Is there anyway I can do this? Thanks.. ...