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

How to get class name as string?

How would I get the class name in string? I tried this: Type.getClassName(this)); Where this is the current class I am in, but I got error: com.SubWidget should be Class Any help?
Samir Sabri
  • 937
  • 3
  • 11
  • 26
7
votes
1 answer

How to create iOS- & OSX- library from Haxe and use it in native application?

I have an crossplatform implementation of own protocol, data-structures and logic written on Haxe. How I can build and use it in my enterprise-application (with native UI) for iOS and OSX?
Alex Koz.
  • 490
  • 8
  • 26
7
votes
2 answers

Pass Class as parameter

I'm trying to pass a Class reference and instantiate it in a function. This doesn't work: function foo(myClassRef:Class):Void { var myVar = new myClassRef(); } foo(MyClass); It gives Unexpected (. Is this possible in Haxe 3?
Jorjon
  • 5,316
  • 1
  • 41
  • 58
7
votes
1 answer

How to exit Haxe/OpenFL program?

I am making a game using Haxe, OpenFL (Formerly NME) and HaxeFlixel. However, problem is, I can't seem to find a good way to make a Flixel button that will shutdown the game when pressed. I was planning to make a "quit" button on the main menu. Is…
Mandemon
  • 372
  • 3
  • 22
7
votes
8 answers

Web "frameworks" for Haxe to deploy in a PHP environment?

Lately I've been taking a look at Haxe, to build an application to be deployed to Apache running PHP. Well, while it looks like it might suit my needs (deploying to PHP, but not using an awful language), I haven't found anything to make the actual…
apg
  • 2,611
  • 1
  • 18
  • 19
7
votes
3 answers

What is the quickest way to iterate through a Iterator in reverse

Let's say I'd like to iterate through a generic iterator in reverse, without knowing about the internals of the iterator and essentially not cheating via untyped magic and assuming this could be any type of iterable, which serves a iterator; can we…
simonrichardson
  • 1,049
  • 8
  • 14
7
votes
5 answers

How to display autocomplete choices in emacs?

I'm working on autocompletion implementation in emacs for haxe programming language. I already figured out how to obtain list of autocompletions which I wants to present. The list is in format: '((name1 type1 desc1) (name2 type2 desc2) ... I want…
Marko
  • 30,263
  • 18
  • 74
  • 108
7
votes
3 answers

Socket.io as server, 'standard' javascript as client?

So i've built a simple websocket client implementation using Haxe NME (HTML5 target ofc). It connects to ws://echo.websocket.org (sorry no link, SO sees this as an invalid domain) which works perfectly! (i'm using xirsys_stdjs haxelib to use the…
Michahell
  • 4,905
  • 5
  • 29
  • 45
6
votes
1 answer

Is it possible to write an AS3 library with Haxe that uses type parameters?

First a little background: I'm looking for a way to create a "collection" library that abstracts the Flash Player version based implementation (Vector on FP10, Array on FP9) away from the calling code. I've already written a small AS3 lib doing that…
Baelnorn
  • 940
  • 8
  • 17
6
votes
0 answers

How to implement Brotli for Java

Is there any Brotli Java implementation with example? I found Brotli Java port and also Brotli lib on maven. byte[] form= Files.readAllBytes(new File("filepath").toPath()); Brotli brotlic = new Brotli("filepath"); var compressedbytearray…
Hither Joe
  • 117
  • 2
  • 9
6
votes
3 answers

Extracting Actionscript from .fla file, without Adobe Flash

Unlike this guy, I'm using MTASC's Haxe to compile SWF from AS. Considering I don't have Adobe CS, what are our options to extract the action scripts from any FLA file? I mean different versions, like CS4, CS5, etc. Converting older versions to CS5…
cregox
  • 17,674
  • 15
  • 85
  • 116
6
votes
5 answers

Which group messaging technology to use?

I feel a little bit kind of confused — for about 24 hours I have been thinking which group broadcasting technology to use in my project. Basically, what I need is: create groups (by some backend process) broadcast messages by any client (1:N,…
Yurii Rashkovskii
  • 1,122
  • 1
  • 10
  • 20
6
votes
1 answer

Implementing Set

I'm trying to wrap my head around abstract by implementing a Set data-type, like so: abstract Set(Map) { public inline function new() { this = new Map(); } public inline function has(item:T):Bool { return…
Michael
  • 145
  • 6
6
votes
1 answer

Error while assigning array to a row of multidimensional array

I'm writing on Haxe and targeting Neko. Today I've encountered this problem: var a:Array> = new Array>(); a[1] = [1, 2, 3]; The second line throws "Invalid array access" exception. Also it's impossible to iterate on row like…
Gulvan
  • 305
  • 2
  • 12
6
votes
2 answers

Using Haxe macros to instantiate a class with parameters

I'm trying to make some dark magic with macros in Haxe, I have a class named Entity and I want to add a pool with the static and private modifiers: Pool.hx: package exp; class Pool { public function new(clazz:Class) { …