From Python to Haxe

John Gabriele

2018-08

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, main.py and Main.hx.

Python Haxe

Run them like so:

$ python main.py
$ 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.

Strings

Python Haxe

More about Haxe strings

Lists and Arrays

Python Haxe

Maps

In Python, called dictionaries.

Python Haxe

More about Haxe maps.

Classes

Python Haxe

More about Haxe classes, and about Haxe Math.

Files

Python Haxe

More about files in Haxe.