GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • MoonSharp
  • Links
  • About
  • Getting Started
  • FAQ
  • Reference
  • GitHub
  • Discord

This view

  • Original page
  • New address

GeezerVison is showing www.moonsharp.org — MoonSharp

MoonSharp

A Lua interpreter written entirely in C# for the .NET, Mono and Unity platforms.

Downloads Sources Unity Asset
  • MoonSharp - interpreter package
  • MoonSharp.Debugger.VsCode - VisualStudio Code Debugger package
  • MoonSharp.Debugger - Remote Debugger package

MoonSharp is a Lua interpreter written entirely in C# for maximum compatibility in .NET, Mono, Xamarin and Unity.

It’s a “clean room” design - that is, almost none of the original source code has been reused (apart from parts of the standard library) and most of it has been developed by studying the specifications and the behavior of the official implementations.

Features

  • 99% compatible with Lua 5.2 (with the only unsupported feature being weak tables support)
  • Support for metalua style anonymous functions (lambda-style)
  • Easy to use API
  • Debugger support for Visual Studio Code (PCL targets not supported)
  • Remote debugger accessible with a web browser and Flash (PCL targets not supported)
  • Runs on .NET 3.5, .NET 4.x, Mono, Xamarin and Unity3D
  • Runs on Ahead-of-time platforms like iOS
  • Runs on IL2CPP converted code
  • Runs on platforms requiring a .NET 4.x portable class library (e.g. Windows Phone)
  • No external dependencies, implemented in as few targets as possible
  • Easy and performant interop with CLR objects, with runtime code generation where supported
  • Interop with methods, extension methods, overloads, fields, properties and indexers supported
  • Support for the complete Lua standard library with very few exceptions (mostly located on the ‘debug’ module) and a few extensions (in the string library, mostly)
  • Async methods for .NET 4.x targets
  • Supports dumping/loading bytecode for obfuscation and quicker parsing at runtime
  • An embedded JSON parser (with no dependencies) to convert between JSON and Lua tables
  • Easy opt-out of Lua standard library modules to sandbox what scripts can access
  • Easy to use error handling (script errors are exceptions)
  • Support for coroutines, including invocation of coroutines as C# iterators
  • REPL interpreter, plus facilities to easily implement your own REPL in few lines of code
  • Complete XML help, and walkthroughs on http://www.moonsharp.org

Project Status

  • Completed, barring improvements, enhancements and new features!
  • Some intentional minimal differences exist - see here
  • All Lua 5.2 language constructs are implemented, except weak tables.
  • Development of the standard library is finished. Updated situation in the standard library page
Roadmap
  • Language analysis features
  • Improvements

License

The program and libraries are released under a 3-clause BSD license - see the license section.

Some parts of the string library (parttern matching and string.format) are taken from KopiLua

Resources
  • Privacy Policy
  • FAQ
  • Differences vs Lua
  • Additions vs Lua
  • Issues/Tasks/Bug report
  • Change log
  • API Reference
  • Standard Library Progress
  • Lua 5.2 Reference
  • Discord
Downloads
  • Zip releases
  • Nuget package
  • Nuget package - debugger
  • Latest sources .tgz
  • Latest sources .zip
  • View on GitHub
Tutorials
  1. Getting Started
  2. Keeping a Script around
  3. DynValue revealed
  4. Calling back C#
  5. Auto-conversions
  6. Sharing objects
  7. Proxy objects
  8. Error handling
  9. Script loaders
  10. Platform accessors
  11. Script options
  12. Debugger support
  13. Coroutines
  14. Hardwiring
  15. Sandboxing
  16. Unity3D Tips
  17. FAQ / Recipes
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.