Question

I have been thinking about source transformers like HipHop and Haxe. From their respective websites, I see that these tools converts a source language to target language and then uses the compilers of the target language to produce the final executable. The part that I find confusing is that how these tools deal with the case whether the source language is a memory managed laguage (PHP, Haxe lang) and the target language is a non-memory managed language(C / C++). I know that Mono adds a VM at compile time to deal with this. What do tools like HipHop and Haxe do? Where can I find articles in programming language / compiler literature related to this topic?

Thanks.

Was it helpful?

Solution

Haxe requires Garbage Collection and it's not just a transformer, it also adds everything that's needed to the target language. The C++ Target f.e. adds Reflection, Garbage Collection and other Kinds of compatibility classes to the C++ Runtime. This allows you to use a lot of functionality on all plattforms.

You can take a look at the runtime files here.

It's best to try it out and look at the generated c++ code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top