Rillium.Script 0.0.4

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Rillium.Script --version 0.0.4                
NuGet\Install-Package Rillium.Script -Version 0.0.4                
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="Rillium.Script" Version="0.0.4" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rillium.Script --version 0.0.4                
#r "nuget: Rillium.Script, 0.0.4"                
#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.
// Install Rillium.Script as a Cake Addin
#addin nuget:?package=Rillium.Script&version=0.0.4

// Install Rillium.Script as a Cake Tool
#tool nuget:?package=Rillium.Script&version=0.0.4                

Rillium Script 128

Rillium.Script

Rillium.Script Documentation Code Coverage

Support script evaluation in your dotnet application.

using Rillium.Script;

// Simple math parser
int a = Evaluator.Evaluate<int>("4 + 3 * 2");              // 10
int b = Evaluator.Evaluate<int>("var b = 4 + 3 * 2; b;");  // 10

// Supports System.Math methods
double c = Evaluator.Evaluate<double>("Log(1.5)");         // 0.4054651081081644

Try it out: https://dotnetfiddle.net/zPMMvA

Documentation: https://github.com/rilliumio/Rillium.Script/wiki

Introduction

This is an implementation of a c-styled script parser and evaluator. It consists of a lexer, which converts raw source code into a sequence of tokens, and a parser, which turns this sequence of tokens into an abstract syntax tree (AST). The AST represents the program's structure and semantics, and is then used to generate executable code.

Security

Rillium.Script was created to provide basic scripting functionality that could be modified at runtime without the need to recompile or redeploy. When evaluating other options, such as Roslyn or other script engine projects:

  • The scope of these projects are too large for our needs. They included features that were not need, such as debugging support or IDE integration.

  • The risk of malicious code execution is too high, such as allowing users to define code executed by the Roslyn.Compiler directly.

Rillium.Script was created out of the need for a simple, secure, and easy-to-use script. It is also easy to use, with a simple API that makes it easy to integrate into your applications.

Performance

Rillium.Script implements the concept of an LR Parser, that reads the input string from left to right and produces a rightmost derivation in reverse. The parser builds a parse tree and analyzes the structure of the input string. One of the key advantages of the LR Parser is that it can handle a broad class of context-free grammar and generate a deterministic parser from the grammar rules.

The Rillium.Script parser is designed to be fast, reliable, and efficient. It's capable of handling a wide range of syntax structures, including conditional statements, loops, expressions, and more.

Feedback Welcome!

If you discover bugs or deficiencies, please create a new issue with an example script.

For new feature proposals, please raise them for discussion.

Product Compatible and additional computed target framework versions.
.NET 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.

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.2.4 55 12/2/2024
0.2.3 610 12/4/2023
0.2.2 452 12/3/2023
0.1.1 510 11/28/2023
0.0.6 796 7/7/2023
0.0.5 600 7/5/2023
0.0.4 721 7/3/2023