Puerts.Lua.NativeAssets.macOS 3.0.2

Prefix Reserved
dotnet add package Puerts.Lua.NativeAssets.macOS --version 3.0.2
                    
NuGet\Install-Package Puerts.Lua.NativeAssets.macOS -Version 3.0.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Puerts.Lua.NativeAssets.macOS" Version="3.0.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Puerts.Lua.NativeAssets.macOS" Version="3.0.2" />
                    
Directory.Packages.props
<PackageReference Include="Puerts.Lua.NativeAssets.macOS" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Puerts.Lua.NativeAssets.macOS --version 3.0.2
                    
#r "nuget: Puerts.Lua.NativeAssets.macOS, 3.0.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Puerts.Lua.NativeAssets.macOS@3.0.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Puerts.Lua.NativeAssets.macOS&version=3.0.2
                    
Install as a Cake Addin
#tool nuget:?package=Puerts.Lua.NativeAssets.macOS&version=3.0.2
                    
Install as a Cake Tool

PuerTS — Lua for .NET

license Puerts.Lua.Complete

PuerTS is a scripting solution that brings Lua to your .NET applications. Built on Lua 5.4, it provides high-performance script execution with seamless C# interop — using the same unified ScriptEnv API as the JavaScript and Python backends.

Features

  • 🚀 High Performance — Powered by Lua 5.4, one of the fastest embeddable scripting languages.
  • 🔗 Seamless C# Interop — Call any .NET type directly from Lua, and invoke Lua functions from C#.
  • 🌍 Cross-Platform — Supports Windows, macOS, and Linux.
  • 🔄 Unified API — Same ScriptEnv architecture as JS and Python backends — easy to switch or mix languages.

Installation

Install via NuGet. The Complete package includes core + native assets for all desktop platforms:

dotnet add package Puerts.Lua.Complete

Or install components separately for finer control:

# Core library (required)
dotnet add package Puerts.Core

# Lua backend
dotnet add package Puerts.Lua

# Native assets per platform (choose what you need)
dotnet add package Puerts.Lua.NativeAssets.Win32
dotnet add package Puerts.Lua.NativeAssets.Linux
dotnet add package Puerts.Lua.NativeAssets.macOS

Supported Platforms

.net8.0+, .netstandard2.1

Windows (x64) Linux (x64) macOS (Universal)
Lua ✔️ ✔️ ✔️

Note: AOT compilation is not currently supported.

Quick Start

using Puerts;

var env = new ScriptEnv(new BackendLua());

// Execute Lua code
env.Eval(@"
    local CS = require('csharp')
    local Console = CS.System.Console
    Console.WriteLine('Hello from Lua!')
");

// Eval with return value (Lua requires explicit 'return')
int result = env.Eval<int>("return 1 + 2");
Console.WriteLine($"Lua result: {result}"); // output: 3

env.Dispose();

Calling C# from Lua

Access .NET types via require('csharp'):

local CS = require('csharp')
local Console = CS.System.Console
local DateTime = CS.System.DateTime
local List = CS.System.Collections.Generic.List(CS.System.String)

-- Create instances and call methods
local now = DateTime.Now
Console.WriteLine('Current time: ' .. now:ToString())

local list = List()
list:Add('hello')
list:Add('world')
Console.WriteLine('Count: ' .. tostring(list.Count))

Note: In Lua, instance methods use the colon syntax obj:Method(), while static methods use the dot syntax Class.Method().

Calling Lua from C#

using Puerts;
using System;

var env = new ScriptEnv(new BackendLua());

// Get a Lua function as a C# delegate
var add = env.Eval<Func<int, int, int>>("return function(a, b) return a + b end");
Console.WriteLine(add(10, 20)); // output: 30

// Get a Lua action
var greet = env.Eval<Action<string>>(@"
    return function(name)
        local CS = require('csharp')
        CS.System.Console.WriteLine('Hello, ' .. name .. '!')
    end
");
greet("PuerTS");

env.Dispose();

Key Differences from JS

Feature JavaScript Lua
Environment creation new ScriptEnv(new BackendV8()) new ScriptEnv(new BackendLua())
Console output console.log(...) print(...)
Accessing C# types CS.Namespace.Class require('csharp') to get namespace entry
Instance method calls obj.Method() obj:Method() (colon syntax)
Null representation null / undefined nil
Return from Eval Last expression auto-returned Explicit return required

Documentation

For full documentation, tutorials and API reference, visit: https://puerts.github.io/en

License

BSD 3-Clause

There are no supported framework assets in this package.

Learn more about Target Frameworks and .NET Standard.

  • .NETStandard 2.1

    • No dependencies.
  • net10.0

    • No dependencies.
  • net8.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Puerts.Lua.NativeAssets.macOS:

Package Downloads
Puerts.Lua.Complete

Puerts is a library that makes it easy to add scripting to your .NET applications. It currently supports JavaScript (via V8/Nodejs/Quickjs) and Lua.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.2 228 4/2/2026
3.0.1 229 3/4/2026
3.0.0 475 12/15/2025
3.0.0-beta1 573 12/8/2025
3.0.0-alpha4 543 8/6/2025
3.0.0-alpha3 531 8/5/2025
3.0.0-alpha2 515 8/5/2025