From Python to Haxe

John Gabriele


Some notes on writing Haxe code in place of Python. This doc is woefully incomplete but gets added to from time to time.

Note, this doc doesn’t make use of MyPy for Python static type checking.

Getting Started

If you don’t yet have Haxe installed, I have some notes which may be of use, or go straight to the Haxe docs.

Create a couple of files, and Main.hx.

Python Haxe

Run them like so:

$ python
$ haxe -main Main --interp

Using Your own Project’s Modules

Python Haxe

Using Modules from Installed Libraries

Python Haxe

Haxe: for convenience, you can store compiler args in .hxml files.

More about Haxe compiler flags.

Basic Types and Values

Python Haxe

More about null in Haxe.


Python Haxe

More about Haxe strings

Lists and Arrays

Python Haxe


In Python, called dictionaries.

Python Haxe

More about Haxe maps.


Python Haxe

More about Haxe classes, and about Haxe Math.


Python Haxe

More about files in Haxe.