Haxe + Defold = ❤️

Hi. I’m checking out the Haxe and the Hxdefold also. It looks like a perfect solution for type-safe coding. And It looks also perfect for creating reusable code library creation with Defold and other engines. I think, creating a game with the Haxe language on Defold really makes sense. I’m planing to follow this path. But I have some issues that I want to mention.

1- The GitHub installation instructions is not working. It says the luv is missing. People also mention missing files. I think the issue is the build.hxml instructions.

I have done some research and have learned some instructions to target the specific Lua version. In my system I only have Lua 5.1.4 installed. I don’t have any other library. I did not follow the Haxe documentation about the Lua. Because it wants to install additional libraries. But I want vanilla lua for defold right? Especially the 5.1.4 version and LuaJit-2.1.beta. So I have entered the following build parameters on my Hello World haxe project.

--lua bin/haxe_build.lua
--main Main

# Enable JIT
-D luajit=2.1

# Force not to use additional libraries for Haxe itself
-D lua-vanilla

# Select Lua version
-D lua-ver=5.1

# Enable analyzer optimization
-D analyzer-optimize

# Set the source directory
-cp src/

With these parameters, I can run Hello World app on the terminal with just

lua .\haxe_build.lua

As you can see I can define the exact Lua version for the Haxe compiler. Haxe compiles my codes as vanilla. And does not throw any missing library error on my Hello World project. In default it was throwing missing library error. The hxdefold requires additional libraries like luv or bit32, right? This means that it is not vanilla lua after the build. I have seen some parameters on the extraParams.hxml. But I’m not sure if is it working or not. I think my parameters should be in hxdefold. I wish to add and get build. But I have just started using Haxe. Your project is too complex for me right now. Maybe after a while, I may do it. Right now it is impossible for me with the lack of information.

2- The Second issue is about the Haxe for me. I have noticed that Haxe generates lots of code. Can we be sure about the performance of our game? I mean, are there gonna be any performance differences in coding between Lua and Haxe for the game runtime?

2 Likes