SLThree 0.8.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package SLThree --version 0.8.0
                    
NuGet\Install-Package SLThree -Version 0.8.0
                    
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="SLThree" Version="0.8.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SLThree" Version="0.8.0" />
                    
Directory.Packages.props
<PackageReference Include="SLThree" />
                    
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 SLThree --version 0.8.0
                    
#r "nuget: SLThree, 0.8.0"
                    
#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 SLThree@0.8.0
                    
#: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=SLThree&version=0.8.0
                    
Install as a Cake Addin
#tool nuget:?package=SLThree&version=0.8.0
                    
Install as a Cake Tool

SLThree

A simple and easily embedded programming language for the .NET platform. Dynamic typing, lightweight reflection, this language is convenient for describing data and behavior.

For more information about syntax: slt-lang.github.io

Embedding

Code example for C#:

using System;
using SLThree;
using SLThree.Embedding;

namespace TestSLThree
{
    public class Program
    {
        public class TC
        {
            public int x, y;
            public Method sum;
            public object Sum() => sum.Invoke(x, y);
        }

        public class TC2
        {
            public Func<int, int, int> sum2;
        }

        static void Main(string[] args)
        {
            //Context.ReturnedValue method
            Console.WriteLine("return 2 + 2 * 2;".RunScript().ReturnedValue);

            //Uwrapping method
            var tc = "x = 3; y = 5; sum = (a, b) => a + b;".RunScript().Unwrap<TC>();
            Console.WriteLine(tc.Sum());

            //[Experimental] Compilation:
            var tc2 = "sum2 = (new using jit).opt(sum2 = (i32 x, i32 y): i32 => x + y, self).CreateDelegate(@System.Func<i32, i32, i32>);".RunScript().Unwrap<TC2>();
            Console.WriteLine(tc2.sum2(35, 65));
        }
    }
}

Download

stable

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
.NET Framework net471 is compatible.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.0-alpha.1215 203 8/17/2025
0.9.0-alpha.1090 184 5/3/2025
0.9.0-alpha.1014 302 2/20/2025
0.9.0-alpha.700 174 10/5/2024
0.9.0-alpha.580 205 9/1/2024
0.8.1 783 6/22/2024
0.8.0 717 6/21/2024 0.8.0 is deprecated because it is no longer maintained.
Loading failed

------ 0.8.0 Binding&Naming Update ------ [21.06.24]
Language:
   - New method definition syntax
     `[modifs][Name][<T>](args) {...}`
     `[modifs][Name][<T>](args) => value`
   - You can now implements contexts with ":" in the following cases:
     - New initializers:       // [] - optional
        `new T [Name][: Ancestors][{...}]`
     - New context creators:
        `context [Name][: Ancestors] {...}`
        `new context [Name][: Ancestors]`
   - Statement-like notation (without `;`) for expressions with body:
       condition, match, context, new, methods
   - Constructor method that creates new contexts
      `context TBase { constructor = (f) => this.f = f; };`
      `T1 = TBase(5); T2 = TBase(10);`
   - The right side of the nested context initializer
     assignations now always refers to the self context
      `x = 1; context A { context B { x = x; }}`
   - Parent keyword in constructed contexts
      `T1.parent == TBase;`
   - Abstract methods (withoud body)
   - Static expression (will be executed only once) `static x`
   - Condition statement is now expression
   - Using statement is now expression
   - Strong method binding
   - Changed context syntax:
      `new context Name: T {...}` -> `new T Name {...}`
      `new context: T {...}` -> `new T {...}`
      `new context Name: T` -> `new T Name`
      `new context: T` -> `new T`
      `new context Name {...}` -> `context Name {...}`
      `new context {...}` -> `context {...}`
Optimization:
   - Executing method performance has been increased by ~10%
   - Wrappers refactoring, minumum 3x faster wrapping
     minimum 20x faster unwrapping
Bugfixes:
   - Fixed object invokation (#125)