Skip to content

Instantly share code, notes, and snippets.

@diegopacheco
Last active March 24, 2025 06:15
Show Gist options
  • Save diegopacheco/c33ef1d8e41ba376e240358ce78ebd3d to your computer and use it in GitHub Desktop.
Save diegopacheco/c33ef1d8e41ba376e240358ce78ebd3d to your computer and use it in GitHub Desktop.
Haxe Lang Tiny Essay

Haxe Lang Tiny Essay

created: 23.MAR.2025

I love to learn new programing languages, it help to open the mind to new possibilities and compare different approaches. For instance, I learned Ruby and Scala in 2010, Clojure and Haskell in 2011, Go in 2015, Kotlin 2016, Rust in 2018 and Idris, TypeScript in 2019, 2020 Pandemic strike did a bunch of pocs but not with new langs(crazy year), Zig in 2021, 2022(coding in lots of langs but nothing new) - in 2023 I'm learning Nim and V. Learn at least one lang per year. This post is not complain, it's just to share some toughts, notes and impressions.

Why Haxe

  • Multi-plataform
  • Good for Games
  • High-level strictly-typed
  • Can build cross-platform applications targeting JS, C++, C#, Java, JVM, Python, Lua, PHP, Flash

My Feelings (12-Jan-2025 haxe 4.3.6)

  • Cool
  • Fun
  • Syntax feels like JavaScript
  • You will see slighly different outputs depending on the target language

Show me the code

My POCs with Haxe: https://github.com/diegopacheco/haxe-playground

1 - OOP Support

Haxe has classes, constructors and several OOP features like Java.

class Point {
    var x:Int;
    var y:Int;
  
    public function new(x, y) {
      this.x = x;
      this.y = y;
    }
  
    public function toString() {
      return "Point(" + x + "," + y + ")";
    }
}

class Main {
    static public function main() {
        var p = new Point(10, 20);
        trace(p.toString());
    }
}

Other Tiny Essays

About me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment