Do you know haxe
Tags: haxe, crossplatformgaming
Published: 2018-07-17 14:33:35

---
title: Do you know haxe
published: true
tags: haxe, cross-platform gaming
canonical_url: https://khaledgarbaya.net/articles/do-you-know-haxe
---

Since Haxe first came in 2006 there was a lot of changes involving Language features, platform support and so on . In this article we will try to cover all aspect and changes of haxe to give you fresh look about the technology and I follow up article I will be writing about getting started with haxe.

## <svg aria-hidden="true" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>Do you know Haxe ?

| Versions | Release Date | Major Features |
| --- | --- | --- |
| Haxe 1(r1) | August 2006 | adding the Flash AVM2 target along with the haxelib-tool |
| Haxe 1(r2) | March 2007 | Adding Actionscript 3 target and minor bug fixes |
| Haxe 2.0 | July 2008 | Adding PHP target courtesy of Franco Ponticelli |
| Haxe 2.04 | July 2009 | Adding C++ target thanks to Hugh Sanderson |
| Haxe 2.07 | January 2011 | Adding Support for macros |
| Haxe 2.08 | 2011 | improvements for the javascript target |
| Haxe 2.09 | 2011 | improvements for the javascript target |
| Haxe 2.10 | July 2012 | Adding Java and C# Target and preparation for Haxe 3 |
| Haxe 3 | May 2013 | Haxe 3 released Under the newly established Haxe Foundation |

## <svg aria-hidden="true" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>Compiler

The compiler is written in OCaml. It can be run in server-mode to provide code completion for IDEs and maintain a cache, to speed up compilation even more.I have been working with haxe since a while now, in the begging when I compile a haxe project I sometime have this question in head "Is it even doing something the compiler?". The Haxe compiler is so crazy fast That you can't even notice it is compiling, you tell it to generate/run for a specific platform and "baam!" you are ready.

The Haxe compiler is separated into one frontend and multiple backends. The frontend is responsible for parsing and type-checking the input language, applying macros, general optimizations, various transformations, and for producing the intermediate representation of the code, the typed abstract syntax tree (AST). Each of the backends is responsible for translating that AST into either sourcecode or bytecode for the respective target.

But what about Performance ?

It depends on the target Performance in case of Actionscript for instance with Haxe you can get better performance than a version compiled with Adobe flex SDK.Also for IOS we've been running some performance test since Haxe is targetting this platform through C++ we got stunning results with 130% more performance using haxe

## <svg aria-hidden="true" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>Platforms Support

| Code Generator | Platform | Usage |
| --- | --- | --- |
| Actionscript 3 | Adobe Flash Player 9+/Adobe AIR | Web/Mobile/Desktop |
| Javascript | HTML5 | Browser/Desktop/Mobile |
| C++(haxcpp) | Apple IOS and Android | Mobile |
| PHP | PHP | Server |
| Phython | Python | Server/browser |
| Java | Java | Server/Desktop |
| C# | .NET Framework | Server/Desktop/Mobile |
| Neko | NekoVM | Server/Desktop |

## <svg aria-hidden="true" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>Well known libraries/Utils/engines on top of haxe

[OpenFL](http://www.openfl.org/) is an opensource implimentation of the Flash API On top of Haxe and make it easy for expecially former actionscript developer to use more powerfull and more performant language to target pretty much all mainstream platform in mobile, desktop and web.

[lime](https://github.com/openfl/lime) is a Lime is a flexible, lightweight layer for Haxe cross-platform developers.Lime supports native, Flash and HTML5 targets with unified support for Windowing, Input, Events,Audio,Render contexts,Network access and Assets which is actually Used by OpenFL

[tink\_macro](https://github.com/haxetink/tink_macro) is a super powerfull macro toolkit to add some sugar to the haxe language I really encourage you to check it out if you want to know more about the macros feature in haxe.

[Haxepunk](http://haxepunk.com/) is an opensource framework built on top of openfl ported from Flashpunk which let you build your game and target any platform.

[HaxeFlixel](http://haxeflixel.com/) is an open source 2D game library written in the Haxe Language and powered by OpenFL.

And the list goes on please let me know If I missed an important library/engine/utils on top of Haxe and I will update the article accordingly

## <svg aria-hidden="true" height="16" version="1.1" viewbox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg>What's next ?

I am working on more article about haxe which involving getting a teaste of it , getting more technical and deep dive in some topics. Mean while check out the haxe website [here](http://haxe.org/).Make sure to install it and play around with it.