简体   繁体   English

可以将CoffeeScript编译为Haxe吗?

[英]Can CoffeeScript be compiled to Haxe?

我现在正在学习Haxe,我想知道是否有可能将任何编程语言编译为Haxe(而不是Haxe)。如果没有任何编程语言可以编译为Haxe,那么至少可以将一小部分编程语言(例如Coffeescript)编译成Haxe吗?

At this time, there is no way to compile coffeescript or similar into Haxe. 这时,没有办法将coffeescript或类似的东西编译成Haxe。

CoffeeScript is a source-to-source compiler, so you would change need to change it from going CoffeeScript->JS to CoffeeScript->Haxe, CoffeeScript是一个源到源的编译器,所以你可以改变从将CoffeeScript-> JS改为CoffeeScript-> Haxe的需要,

I'm not sure how difficult it would be, and you have to remember that Haxe has a bunch of features that Javascript doesn't, all of which would need to be represented in the "new" coffeescript. 我不确定它会有多难,你必须记住Haxe有一些Javascript没有的功能,所有功能都需要在“新”coffeescript中表示。 Things such as: type information, enums, typedefs, iterators, macros, conditional compilation, untyped blocks, metadata, property access etc. You would need to figure out how to represent each of these in coffeescript in a way which doesn't conflict with itself or with existing syntax. 诸如:类型信息,枚举,typedef,迭代器,宏,条件编译,无类型块,元数据,属性访问等等。您需要弄清楚如何以不与之冲突的方式在coffeescript中表示这些中的每一个本身或现有语法。

I too have thought it might be nice, as CoffeeScript has such a clean syntax, but then looking at the complexity of getting it to work I decided that curly brackets and semi colons aren't so bad :) 我也认为它可能很好,因为CoffeeScript有这么干净的语法,但后来看着让它工作的复杂性我决定花括号和半冒号不是那么糟糕:)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM