Skip to content

A pure-C# implementation of Lua, focusing on compatibility with Lua and support for older versions of .NET

License

Notifications You must be signed in to change notification settings

Stevie-O/SharpLua

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is my fork of minlover11's SharpLua, an excellent reimplementation of
Lua version 5.1.5 in native C# (*not* a simple wrapper) that seamlessly
leverages Reflection to integrate Lua into .NET's type system.

My changes include the following:

* Increased compatibility with the original Lua.  As much of the original
  Lua 5.1.5 test suite passes as I could manage.
* Increased performance (not merged in yet, check 'optimizations' branch.)
* Compatible with .NET 2.0 -- both FX (the desktop framework) and CF (the
  stripped-down version that runs on Windows CE).
  Yes, this Lua works even on ARM CPUs running Windows CE 5.0.

---------------------------------------
Original README:

SharpLua 2.0 is a combination of a port of Lua 5.1.5, various interfaces, but will be eventually replaced by new, better, code.
Why did I start with a Lua 5.1.5 C port? because... You Can't Get More Accurate Than The Original (TM), and the C api allows easier porting of C libs.


SharpLua is an implementation of Lua for .NET
It can run lua files including bytecode (compatible with native Lua), create .NET objects and call methods on them (including static methods), and 
supports all standard lua functions. It does not support C Libraries.

To use in your projects, just add a reference to the SharpLua.dll file and use the 
SharpLua.LuaInterface class or the SharpLua.LuaRuntime, SharpLua.Lua is the raw Lua API.

NOTE: If you simplify the AST, you CAN NOT use a reconstructor that operates on the tokens unless you patch the tokens, as the Simplification process does not do that

Features Lua 5.1.5 doesn't have:
- table.unpack (similar to _G.unpack)
- a large extension library
- clr library (allows .NET object access)
- Syntax extensions
    - ! (not)
    - >> (right shift)
    - << (left shift)
    - & (bitwise and)
    - | (bitwise or)
    - ^^ (Xor)
    - ~(bitwise not)
    - using/do statements
    - named functions in tables (e.g. { function x() end })

Current projects:
SharpLua                     The SharpLua core, along with a LASM library
SharpLua.Interactive         SharpLua REPL
SharpLua.InterfacingTests    SharpLua interfacing tests. As apposed to using the raw Lua API.
SharpLua.Compiler            SharpLua bytecode compiler

Future projects:
SharpLua.Decompiler          SharpLua bytecode decompiler
SharpLua.Web                 Web handler for #Lua
SharpLua SharpDevelop AddIn  Support SharpLua/Lua files and projects, GUI 
                                designer, and msbuild project builder
SharpLua Wpf support

About

A pure-C# implementation of Lua, focusing on compatibility with Lua and support for older versions of .NET

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 90.6%
  • Lua 7.5%
  • C 1.4%
  • CSS 0.2%
  • Visual Basic .NET 0.2%
  • Batchfile 0.1%