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?

  • 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. – Martin York Sep 27 '11 at 14:57
4

HipHop from Facebook transforms PHP code into C++.

|improve this answer|||||
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.

|improve this answer|||||
  • AFAIK, GHC can still emit C - at least the -C option is still there... – tdammers Sep 27 '11 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).

|improve this answer|||||
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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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