Search code examples
c#haxe

Can Haxe compiler convert any C# code to Haxe?


First I am super new to Haxe, so I am asking super noob question here, and I have 2 of them.

1) My first question is I know Haxe compiler can convert from Haxe to any other language (supported) but can it convert source code in other languages(supported) to Haxe?

2) If it can do so how much is its capability like can it only convert a few files lets say in C# to Haxe or if I give a huge repo like lets say this https://github.com/dotnet/corefx or https://github.com/tensorflow/tensorflow will it convert everything in it (ya I know this is too much to ask, but anyways)??


Solution

  • No, the Haxe compiler only transpiles in one direction, which is:

    Haxe Code ⭢ Selected Target

    For the other direction, you'd need an external tool independent of the Haxe compiler. Over the years, several such tools were created (some abandoned):

    There's also some tools for generating externs, rather than compiling source-to-source: