Skip to main content
The experimental package contains features that are still in development. APIs may change or be removed in future versions without notice. Use these features with caution in production code.

What is the Experimental Package?

The experimental package (Loretta.CodeAnalysis.Lua.Experimental) contains features that are being tested and refined before potentially becoming part of the stable Loretta API. These features are fully functional but may undergo breaking changes as they evolve.

Installation

Install the experimental package via NuGet:
dotnet add package Loretta.CodeAnalysis.Lua.Experimental
Or using the Package Manager Console:
Install-Package Loretta.CodeAnalysis.Lua.Experimental

Available Features

The experimental package currently provides two main features:

Constant Folder

Optimize your Lua code by folding constant expressions at compile time

Minifier

Reduce code size by removing whitespace and renaming variables

When to Use Experimental vs Stable

Use Experimental Features When:

  • You’re building developer tools or code optimization pipelines
  • You need advanced code transformation capabilities
  • You’re willing to handle potential API changes in future updates
  • You’re prototyping or exploring Loretta’s capabilities

Stick to Stable APIs When:

  • You’re building production-critical applications
  • You need long-term API stability guarantees
  • You’re just getting started with Loretta
  • Your project has strict dependency management requirements

API Stability Warning

Important Notes:
  • Experimental APIs may change between minor versions
  • Features may be removed if they don’t meet quality standards
  • Some experimental features may eventually move to the stable package
  • Always check release notes when updating the experimental package

Getting Started

All experimental features are exposed through extension methods in the Loretta.CodeAnalysis.Lua.Experimental namespace:
using Loretta.CodeAnalysis.Lua;
using Loretta.CodeAnalysis.Lua.Experimental;

// Parse Lua code
var tree = LuaSyntaxTree.ParseText("local x = 1 + 2");

// Use experimental features
var folded = tree.GetRoot().ConstantFold(ConstantFoldingOptions.Default);
var minified = tree.Minify();

Providing Feedback

If you encounter issues or have suggestions for experimental features:
  1. Report bugs on the GitHub issue tracker
  2. Share your use cases and feedback
  3. Consider contributing improvements via pull requests
Your feedback helps shape which experimental features become stable!

Build docs developers (and LLMs) love