Search code examples
javascripthaxe

JavaScript code resulting from Haxe compilation


I'm a senior ActionScript dev and would like to start converting some of my class libraries to JavaScript, especially those that make use of bitmap manipulation and would target the canvas element in HTML.

My question is how clean is the resulting JavaScript code from a Haxe/HaxeNME compilation? Is it easy to debug?

Or would I be better off forgetting Haxe and coding in JavaScript from scratch?


Solution

  • Well, it's rather readable, but it's not the best idea to debug it, especially if you use a lot of inlining and such.

    Currently Haxe is getting support for JavaScript source mapping, which means that you can debug your Haxe code in the browser. This is still at a rather early stage, but should be fully supported within the next couple of months.

    It should also be noted that static typing reduces the number of bugs introduced in the first place.

    As for whether or not you should use vanilla JavaScript instead is a matter of preference. If you come from an AS3 background, Haxe is most likely a better choice for you.