Haxe 编译器可以将任何 C# 代码转换为 Haxe 吗?

2024-03-31

首先,我对 Haxe 非常陌生,所以我在这里问超级菜鸟问题,我有两个问题。

1)我的第一个问题是我知道Haxe编译器可以从Haxe转换为任何其他语言(支持),但是它可以将其他语言(支持)的源代码转换为Haxe吗?

2)如果它能做到这一点,它的能力有多大,比如它只能将一些文件(比如 C# 中的文件)转换为 Haxe,或者如果我提供一个巨大的存储库,比如这样说https://github.com/dotnet/corefx https://github.com/dotnet/corefx or https://github.com/tensorflow/tensorflow https://github.com/tensorflow/tensorflow它会转换其中的所有内容吗(是的,我知道这要求太多了,但无论如何)?


不,Haxe 编译器仅向一个方向进行转换,即:

Haxe 代码 ⭢ 选定的目标

对于另一个方向,您需要一个独立于 Haxe 编译器的外部工具。多年来,创建了几个这样的工具(有些被放弃了):

  • ActionScript 3 ⭢ Haxe:
    • as3hx https://github.com/HaxeFoundation/as3hx
    • ax3 https://github.com/innogames/ax3
  • Java ⭢ Haxe:
    • java2haxe https://github.com/Danielku15/java2haxe
    • JTransc https://github.com/jtransc/jtransc
  • C# ⭢ Haxe:
    • CS2HX https://cs2hx.codeplex.com/releases/view/114192
    • Phase https://github.com/CoderLine/Phase
  • PHP ⭢ Haxe:
    • PhpToHaxe http://phptohaxe.haqteam.com/code.php
  • Go ⭢ Haxe:
    • 塔迪斯Go https://github.com/tardisgo/tardisgo
  • TypeScript ⭢ Haxe:
    • 节点-ts2hx https://github.com/jeremyfa/node-ts2hx

还有一些工具可以生成externs,而不是编译源到源:

  • TypeScript ⭢ Haxe:
    • ts2hx https://github.com/Simn/ts2hx
    • 哈克谢-德斯托哈谢 https://bitbucket.org/yar3333/haxe-dtstohaxe/src
    • dts2haxe https://github.com/aduros/dts2haxe
    • dts2hx https://github.com/haxiomic/dts2hx
  • Python ⭢ Haxe:
    • pyextern https://github.com/andyli/pyextern
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Haxe 编译器可以将任何 C# 代码转换为 Haxe 吗? 的相关文章

随机推荐