问题描述
首先,我是Haxe的新手,所以我在这里问超级菜鸟问题,我有2个.
First I am super new to Haxe, so I am asking super noob question here, and I have 2 of them.
1)我的第一个问题是我知道Haxe编译器可以将Haxe转换为任何其他语言(受支持),但是可以将其他语言(受支持)的源代码转换为Haxe吗?
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)如果它可以做到,那么它的功能有多少,比如它只能将几个文件转换成C#到Haxe,或者如果我给出一个巨大的仓库,比如说这个 https://github.com/dotnet/corefx 或 https://github.com/tensorflow/tensorflow 它将转换其中的所有内容吗(是的,我知道这要问的太多了,但无论如何)?
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)??
推荐答案
否,Haxe编译器仅在一个方向上进行编译,即:
No, the Haxe compiler only transpiles in one direction, which is:
对于另一个方向,您需要一个独立于Haxe编译器的外部工具.多年来,创建了一些这样的工具(有些被废弃了):
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):
- ActionScript 3⭢Haxe:
- ActionScript 3 ⭢ Haxe:
- as3hx
- java2haxe
- JTransc
- CS2HX
- Phase
还有一些工具可以生成 externs ,而不是从源到源进行编译:
There's also some tools for generating externs, rather than compiling source-to-source:
- TypeScript⭢Haxe:
- TypeScript ⭢ Haxe:
- ts2hx
- haxe-dtstohaxe
- dts2haxe
- dts2hx
这篇关于Haxe编译器可以将任何C#代码转换为Haxe吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
- TypeScript ⭢ Haxe:
- ActionScript 3 ⭢ Haxe: