CSharp.lua compiles C# source into Lua that runs on a Lua VM. It includes CoreSystem.lua for .NET-like types without the CLR.
Overview
CSharp.lua lets you author C# and execute the result on a Lua virtual machine. The compiler walks a C# abstract syntax tree, lowers it to a Lua AST, and emits Lua source designed to stay readable for debugging and inspection.
The companion CoreSystem.lua library implements much of the .NET Framework core surface, including basic types, delegates, generic collections, and LINQ-style operations. Converted Lua code depends on this library when running outside the CLR.
The toolchain is built on .NET and is intended to work across platforms where .NET is available. A command-line interface drives compilation, and sample console programs illustrate typical workflows such as Fibonacci output.
The project is suited to teams that want C# syntax and familiar APIs in environments where Lua is the deployment runtime, such as embedded scripting or game engines that standardize on Lua.
Key features
- C# source to Lua output
- Readable Lua code generation
- CoreSystem.lua runtime
- LINQ and collection support
- Cross-platform .NET toolchain
- Command-line compiler
- CLR-free Lua execution
Use cases
- Scripting with C# syntax
- Lua VM game logic
- Portable .NET-like APIs on Lua
- Console utilities compiled to Lua