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
9
votes
1 answer

NME Change the window title in C++ and Neko targets

I'm using NME to create a small game. I like to display the objective in the title bar in the Neko and C++ targets. Is that possible? Thanks.
Sri Harsha Chilakapati
  • 11,744
  • 6
  • 50
  • 91
8
votes
5 answers

How to extend default timeout period in flash application?

I have an application written in flash (actually it is written in Haxe and run under SHWX but it doesn't matter here). I have a pretty complex task that consumes a lot of CPU power and sometimes executes for more that 15 seconds. If that happens,…
vava
  • 24,851
  • 11
  • 64
  • 79
8
votes
1 answer

Get the type of a field in Haxe (reflection api)

I have a class: class MyClass { private var num : Int; } I would like to know that the field has the type Int regardless of the current value which can be null for example.
vbence
  • 20,084
  • 9
  • 69
  • 118
8
votes
1 answer

How do I Distribute my Haxe application with Hashlink?

I've got a Haxe Application that I want to make available to people with a Windows system. I use Hashlink to run the Application locally and it works very nicely. I am wondering if I'm supposed to distribute my Application with Hashlink. Can it…
nizzle
  • 1,036
  • 2
  • 10
  • 23
8
votes
1 answer

Create an instance of a class from a string name in Haxe

Let's say i acquire the name of a class that i made as a String. How can i Instantiate the class with the name contained in that string? I I know it will be derived from a certain parent class, but the actual class will vary.
RCIX
  • 38,647
  • 50
  • 150
  • 207
8
votes
2 answers

What is cppia scripting?

I was just looking at the Change Log for Haxe 3.2.0-rc.2 and found this at the end of New features list: cpp : inititial implementation of cppia scripting Can anyone can tell me what this means? I can tell that it has something to do with C++, but…
Futago-za Ryuu
  • 147
  • 2
  • 9
8
votes
4 answers

Passing list of arbitrary function arguments in Haxe

In ActionScript I can use ... in a function declaration so it accepts arbitrary arguments: function foo(... args):void { trace(args.length); } I can then call the function passing an array: foo.apply(this, argsArray); I'd like to call the function…
meps
  • 579
  • 2
  • 17
8
votes
3 answers

Debugging Haxe (ActionScript 3)

Are there any reliable debuggers for Haxe out there, in an ActionScript 3 context, and do they support breakpoints, conditional breakpoints, watches, locals and stacks?
josef.van.niekerk
  • 11,941
  • 20
  • 97
  • 157
7
votes
1 answer

Pausing code execution in chrome from within JS. Possible?

Can I pause execution from within JS code? I am working on a simple haxe-based debug util, and I want to be able to simulate breakpoints, by calling a util method which will trigger the execution pause.
user802232
  • 2,541
  • 7
  • 34
  • 40
7
votes
1 answer

How to use Haxe SSL Socket?

I'm trying to setup an https server but I can't find any example on how to use Haxe sys.ssl.Socket and the documentation doesn't quite speak to me. So far I got the following code which throw an 'Access violation'. var _aSocketDistant = new…
Jeremy Giner
  • 105
  • 4
7
votes
2 answers

How to clone Dynamic object in Haxe?

I have a Dynamic object from Json and need to clone that in Haxe. Is there any easy way to clone object, please let me know. Or if it's impossible, I want at least iterate that Dynamic object such as JavaScript object. var config = { loop :…
rener172846
  • 431
  • 1
  • 6
  • 19
7
votes
1 answer

What is the correct way to clear an array in Haxe?

What would be the most performant way to clear an array in Haxe? Currently I am just assigning an empty array to the variable. I found this on the Internet: public static function clear(arr:Array) { #if cpp arr.splice(0,…
montonero
  • 772
  • 6
  • 16
7
votes
3 answers

Why use Lists, when Arrays are faster?

I noticed that Arrays perform much, much faster than Haxe's Linked Lists (atleast on cpp). The results I got are as follows. Main.hx:40: With 1 items, Array is 14% faster than List. Main.hx:40: With 5 items, Array is 58% faster than…
seequ
  • 456
  • 2
  • 13
7
votes
1 answer

What is meant by being "physically equal" in Haxe?

I've been playing around with Neko Modules, but I think I'm getting some inconsistent behaviour. var funcs = 0; var objs = 0; for (i in 0...m.globalsCount()) { var obj:Dynamic = m.getGlobal(i); if (Reflect.compareMethods(obj, init)) …
tienery
  • 172
  • 7
7
votes
1 answer

Is there a way to create a library in haxe that can be called natively on iOS and Android?

I want to make some common service calls, data models, etc, to use as a library on my iOS and Android apps, I was thinking that maybe Haxe is capable of doing this but I can't find any example. Can someone shed some light on whether this is possible…
Gustavo Parrado
  • 126
  • 1
  • 8