Why use Haxe?

Haxe is a powerful modern language with many compelling features. It is aimed at giving developers a tool to create websites & applications using a single unified programming language. Whether you use Haxe for its cross-platform features, or focus on a single platform, there are many reasons to adopt it:

  • 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
    The 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 - e.g.
    - inlining & generics to Flash development
    - packages & typing to JavaScript & PHP
    - dynamic objects & Runtime Type Information (enabling Reflection) to C++
    - macros
    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.
  • Open Source
    In addition to being free, Haxe is open source and provides installers for OSX, Windows, and Unix based operating systems. There are no base library requirements for the compiler, and a good deal of functionality is already provided with the Haxe libraries.

Why Target Multiple Platforms?


Haxe allows you to work across many platforms, this can be quite useful.

  • 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
  • Deploy to the desktop with ScreenweaverHx
    ScreenweaverHx allows you to embed Flash in a Neko application. This allows a Flash application to act as a desktop application & access system functionality. All of your system access is written in Haxe and can communicate with your Haxe SWF with ease.
  • Access to many file formats
    The format library (hosted on googlecode) can read/write many formats such as 'abc' (ActionScript Byte Code), SWF headers & more. These libraries are crossplatform making it accessible for many targets.

Platform Specific Features


Each platform that Haxe targets has many great features of its own

Flash

  • Compile to flash 6,7,8,9,10 with the same language
    You can compile back to Flash 6 if needed, without having to write AS 1 code. This makes backward compatibility easy.
  • Faster & more optimized than the Flex compiler and easier to use and setup than the Flex SDK
    Due to inlining, generics and general compiler optimizations, Haxe can generate SWFs with much better performance than the current Flex compiler.
  • Haxe SWFs are fully compatible with Flex & Flash
    You can load a Haxe SWF into one made by Flash or Flex or vice-versa, without any troubles.
  • Support an AS3 userbase via SWC Export
    Using the SWC Export feature you can generate an SWC. This can then be loaded by Flex. This will allow library makers to use Haxe for its great features, while still supporting their AS3 user-base.
  • Access Alchemy OpCodes
    There are OpCodes for memory allocation hidden in the SWF player which are used by Adobe Alchemy. Haxe has the ability to access them giving you low level memory access which can allow HUGE speed increases.
  • Access the PixelBender Assembly
    Using low level functions you can control PixelBender directly.
  • Simple lightweight video streaming and recording using HaxeVideo
    HaxeVideo can serve streaming video over the RTMP protocol.

JavaScript

  • 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 extern classes.

Neko

  • A lightweight, fast virtual machine
    Neko is a lightweight virtual machine which offers great speed and features for developing command-line and desktop applications. Haxe has full access to its features, making writing crossplatform (mac, pc, linux) applications fast and easy.
  • Powerful & scalable Apache plugins mod_neko & mod_tora
    There are also Neko plugins for Apache allowing it to run as your webserver. This allows your code to run up to 40x faster than PHP.
  • Rapidly develop command-line applications
    In a few lines of code you can build a small app which has full system access - great for performing many useful tasks.

PHP

  • Widespread Deployment to a standard Apache Server
    Everyone knows that PHP is great for its cheap deployment costs and widespread hosting. For users frustrated by its lack of API consistency and OOP features, Haxe can provide a great programming experience, without changing your server setup.
  • Develop a cleaner more structured OOP website
  • Easily access to PHP's full list of functionality
    By writing wrapper classes, the full range of PHP libraries can be accessed - and all fully type-checked.

C++

  • Harness the power of C++
    For tasks which require a little more grunt than a virtual machine like neko can provide, C++ can give you that power.

Other Features

  • 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 for example.
version #15275, modified 2012-08-06 10:56:47 by hbatra