12.13.1 Getting started with Haxe/HashLink

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

    Multi-line comments for documentation.
class Main {
    static public function main():Void {
        // Single line comment
        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