All Projects → FlorianRappl → Mages

FlorianRappl / Mages

Licence: mit
🎩 MAGES is a very simple, yet powerful, expression parser and interpreter.

Projects that are alternatives of or similar to Mages

Mond
A scripting language for .NET Core
Stars: ✭ 237 (+157.61%)
Mutual labels:  nuget, interpreter
Hdbf
Hyper-Dimensional Brainfuck
Stars: ✭ 87 (-5.43%)
Mutual labels:  interpreter
Oh
A new Unix shell.
Stars: ✭ 1,206 (+1210.87%)
Mutual labels:  interpreter
Pebakery
PEBakery is a script engine that specializes in customizing the Windows Preinstalled Environment (WinPE/WinRE).
Stars: ✭ 80 (-13.04%)
Mutual labels:  interpreter
Python lite
[WIP] A simple, lightweight implementation of python3 language.
Stars: ✭ 77 (-16.3%)
Mutual labels:  interpreter
Xstateful
A wrapper for xstate that stores state, handles transitions, emits events for state changes and actions/activities, and includes an optional reducer framework for updating state and invoking side-effects
Stars: ✭ 81 (-11.96%)
Mutual labels:  interpreter
Gistlyn
Run Roslyn Gists
Stars: ✭ 75 (-18.48%)
Mutual labels:  nuget
Sharp7
Nuget package for Sharp7
Stars: ✭ 89 (-3.26%)
Mutual labels:  nuget
Abrvalg
Python-like programming language interpreter written in Python
Stars: ✭ 83 (-9.78%)
Mutual labels:  interpreter
Rs Monkey Lang
Monkey Programming Language written in Rust.
Stars: ✭ 80 (-13.04%)
Mutual labels:  interpreter
Tagha
Minimal, low-level, fast, and self-contained register-based bytecode virtual machine/runtime environment.
Stars: ✭ 79 (-14.13%)
Mutual labels:  interpreter
Smallbasic
SmallBASIC is a fast and easy to learn BASIC language interpreter ideal for everyday calculations, scripts and prototypes. SmallBASIC includes trigonometric, matrices and algebra functions, a built in IDE, a powerful string library, system, sound, and graphic commands along with structured programming syntax
Stars: ✭ 78 (-15.22%)
Mutual labels:  interpreter
Internettools
XPath/XQuery 3.1 interpreter for Pascal with compatibility modes for XPath 2.0/XQuery 1.0/3.0, custom and JSONiq extensions, XML/HTML parsers and classes for HTTP/S requests
Stars: ✭ 82 (-10.87%)
Mutual labels:  interpreter
Blurrycontrols
Small design library for blured controls in XAML and WPF for C#
Stars: ✭ 77 (-16.3%)
Mutual labels:  nuget
Magpie
🐦 Successor of my monkey Interpreter(support for class, linq, sql, net, http, fmt, json and A realtime syntax highlighting REPL).
Stars: ✭ 88 (-4.35%)
Mutual labels:  interpreter
Ntphp
Ever wanted to execute PHP in your kernel driver? Look no further!
Stars: ✭ 76 (-17.39%)
Mutual labels:  interpreter
Krypton Net 5.470
A update to Component factory's krypton toolkit to support the .NET 4.7 framework.
Stars: ✭ 79 (-14.13%)
Mutual labels:  nuget
Openmod
OpenMod .NET Plugin Framework
Stars: ✭ 81 (-11.96%)
Mutual labels:  nuget
Wasm Forth
A Forth implementation compiling to WebAssembly.
Stars: ✭ 92 (+0%)
Mutual labels:  interpreter
Feral
Feral programming language reference implementation
Stars: ✭ 89 (-3.26%)
Mutual labels:  interpreter

MAGES Logo

MAGES

AppVeyor CI Nuget count Issues open

Mages: Another Generalized Expression Simplifier

MAGES is the official successor to YAMP. It is a very simple, yet powerful, expression parser and interpreter. You can use MAGES to include a sophisticated, easy to customize, and lightweight scripting engine to your application.

Current Status

The first stable version has been released. The current version 1.6.0 contains an improved REPL. The library contains everything to perform lightweight scripting operations in C#. A CodeProject article about the library (also containing some background and performance comparisons) is also available.

Installation

MAGES itself does not have any dependencies, however, the tests are dependent on NUnit and the benchmarks use BenchmarkDotNet. Usually, MAGES should be installed via the NuGet package source. If this does not work for you, then clone the source and build MAGES yourself. Make sure that all unit tests pass.

The whole library was designed to be consumed from .NET 3.5 (or higher) applications. This means it is (amongst others) compatible with Unity / Mono 2.6. The NuGet package is available via the official package feed.

Get Me Started!

In the most simple case you are creating a new engine to hold a global scope (for variables and functions) and launch the interpretation.

var engine = new Mages.Core.Engine();
var result = engine.Interpret("sin(2) * cos(pi / 4)"); // 0.642970376623918

You can also go-ahead and make reusable blocks from snippets.

var expOne = engine.Compile("exp(1)");
var result = expOne(); // 2.71828182845905

Or you can interact with elements created by MAGES.

var func = engine.Interpret("(x, y) => x * y + 3 * sqrt(x)") as Mages.Core.Function;
var result = func.Invoke(new Object[] { 4.0, 3.0 }); // 18.0

Or even simpler (details are explained in the getting started document):

var func = engine.Interpret("(x, y) => x * y + 3 * sqrt(x)") as Mages.Core.Function;
var result = func.Call(4, 3); // 18.0

These are just some of the more basic examples. More information can be found in the documentation.

Documentation

The documentation is given in form of Markdown documents being placed in the doc folder of this repository. The following links are worth checking out:

If anything is missing, unclear, or wrong then either submit a PR or file an issue. See the following section on contributions for more information.

Contributions

Contributions in form of feature implementations or bug fixes are highly welcome, but need to be performed in an organized and consistent way. The contribution guidelines should be read before starting any work.

Contributions may also be taken in form of bug reports and feature requests. Long live open-source development!

Versioning

The rules of semver are our bread and butter. In short this means:

  1. MAJOR versions at maintainers' discretion following significant changes to the codebase (e.g., breaking API changes)
  2. MINOR versions for backwards-compatible enhancements (e.g., performance improvements, additional extensions)
  3. PATCH versions for backwards-compatible bug fixes (e.g., specification compliance bugs, support issues)

Hence: Do not expect any breaking changes within the same major version.

License

The MIT License (MIT)

Copyright (c) 2016-2018 Florian Rappl

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].