Questions tagged [haxe]

Haxe can build cross-platform applications targeting JavaScript, C++, C#, Java, JVM, Python, Lua, PHP, Flash, and allows access to each platform's native capabilities. Haxe has its own VMs (HashLink and NekoVM) but can also run in interpreted mode. Code written in Haxe can be compiled to any target Haxe supports.

Haxe is an open source, multiplatform programming language that allows developers to JavaScript, C++, C#, Java, JVM, Python, Lua, PHP, Flash, NekoVM and HashLink using the same syntax.

Haxe includes a set of common functionality that is supported across all platforms, such as numeric data types, text, arrays, binary and some common file formats. Haxe also includes platform-specific APIs. It can be integrated with existing libraries using extern definitions (e.g: JavaScript) or leveraging the compiler to connect directly to native libraries (e.g: .jar for Java and .dll for C#).

Haxe can also compile to bytecode (Neko, HashLink or JVM), which runs in the runtime created by the same developer.

Haxe is a garbage-collected language. Some target platforms do not have a native garbage collector - in those cases Haxe provides its own runtime, like in the case of C++, to take care of GC and other things.

Haxe ships with its own package manager called .

Haxe was developed by Nicolas Cannasse and other contributors and is backed by the Haxe Foundation. It was named Haxe because it was short, simple, and "has an X inside", which the author humorously asserts is necessary to make any new technology a success. Haxe is pronounced "hex" /heks/, although many community members pronounce it "hacks".

Haxe is known for its multitude of game development and multimedia libraries. With frameworks like , or built on top of Haxe, developers can target platforms like:

All from a single code base.

Popular game engines include , , and . The powerful physics engine is written in Haxe as well.

With UI frameworks like and , user interfaces can be created for a wide range of target platforms. With , there is also a feature-rich MVC web framework available. To create reactive web applications using a virtual DOM, coconut.ui can be used, which shares significant similarities with .

1627 questions
6
votes
1 answer

How to check the type of a parameter in Haxe

I'm converting a JavaScript library to Haxe. It seems Haxe is very similar to JS, but in working I got a problem for function overwriting. For example, in the following function param can be an an integer or an array. JavaScript: function…
rener172846
  • 431
  • 1
  • 6
  • 19
6
votes
0 answers

have completion for @:op(a.b)

The @:op(a.b) feature is described here: https://haxe.io/releases/3.3.0/ I have May abstract which is used for null safety. Here is the simplified version of it: package; import haxe.macro.Expr; abstract May(Null) from(Null){ //…
romamik
  • 595
  • 2
  • 9
6
votes
1 answer

How do I get openfl running in the ios simulator

I have the latest version of Haxe 3 installed along with the latest version of Xcode and OpenFL. I'm inside my OpenFl project in the terminal and I run the following command: openfl test ios -simulator I get the following…
mattwallace
  • 4,132
  • 6
  • 43
  • 77
6
votes
3 answers

Correct way to instantiate a FlxPoint

(I'm using the dev branch of HaxeFlixel) To create a new FlxPoint variable I can do one of three things... var pt:FlxPoint = new FlxPoint(); var pt:FlxPoint = FlxPoint.weak(); var pt:FlxPoint = FlxPoint.get(); From reading the method comments, I've…
Piku
  • 3,526
  • 6
  • 35
  • 38
6
votes
1 answer

Does Haxe pass parameters by reference or does it make a copy?

Take this code: function createGUIHud():Void { this.screen.gameHud = new NormalGameHud(10, 0, this.screen.getTextureAtlas()); this.screen.gameHud.x = FlxG.width - (this.screen.gameHud.width + GameSize.getPositionByPlatform(10)); …
SMKS
  • 179
  • 1
  • 4
  • 13
6
votes
0 answers

Install GitHub hosted packages in Spacemacs

I have been using vim for a while now and decided to try Emacs. I picked Spacemacs since it's easier for a vim user to transition to. I was able to create a package layer to install packages hosted in MELPA but when I tried installing packages…
6
votes
1 answer

What is the `using` keyword in Haxe?

I often see people use the keyword using in their Haxe code. It seem to go after the import statements. For example, I found this is a code snippet: import haxe.macro.Context; import haxe.macro.Expr; import haxe.macro.Type; using…
Mark Knol
  • 9,663
  • 3
  • 29
  • 44
6
votes
1 answer

Array doesn't change when method inlined

This is part of my stack class. It works fine in flash, but in cpp/windows, the push method doesn't always work. I don't understand C++ well enough to understand why it could be inconsistent. var arr:Array; public var length(default,…
MSGhero
  • 411
  • 2
  • 7
6
votes
1 answer

OpenFL and Lime does not run, because of a segmentation fault

Recently, I have found (on Mac OS X Mavericks) OpenFL and LIME (with the command line tools) not working due to a 'segmentation fault'. Before I get into the details, here's some background. I originally got Haxe + Neko from the installer provided…
hpm
  • 1,202
  • 13
  • 34
6
votes
1 answer

Haxe Property - getters and setters versus @:isVar

My question is regarding properties in haxe. If I understand it correctly, if I make property like this var propertyInt(get, set):Int; according to haxe documentation it's not really a variable. But I can make it a variable by modifying it this way…
Bob T.
  • 261
  • 1
  • 13
6
votes
2 answers

Get all classes from a package

I'd like a (platform independent) way to list all classes from a package. A possible way would be get a list of all classes known by Haxe, then filtering through it.
vbence
  • 20,084
  • 9
  • 69
  • 118
6
votes
2 answers

How to send HTTP PUT request from Haxe/Neko?

I have a server running under NekoVM which provide a RESTLike service. I am trying to send a PUT/DELETE request to this server using the following Haxe code : static public function main() { var req : Http = new…
Maxime Mangel
  • 1,906
  • 16
  • 18
6
votes
2 answers

Could not find template file flash/hxml when installing haxe lime

I recently tried to develop in haxe/lime and I have two things that freaked me out. 1. I tried to install Lime by this command: > haxelib install lime haxelib run lime setup and it automatically installed Lime in "c:/" and I need to move the files…
Michael
  • 896
  • 10
  • 28
6
votes
1 answer

Reading metadata in a Haxe macro

I would like to know how to read metadata from a class (and its methods) in a macro. I tried to modify this example. I added : to see if metadata without them is only available in generated code, but nothing.. I have an empty result in all three…
Peekmo
  • 2,843
  • 2
  • 19
  • 25
6
votes
3 answers

Wait() in Haxe?

I am getting started with Haxe and OpenFl, and have some experience with Javascript and Lua. It was going pretty well, till I got to a point where I needed a function similar to wait() in Lua, etc, which stops the script until the number of seconds…
IBPX
  • 681
  • 1
  • 6
  • 11