Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I suspect there're programs that instead of emitting machine code instead emit C++ code and then start a mainstream C++ compiler to compile it to machine code.

I can't find any notable examples except MIDL which emits some rather primitive code.

What are notable examples of such systems?

share|improve this question
2  
Most new languages go through a phase of emitting C code (before they get their own backend). Mainly this is because C compilers are nearly ubiquitous across all platforms and quite efficient. –  Loki Astari Sep 27 '11 at 14:57

4 Answers 4

up vote 4 down vote accepted

HipHop from Facebook transforms PHP code into C++.

share|improve this answer

It's possible with MATLAB/Simulink (you can choose C or C++ but C is more often use at least if the target is embedded).

Another example is ArgoUML (open source UML modeling tool).

share|improve this answer

The Eiffel compiler in EiffelStudio compiles to C (maybe with some C++ in it). One reason why it takes ages to compile even the simples Eiffel programs.

The Haskell compiler GHC used to target a C-like language C--. Today, it generates machine code directly. A backend targetting LLVM also exists.

share|improve this answer
    
AFAIK, GHC can still emit C - at least the -C option is still there... –  tdammers Sep 27 '11 at 9:57

Automatic code generation is common among design tools. For instance, you specify your design with UML, Statecharts or both and code is generated. You only have to fill in placeholders for implementing methods.

Examples of such tools are Rhapsody and Topcased.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.