How to use the interpreter mode?

Hello. I am totally new to Haxe. I have prior knowledge with C/C++/Python. I have Haxe latest installed on my Kubuntu Bionic OS.

At Eval - The new Haxe macro interpreter - Haxe - The Cross-platform Toolkit I seem to read that Haxe has an interpreter mode. However it is not clear whether this means an REPL like Python has or just that I can do something like python myscript.py

How exactly to invoke this interpreter mode? Please clarify.

Thanks for your patience with my newbieness!

It’s like python myscript.py:

$ haxe --run Main.hx
1 Like

Or even:

$ haxe --run Main
1 Like

Oh I saw that --run option but was keeping trying --interp instead. When should one use this or that?

--interp makes more sense in HXML files IMO, since it’s more consistent with other “target flags” such as --js, requiring a separate --main. Because of that you can more easily swap between targets with it, or use it in conjunction with --each / --next.

--run is a convenient shorthand for CLI usage that also allows passing arguments.

1 Like