Now that we have haXe up and running, you will undoubtedly be asking yourself the question, What in the world is haXe ?
Well it's just a programming language. That's it ?

NO WAY.

Targeting Many Platforms

Haxe is more that just a programming language. It's a framework, allowing you to develop code for many platforms. It eleminates the hassles of having to learn multiple language when targeting different platforms. You can code your PC game and your website in the same language, AMAZING !
This is the whole idea behind haXe.

But what are Platforms and how are they connected with a language

Well, it's like this. Every language is created with a single target platform in mind ( except haXe of course, it can target multiple platforms). For example, Java is compiled into Java bytecode which is executed in the Java Platform ( Java Runtime Library). C/C++ is used to built native applications executed by the OS. So, the target platform of C/C++ is a specific OS. C# is built for the Microsoft .NET framework. Javascript is built for the web platform.

But, the problem with this is that each platform has its own language tied to it, so it is very difficult to write for different platforms as you need to program in different languages. Also, it becomes difficult to combine platforms together.

This is where haXe steps in to show us the way. To quote from the haXe website :
IF YOU COULD ONLY LEARN ONE PROGRAMMING LANGUAGE, HAXE WOULD BE IT.
IT'S UNIVERSAL. IT'S POWERFUL. IT'S EASY-TO-USE.

haXe Targets


  • Javascript : You can compile a haXe program to a single .js file. You can access the typed browser DOM APIs with autocompletion support, and all the dependencies will be resolved at compilation time.
  • Flash : You can compile a haXe program to a .swf file. haXe is compatible with Flash Players 6 to 11. haXe offers very good performance and language features to develop Flash content.
  • NekoVM : You can compile a haXe program to NekoVM bytecode. This can be used for server-side programming such as dynamic webpages (using mod_neko for Apache) and also for command-line or desktop applications, since NekoVM can be embedded and extended with some other DLL.
  • PHP : You can compile a haXe program to .php files. This will enable you to use a high level strictly-typed language such as haXe while keeping full compatibility with your existing server platform and libraries.
  • C++ : You can generate C++ code from your haXe source code, with the required Makefiles. This is very useful for creating native applications. The NME library uses this to run haXe code on iOS, Android, etc.
  • C# and Java targets are coming soon!

You will be learning all of these. So get ready !