SLThree 0.9.0-alpha.186
See the version list below for details.
dotnet add package SLThree --version 0.9.0-alpha.186
NuGet\Install-Package SLThree -Version 0.9.0-alpha.186
<PackageReference Include="SLThree" Version="0.9.0-alpha.186" />
<PackageVersion Include="SLThree" Version="0.9.0-alpha.186" />
<PackageReference Include="SLThree" />
paket add SLThree --version 0.9.0-alpha.186
#r "nuget: SLThree, 0.9.0-alpha.186"
#:package SLThree@0.9.0-alpha.186
#addin nuget:?package=SLThree&version=0.9.0-alpha.186&prerelease
#tool nuget:?package=SLThree&version=0.9.0-alpha.186&prerelease
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
Product | Versions 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. |
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.1090 | 64 | 5/3/2025 | |
0.9.0-alpha.1014 | 174 | 2/20/2025 | |
0.9.0-alpha.700 | 69 | 10/5/2024 | |
0.9.0-alpha.580 | 82 | 9/1/2024 | |
0.8.1 | 160 | 6/22/2024 | |
0.8.0 | 141 | 6/21/2024 | |
0.7.1.2989 | 152 | 6/1/2024 | |
0.7.0.2988 | 166 | 4/24/2024 | |
0.6.0 | 182 | 1/22/2024 |
------ 0.9.0 Parameters Update ------ [~.~.~]
Language:
- New generic methods
- For now need to add the `template` modificator
`template f<T>() => T;`
- Constraints on parameters
`<T1: value + i64 | u64, T2: => T2 >= 10>() => T1 + T2;`
- Make generic
`slt.make_template(f, -[2]);`
- New entity for code generation - Macros
Macros clearly store the context in which they were created
`$(2 + 2)`, `${using linq;}`
Assignation by variable reference macros
`a = 2; ra = $(a); ra $= 4; a == 4;`
This reference can also be passed as generic parameter
- Blocks `{...}` is expressions now
- Dictionary initializers new syntax:
`new dict { 1: 2, 3: 4 }`
`new dict<i64, i64> { 1: 2, 3: 4 }`
- Syntax sugar for overloading methods
- Defining methods with default parameters
`(x = 5, y = 10) => x + y;`
- `params` modificator:
`params f(args) => args;`
`args(1, 2, 3); //[1, 2, 3]`
- Calling methods with a variable number of arguments
- Syntax for creating methods from generics:
`_is<T>(a) => a is T; isi64 = _is<i64>;`
Bugfixes:
- Ignoring deffered code in static (#129)
- Ignoring indexed properties in wrappers (#130)
- Generic supporting for 0.8 initializers (#131)