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 haxeVerification
Check the installed Haxe compiler version:
haxe --versionHello World Example
Create a Haxe source file named Main.hx:
cat << 'EOF' > Main.hx
class Main {
static function main() {
trace("Hello, Haxe!");
}
}
EOFRunning directly with Haxe Interpreter
You can evaluate and run the script instantly using the Haxe interpreter:
haxe --run MainCompiling to JavaScript
To compile Main.hx to JavaScript and execute it with Node.js:
haxe --main Main --js main.js
node main.js