// the find
Tencent/xLua
xLua is a lua programming solution for C# ( Unity, .Net, Mono) , it supports android, ios, windows, linux, osx, etc.
xLua embeds a Lua VM into Unity/C# and lets you call between the two languages bidirectionally. Its headline feature is hotfix: you can swap a C# method implementation with Lua at runtime without redeploying. Used heavily in Chinese mobile game studios for live patching shipped builds.
The zero-GC-alloc path for structs and enums crossing the C#/Lua boundary is genuinely well-engineered — most Lua bridges treat everything as boxed objects and pay GC tax on every call. The hotfix mechanism works without modifying the original C# source: you mark classes with an attribute, run a post-build IL weaver, and the hooks are there at runtime. The editor-mode reflection path (no codegen needed during development) speeds up iteration without requiring a separate workflow. Platform coverage is real — prebuilt binaries for Android arm64/armeabi-v7a, iOS, WebGL, WSA, and desktop are all included in the repo.
The project is effectively on life support from Tencent — the last substantive development was years ago, and the 2025 commit is likely a minor fix or CI update, not active feature work. The hotfix IL weaving is a sharp edge: it modifies compiled assemblies, plays poorly with Unity's incremental compilation, and has known issues with async/await (example 14 exists precisely because this is hard). Documentation is mostly Chinese; the English docs are translations that lag behind and miss nuance. No support for Lua 5.4 — it ships Lua 5.3, so if you need the new integer subtype or to-be-closed variables you're out of luck.