Skip to main content

vs xLua / toLua / SLua

Nature: evaluation and analysis material — not a ZLua behavior Spec. Coverage: four-way comparison of xLua, toLua/tolua#, SLua, and ZLua.

This directory

FileContent
FEATURES.mdFeature & usage differences: type access, calls, C#→Lua, value types, hotupdate/codegen, Editor/Player, invasiveness, whitelist
PERFORMANCE.mdLua↔C# performance: Il2Cpp four-way measurements + why faster (zlua-benchmark)
GC.mdGC theory: hot-path allocation, ObjectRegistry/ByVal/Opaque, “zero GC” boundaries
BRIDGE.mdBridge performance & binary size: generation granularity, stub reuse, four-way contrast

Comparison targets

SolutionTypical positioningMaturityRelation to ZLua
xLuaHotupdate-friendly, generated Wrap + reflection fallback, mature ecosystemProduction-gradeSame “high-perf native binding” track; ZLua aims to cut libxlua / C# Wrap round-trips
toLua / tolua#Export wrapper classes, traditional Lua framework styleLegacy, less maintainedBoth require moving from “pre-generated Wrap” to ZLua lazy bind
SLuaExport + auto-bindLegacySimilar to toLua; config-driven export
ZLuaDual backend Editor Mono / Player Il2Cpp; Il2Cpp embedded, signature stub reuse, C#-like semanticsMono and Il2Cpp both done (see impl/MONO.md, impl/IL2CPP.md)The “subject under evaluation” of this doc tree

ZLua current status (honest)

BackendStatusNotes
Il2Cpp (Player)DoneSpec and impl follow build-win64/.../libil2cpp/zlua; perf comparisons should use Player
Mono (Editor)DoneLua-visible semantics match Il2Cpp; Expression Emit implementation
Docs / ecosystemBuildingNo xLua-scale community or hotupdate kit; migration needs your own test matrix

ZLua numbers in perf/GC docs mean Il2Cpp Player; Mono Editor does not represent ship performance.

Reading order

  1. Before choosing or migrating: read FEATURES.md for semantic and engineering differences.
  2. If performance is the bottleneck: read PERFORMANCE.md + GC.md, then decide whether to profile.
  3. For package size / codegen volume: read BRIDGE.md.
  4. For actual migration: see guides/migration/.

Writing principles

  1. Features/usage: comparison tables + migration impact (link guides/migration/).
  2. Performance / GC / bridge size: prefer reproducible benchmarks; unmeasured items marked TBD.
  3. Do not dismiss other solutions’ valid niches; spell out ZLua’s trade-offs (libil2cpp invasiveness, Unity version merges, Lua version lock-in, etc.).
  4. Multipliers and ns: follow the Il2Cpp measured tables in PERFORMANCE.md (public repo zlua-benchmark).
DocContent
spec/00-OVERVIEW.mdZLua product goals and dual runtime
guides/migration/README.mdMigration Guides index
guides/TESTING.mdDual-end regression testing
zlua-benchmarkReproducible perf benchmarks and latest comparison reports

Comparison docs update as ZLua evolves; on conflict, ZLua behavior follows spec/**.