{"id":28407154,"url":"https://github.com/focus-creative-games/zlua","last_synced_at":"2025-06-29T13:32:26.296Z","repository":{"id":295411096,"uuid":"990027363","full_name":"focus-creative-games/zlua","owner":"focus-creative-games","description":"ZLuA​​ is a high-performance, rock-solid, and elegantly designed modern Lua solution for Unity, ​​aggressively optimized​​ for IL2CPP and .NET.  zlua是一个高效、稳定、优雅的针为il2cpp和.net 极致优化 的现代Unity lua脚本方案。","archived":false,"fork":false,"pushed_at":"2025-06-03T02:04:47.000Z","size":7,"stargazers_count":85,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-06-08T22:33:26.823Z","etag":null,"topics":["hybridclr","luban","obfuz","puerts","slua","tolua","xlua"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/focus-creative-games.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-25T10:57:24.000Z","updated_at":"2025-06-07T02:15:25.000Z","dependencies_parsed_at":"2025-05-25T12:28:30.811Z","dependency_job_id":"94a41106-6425-4b18-85b1-91ee21ad8f53","html_url":"https://github.com/focus-creative-games/zlua","commit_stats":null,"previous_names":["focus-creative-games/zlua"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/focus-creative-games/zlua","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focus-creative-games%2Fzlua","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focus-creative-games%2Fzlua/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focus-creative-games%2Fzlua/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focus-creative-games%2Fzlua/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/focus-creative-games","download_url":"https://codeload.github.com/focus-creative-games/zlua/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/focus-creative-games%2Fzlua/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262600555,"owners_count":23335090,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hybridclr","luban","obfuz","puerts","slua","tolua","xlua"],"created_at":"2025-06-02T00:12:22.842Z","updated_at":"2025-06-29T13:32:26.284Z","avatar_url":"https://github.com/focus-creative-games.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# zlua\n\nzlua是一个**极致高效**、**富有创新**、稳定、敏捷的充分满足商业游戏项目需求的现代Unity lua脚本方案。\n\n## 为什么选择 zlua\n\nUnity平台已经有革命性的原生C#热更新方案[HybridCLR](https://github.com/focus-creative-games/hybridclr)，也有很成熟的xlua、tolua\n之类的lua方案，为何我们还需要一个新的lua解决方案？因为现存的所有lua方案都存在以下问题：\n\n- 与il2cpp运行时交互非常低效的痛点问题。\n- 与il2cpp运行时交互产生大量GC的问题。\n- 生成巨量wrapper文件。不仅低效还显著增加了代码大小。\n- 未优化字段、简单property访问这种最最常用的功能。精心优化可以提升10倍以上性能。\n- 对CLR的特性支持不全。例如对泛型类型、泛型函数以及对ref、out、in之类的函数参数支持不佳。\n- 不支持[luau](https://luau.org/)这种新兴的渐进强类型的lua方言\n- 要么已经数年不维护，要么维护频率极低，基本丧失积极维护的动力，需要一个更敏捷的紧跟Unity和团结引擎版本变化的方案。\n\n## 特性\n\n### 运行时\n\n- 数倍甚至十倍以上优化了双向调用的性能。首次清晰引入 `[LuaInvoke]`、`[LuaCallback]`、 `[LuaMarshalAs]`的概念。\n- 深度优化双向调用过程产生的GC，通过针对il2cpp的优化可以无感优化掉绝大多数struct和string之类的GC问题。\n- 更高效的wrapper生成，所有相同签名函数只需生成一个wrapper函数，极大缩减wrapper数量，同时提供更简洁和灵活的Wrapper配置。\n- 通过整合bdwgc与lua gc，彻底解决il2cpp和lua循环引用引发的内存泄露问题。\n- 支持全方面的CLR与lua运行时的相互调用。例如支持数组、泛型类型、泛型函数以及对ref、out、in之类的函数参数。\n- 支持字段访问优化及简单property(类似`int Value {get; set;}`)优化，至少**提升10倍**以上性能。\n- 清晰优雅的代码实现、良好的模块。\n- 支持luajit 及 lua 5.3-5.4版本。\n- **支持[luau](https://luau.org/)**\n- 尽可能使用luajit深度优化调用c#函数的性能。\n- 尽可能使用light C function优化调用c#函数的性能。\n- 支持协程。\n- 维护大量常见的第三库。\n- 支持调试。\n- 支持profiler。\n- **TODO**\n  - aot hotfix。依赖hybridclr。\n  - 原生Lua MonoBehaviour支持。依赖hybridclr。\n\n### Editor\n\n- Editor内无任何生成。\n- 支持Editor 内热重载。\n- 支持console lua日志跳转到源码。\n\n### 其他\n\n- 完善全面的测试工程。\n\n## 支持的版本和平台\n\n- 支持luajit(5.1)及lua 5.3+版本，**支持[luau](https://luau.org/)**\n- 支持 unity 2022+版本及团结引擎（2021及更早的版本后面再支持）。\n- 支持 mono、il2cpp backend。\n- 支持il2cpp支持的所有平台（含webgl、微信小游戏及团结引擎支持的鸿蒙和车机平台）。\n\n## 许可证\n\nzlua 采用 MIT 许可证发布，欢迎自由使用、修改和分发。\n\n## 联系我们\n\n如有问题、建议或错误报告，请在用以下方式联系我们：\n\n- GitHub 上提交 Issue\n- 邮件联系维护者：`zlua#code-philosophy.com`\n- QQ群 **zlua交流群**： 824793773\n- discord频道 `https://discord.gg/htmr44jW6A`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffocus-creative-games%2Fzlua","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffocus-creative-games%2Fzlua","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffocus-creative-games%2Fzlua/lists"}