Coder Social home page Coder Social logo

wdshin / moonsharp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from moonsharp-devs/moonsharp

0.0 2.0 0.0 70.47 MB

An interpreter for the Lua language, written entirely in C# for the .NET, Mono, Xamarin and Unity3D platforms, including handy remote debugger facilities.

Home Page: http://www.moonsharp.org

License: Other

C# 82.55% Lua 15.09% Smalltalk 0.01% HTML 0.28% JavaScript 1.18% ActionScript 0.11% CSS 0.41% Makefile 0.23% Shell 0.04% GLSL 0.02% Batchfile 0.01% TypeScript 0.05% PowerShell 0.04%

moonsharp's Introduction

MoonSharp Build Status Build Status

http://www.moonsharp.org

A complete Lua solution written entirely in C# for the .NET, Mono, Xamarin and Unity3D platforms.

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, .NET Core, 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

For highlights on differences between MoonSharp and standard Lua, see http://www.moonsharp.org/moonluadifferences.html

Please see http://www.moonsharp.org for downloads, infos, tutorials, etc.

License

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

Parts of the string library are based on the KopiLua project (https://github.com/NLua/KopiLua). Debugger icons are from the Eclipse project (https://www.eclipse.org/).

Usage

Use of the library is easy as:

double MoonSharpFactorial()
{
	string script = @"    
		-- defines a factorial function
		function fact (n)
			if (n == 0) then
				return 1
			else
				return n*fact(n - 1)
			end
		end

	return fact(5)";

	DynValue res = Script.RunString(script);
	return res.Number;
}

For more in-depth tutorials, samples, etc. please refer to http://www.moonsharp.org/getting_started.html

moonsharp's People

Contributors

xanathar avatar seijikun avatar jagt avatar fgretief avatar johnwordsworth avatar matija-hustic avatar silv3rpro avatar atom0s avatar jernejk avatar

Watchers

Wondong Shin avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.