12.12.1 Getting started with Haxe/HashLink

To get started with Haxe/HashLink, create a new folder and save this class as Main.hx.

class Main {
  static public function main():Void {
    trace("Hello World");

To compile, either run the following from the command line:

haxe -hl hello.hl -main Main

Another possibility is to create and run (double-click) a file called compile.hxml. In this example the hxml file should be in the same directory as the example class.

-hl hello.hl
-main Main

The compiler outputs a file called hello.hl in the current folder, which can be executed with hl hello.hl from the command line.

More information