Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

[ Message Board ]

Welcome to HaxeD

Aims to compile Haxe code to the D Programming Language (version 2.x).

License: zlib/libpng

OS: Cross-platform. Tested on Windows and Linux.

Status

HaxeD is still in its very early stages.

  • HaxeD, and the Haxe preprocessor HaxePreD, are implemented and usable as either standalone programs or as D libraries.
  • A GOLD/Goldie grammar for the Haxe language is written and available here. The Haxe grammar does currently have a few limitations. But keep in mind, HaxeD uses the alternative grammar and a proper preprocessor (HaxePreD), so limitations #4.x and #5.x aren't applicable to HaxeD. Also, the plan is to add either LALR(k) or GLR support to Goldie, so the rest of these limitations will eventually be eliminated entirely.

HaxeD itself currently does the following (as either a standalone program or a rudimentary D library):

  • Preprocess and parse Haxe sources.
  • Automatically does the same for all imported Haxe modules.
  • Outputs a D module for each Haxe module.
  • Outputs a D class for each Haxe class.
  • Converts class member variables (except for initializers and properties).
  • Partially converts class member functions (no generics or param initializers yet, and not all statements/expressions are converted).
  • Statements and expressions that are not yet supported are not silently ignored: They result in a warning message and an emitted static assert(false, ...);.
  • Correct Haxe order-of-operators is preserved.

HaxeD currently requires at least DMD 2.058.

My top task right now is to make order-of-operators work correctly(done!). Then it's back to adding support for more statements, types, and expressions.

Message Board and Issue Tracking

...are right here on DSource.

Source Repository

The source repository is on BitBucket:

https://bitbucket.org/Abscissa/haxed

Download

Via Mercurial (be aware, it will likely switch to Git soon):

hg clone https://bitbucket.org/Abscissa/haxed

You'll also need the latest masters of Goldie and SemiTwistDTools (HaxeD is in such an early, quickly-changing state that the latest official Goldie release may not always be new enough):

On Windows:

git clone https://bitbucket.org/Abscissa/goldie Goldie
git clone https://bitbucket.org/Abscissa/semitwistdtools SemiTwistDTools
set PATH=%CD%\Goldie\bin;%CD%\SemiTwistDTools\bin;%PATH%
cd SemiTwistDTools
buildAll
cd ../goldie
semitwist-stbuild all
cd ..

Linux is the same as Windows above, except use ./buildAll and set the PATH like this:

PATH=`pwd`/Goldie/bin:`pwd`/SemiTwistDTools/bin:$PATH

Once you've installed Goldie and SemiTwist D Tools as above, you can download and build HaxeD and HaxePreD:

hg clone https://bitbucket.org/Abscissa/haxed
cd haxed
semitwist-stbuild all

OPTLINK Sucks

On Windows, HaxeD seems to occasionally cause OPTLINK to crash. So if you're getting that when trying to compile HaxeD or HaxePreD, try using a different version of DMD, or building in release instead of debug, or even just retry the same build command. The relevant bug report appears to be #6144.