Skip to main content

Welcome to SolarSharp

SolarSharp is a modernized, high-performance Lua interpreter written entirely in C# for the .NET ecosystem. It provides a complete Lua 5.2 implementation with excellent compatibility, modern C# features, and significant performance improvements.

What is SolarSharp?

SolarSharp is a fork of MoonSharp that takes advantage of modern .NET capabilities:
  • Built on .NET Standard 2.1 to leverage modern C# features
  • Performance improvements across the interpreter & parser
  • Bug fixes and enhanced stability
  • Full Lua 5.2 compatibility (except weak tables)
SolarSharp is perfect for embedding Lua scripting in .NET applications, Unity games, and other .NET-based platforms.

Key Features

Easy to Use

Simple API that lets you run Lua scripts with just a few lines of C# code.

High Performance

Optimized interpreter with performance improvements over the original implementation.

Cross-Platform

Runs on .NET Core, Unity3D, iOS (AOT), IL2CPP, and many other platforms.

Rich Interop

Easy and performant interop with CLR objects, methods, properties, and more.

Full Standard Library

Complete Lua standard library with very few exceptions.

Coroutine Support

Full coroutine support, including invocation as C# iterators.

Bytecode Support

Dump and load bytecode for obfuscation and faster parsing.

JSON Parser

Embedded JSON parser to convert between JSON and Lua tables.

Getting Started

Ready to start using SolarSharp? Follow our quickstart guide to get up and running in minutes.

Quickstart

Get started with SolarSharp in under 5 minutes

Installation

Install SolarSharp via NuGet in your project

API Reference

Explore the complete API documentation

Core Concepts

Learn about key concepts and architecture

Why SolarSharp?

Modern C# Features

Built on .NET Standard 2.1, SolarSharp takes full advantage of modern C# language features and runtime optimizations that weren’t available in the original MoonSharp codebase.

Performance Focused

Significant performance improvements have been made across the interpreter and parser. Check out our performance benchmarks to see the improvements.

Battle-Tested

As a modernized version of MoonSharp, SolarSharp inherits years of stability and bug fixes while adding new improvements and optimizations.

Flexible Sandboxing

Easy opt-out of Lua standard library modules allows you to sandbox what scripts can access, making it safe to run untrusted code.

Platform Support

SolarSharp runs on a wide variety of platforms:
  • .NET Standard 2.0 and 2.1
  • .NET 9.0 and later
  • Unity3D (including IL2CPP)
  • Xamarin
  • iOS (Ahead-of-time compilation)
  • And many more .NET platforms
No external dependencies are required - SolarSharp is implemented with as few dependencies as possible.

License

SolarSharp is released under a 3-clause BSD license, making it free to use in both commercial and open-source projects.

Next Steps

1

Install SolarSharp

Add SolarSharp to your project via NuGet - Installation Guide
2

Run Your First Script

Follow our quickstart to execute your first Lua script - Quickstart
3

Explore the API

Learn about the Script class and core APIs - API Reference
4

Master Advanced Features

Dive into CLR interop, coroutines, and more - Core Concepts

Build docs developers (and LLMs) love