Project Description
Lua for .NET via F#.

Check the Issue Tracker for implementation details.

A Lua compiler/intepreter has been one of my forever projects for a few years now.

Besides a few quirks, Lua is a great language; however, the same features that make it great, also make it particularly hard to port in other environments (at least in my experience).
Coroutines and built-in debugging functions inevitably expose some of the internals of the language, and those have proved difficult to emulate in other languages.

If coroutines were managed by keywords, rather than object methods, it would have been possible to implement them by switching to different function compilation strategies. The parser could statically determine which methods would be eligible for "coroutine-compatible" compilation.
Given that coroutines are managed by a "coroutine" object and its methods, all of which are overwritable by user code, the complexity of an equivalent implementation increases.

Debugging functions also expose implementation-specific internals (in this case, the details of the default Lua VM), and their inclusions in any compatible implementation forces specific choices when writing the backend.

IronLua currently features a working top-down-operator-precedence Lua 5.2 parser but no compiler for the time being. I do not plan on using the DLR.

The solution also includes a C# interpreter, but it's all work-in-progress.

Coroutine support and the built-in debug functions are planned.

Last edited Feb 9, 2013 at 6:09 PM by rcollina, version 5