与 Actionscript-3 相比,使用 Haxe 的优点和缺点是什么?
我正在考虑使用 Haxe 代替 AS3。
这样做有什么缺点呢?我可以考虑:
- 使用本机 AS3 库的困难。
- 语言翻译后调试困难。
- Haxe 还很年轻,可能还有一些粗糙的地方。是吗?
你们中有人有过 Haxe 黑暗面的经验吗?
有什么优点?我听说过:
- 性能。
- 多个目标(但我不明白这有什么用)
- 更好地输入 AS3
- 也许更好的语法。
Haxe 足够大,应该有更多。海克斯的优点是什么?
编辑:
如果没有真正的缺点那么为什么 Haxe 不取代 AS3?
I'm thinking about using Haxe in place of AS3.
What are the disadventages of that? I can think about:
- Difficulties with using native AS3 libraries.
- Difficulity of debugging after language translation.
- Haxe is quite young, it may have some rough edges. Does it?
Does any one of you have expirience with Haxe dark sides?
What are the adventages? I've heard:
- Performance.
- Multiple targets (But I don't see how that is useful)
- Better typing that AS3
- Maybe better syntax.
Haxe is big enough that there should be more. What are the pros of Haxe?
Edit:
If there are no real disadvantages then why Haxe is not replacing AS3?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你的第一点肯定是正确的。一些“原生”库(例如 Flex)可能需要一些gym才能包含在您的项目中。在绝大多数情况下,这是一个相当顺利的过程。 Haxe 支持多个 -swf-lib,允许导入资产的代码在您的应用程序中立即可用。请注意,导入的库不仅是嵌入的,而且被识别为代码资产,因此如果您的 IDE 与 Haxe 集成,您也将拥有类型完成功能。
关于调试,翻译完全没有问题,因为该语言没有翻译为 AS3,而是直接编译为 AVM2 字节码。当 -debug 开关打开时,带有源代码引用(文件名、行和位置)的完整堆栈跟踪将被完全保留。未捕获的异常将准确地指向生成它的代码行。
Haxe 并不是那么年轻,而且 AVM2 输出肯定是支持最好的。我认为没有粗糙的边缘。
在你概述的优点中,我想强调的是,多个目标可能是巨大的。当然,要真正利用它,您不能真正依赖特定于 AS3 的外部库。即便如此,仍然存在您想要/可以跨项目重用的大块代码。
提一下其他一些优点:
Your first point is surely true. Some "native" libraries (such as Flex) may require a little of gym to be included in your project. In the vast majority of cases it is a quite smooth process. Haxe supports multiple -swf-lib which permit to have the code of the imported assets immediately available in your application. Note that the imported libs are not just embedded but are recognized as code asset, so if your IDE is integrated with Haxe you will have type completion for that too.
About the debugging there are no issues at all for the translation, that because the language is not translated to AS3 but directly compiled to AVM2 bytecode. When the -debug switch is on, the full stack trace with source code references (filename, line and position) is fully preserved. An uncaught exception will point you exactly at the line of code that generated it.
Haxe is not really that young and for sure the AVM2 output is the one with the best support of all. There are no rough edges in my opinion.
Of the pros you have outlined I want to underline that multiple targets can be huge. Of course to take really advantage of it you can't really rely on external libs specific for AS3. Even so there are always big chunks of code that you want/can reuse across projects.
To mention a few other advantages: