12.4.1 Getting started with Haxe/Neko

To get started with Haxe/Neko, 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 -neko hello.n -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.

-neko hello.n
-main Main

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