• Debug compilation mode (enabling call stack for JavaScript)
• Trace and file position support
• In-line Methods and Variables
• Runtime Type Information
• External File Resources
• Strongly Typed Language
• Module System (Packages & Private Definitions)
• Type parameters (generics) with optional constraints
• Type Parameters (polymorphism) & Type Inference
• First-class methods and functions (closures)
• Classes, Interfaces, Type Declaration & Enums
• Anonymous Types (structures)
• Polymorphic Methods
• Regular Expressions
• Function Types
• Dynamics
The haXe syntax should be very familiar to those familiar with ActionScript and JavaScript. As it offers multiple targets (virtual machines and outputs) it can be used for a huge variety of applications.
he compiler is lightning fast. When compared to the Flash or Flex compilers, you will find a noticeable speed increase. Since compile time is so short haXe is an easy transition from non-compiled languages such as PHP and JavaScript.
HaXe offers very tight type checking. Having compile-time checks in place allows you to catch errors in your code BEFORE testing it in the browser. This allows for a faster workflow for dynamically typed targets such as PHP and JavaScript.
HaXe has been created out of a desire for better features and tools for web-oriented development. It adds missing features to many of the targets - eg. inlining & generics to Flash development, packages & typing to JavaScript & PHP, dynamic objects & Runtime Type Information (enabling Reflection) to C++, and much more. Adding features to targets where they are lacking enables a haXe developer to have the same rich set of features available for use on ALL platforms that they want to target.
HaXe provides a compiler based auto-completion system which allows IDEs to integrate completion on many otherwise hard to predict objects, such as those using type inference. This makes haXe auto-completion fast and accurate. Check out FlashDevelop or FDT.
You can use remoting classes to pass objects between different platforms. Using the same codebase for different platforms means that the same classes can be compiled for many platforms. This allows for successful de-serialization making the remoting elegant and fast.
Programming practices can often be achieved on different platforms, just with different syntax and quirks. By having a consistent syntax and feature set, there's no need to constantly switch into different programming 'modes'. This allows a developer greater focus on the logic and final output, which can greatly enhance productivity.
Code may be tailored for a single target platform, or designed for many platforms. For instance tween classes can be used in ActionScript, JavaScript and C++. Code logic can be transferred to the most suitable target in the platform with few changes, so if front-end code is running too slow, you can quickly move and test the same code running on the back-end.
JavaScript2 promised a lot of great features for the future. HaXe provides a very similar experience, except it is available now and is fully compatible with current browsers.
As expected, when using haXe to target JavaScript, you get nice autocompletion of the DOM. You'll be amazed at the properties that are tucked away in there, which you may never have realized before!
You can run haXe JS alongside with any other JavaScript Library. You can even access other libraries, such as JQuery, via external classes.