I’m using Haxe with Lua target, both for embedded Lua and for standalone Lua scripts. For the embedded use case, I have full control over initialization, which is done outside of the scripts, so it works well. However, for the standalone case, I’d like to avoid having to prepare a runner scripts that would dofile on the Haxe output. What I need, basically, is inserting the require("luarocks.loader")at the top of the generated file (because things like lua-utf8 are required way before the static __init__ section, not to mention main method execution).
The only way to get this that I found was to modify genlua.ml, adding
I need utf8, very much so! I’m using LuaJIT with Awesome window manager. My native language has all those pesky ąść characters, so for example, when I trim the length of a window title without utf8 support, it often looks bad (ie. sometimes characters encoded as more than 1 byte are sliced in half, resulting in junk being displayed).
I’m generally happy with my setup, Haxe and LuaJIT combo seems to work quite well, but I’m still trying to get a feel of how to best code in that environment. Unfortunately, it doesn’t seem popular as a Haxe target, and there are many rough edges (like in this thread: Macro to generate nested Lua tables from typedef), so for the moment, I’m trying first to make the development convenient, and plan to worry about performance later. The biggest problem I currently have is the “declarative layout” system that exploits the dual nature of Lua tables to describe widget hierarchies: Topic 03-declarative-layout.md - awesome API documentation No matter what I do, it doesn’t look nearly as nice in Haxe (yet)