Influxis

Haxe

WHAT IS HAXE?

haXe (pronounced hex) is a versatile open-source high-level programming language. The code can be produced entirely within the haXe development environment by using a single and unmodified code-base when compiling from one target to the next. Compared to most other languages are bound to their own platform (Java to the JVM, C# to .Net, ActionScript to the Flash Player), haXe is a multi-platform language.

It is aimed at giving developers a tool to create applications using a single unified programming language. Whether you use haXe for its cross-platform features, or focus on a single platform.


haXe Compiler Features:

• Debug compilation mode (enabling call stack for JavaScript)
• Trace and file position support
• In-line Methods and Variables
• Runtime Type Information
• External File Resources

haXe Language Features:

• 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

Reasons For using HaXe

• ECMA style programming for client-side, server-side & desktop

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.

• Extremely fast compiling

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.

• The benefits of type checking

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 adds missing language features to target platforms

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.

• Compiler based auto-completion

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.


Why Target Multiple Platforms?


• Elegant Remoting between platforms

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.

• A single syntax & features

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.

• Conditional compilation - Write for one target and use on many

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.

JavaScript Features

• Have JavaScript2 (ECMA4) features available now

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.

• Full DOM autocompletion

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!

• HaXe can run alongside existing JavaScript code

You can run haXe JS alongside with any other JavaScript Library. You can even access other libraries, such as JQuery, via external classes.




logo