1

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?

1
  • 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. Sep 27, 2011 at 14:57

4 Answers 4

4

HipHop from Facebook transforms PHP code into C++.

3

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.

1
  • AFAIK, GHC can still emit C - at least the -C option is still there...
    – tdammers
    Sep 27, 2011 at 9:57
2

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).

2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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