NovaSharp

NovaSharp — GitHub Repository

NuGet License: MIT

Overview

This project is a port of MoonSharp. MoonSharp has not had a commit in over 4 years, and its last stable release was over 9 years ago. It would be awesome to have an active, maintained version of this project.

Project Goals

Installation

NuGet (.NET):

dotnet add package WallstopStudios.NovaSharp.Interpreter

Unity Package Manager: See docs/UnityIntegration.md for detailed instructions, or add the package from disk using scripts/packaging/build-unity-package.sh.

AI Warning

In order to accomplish the above, I will be utilizing AI coding assistance. I will do my best to vet the quality of all code and this repo.

Legacy README

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

Features:

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

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

Additional documentation:

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:

using NovaSharp;
using WallstopStudios.NovaSharp.Interpreter;

double NovaSharpFactorial()
{
	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)";

	LuaValue res = Script.RunString(script);
	return res.AsNumber();
}

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