TIDE
Languages

Haxe

Installing Haxe on Ubuntu in TIDE

Haxe

Haxe is an open-source, high-level, strictly-typed multi-target programming language with a cross-compiler that can generate code for C++, C#, Java, JavaScript, Python, PHP, Lua, and more.

Installation

Install Haxe on TIDE's Ubuntu terminal:

apt update
apt install -y haxe

Verification

Check the installed Haxe compiler version:

haxe --version

Hello World Example

Create a Haxe source file named Main.hx:

cat << 'EOF' > Main.hx
class Main {
    static function main() {
        trace("Hello, Haxe!");
    }
}
EOF

Running directly with Haxe Interpreter

You can evaluate and run the script instantly using the Haxe interpreter:

haxe --run Main

Compiling to JavaScript

To compile Main.hx to JavaScript and execute it with Node.js:

haxe --main Main --js main.js
node main.js

Official Resources

On this page