|
1 | 1 | 
|
2 | 2 | # ExpressionEvaluator
|
3 | 3 |
|
| 4 | +| :warning: For now, I don't have time to maintain this repository. So if you have PR to fix some bugs. I'll be happy to review and merge it. Otherwise, I will no longer actively develop ExpressionEvaluator. If the current state of the lib do not suite your needs I suggest you look the [list of great alternative projects](#similar-projects) below. |
| 5 | +| --- | |
| 6 | + |
4 | 7 | A Simple Math and Pseudo C# Expression Evaluator in One [C# File](./CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs).
|
5 | 8 |
|
6 | 9 | And from version 1.2.0 can execute small C# like scripts
|
@@ -44,27 +47,52 @@ It is largely based on and inspired by the following resources [this post on st
|
44 | 47 | * [Live Demos](https://dotnetfiddle.net/Packages/41132/CodingSeb_ExpressionEvaluator)
|
45 | 48 | * [Try it](https://dotnetfiddle.net/up4x3W)
|
46 | 49 |
|
47 |
| -## And more is coming |
48 |
| -* [The Todo List](https://github.com/codingseb/ExpressionEvaluator/wiki/ExpressionEvaluator-Todo-List) |
49 |
| - |
50 | 50 | ## Similar projects
|
51 | 51 | ### Free
|
52 | 52 | * [NCalc](https://github.com/pitermarx/NCalc-Edge)
|
53 | 53 | * [Jint](https://github.com/sebastienros/jint) Support scripting but with Javascript
|
54 | 54 | * [NLua](https://github.com/NLua/NLua) use Lua language in C#
|
| 55 | +* [MoonSharp](https://github.com/moonsharp-devs/moonsharp/) |
55 | 56 | * [DynamicExpresso](https://github.com/davideicardi/DynamicExpresso/)
|
56 | 57 | * [Flee](https://github.com/mparlak/Flee)
|
| 58 | +* [Jace.Net](https://github.com/pieterderycke/Jace) |
| 59 | +* [Calculator](https://github.com/loresoft/Calculator) |
| 60 | +* [Westwind.Scripting](https://github.com/RickStrahl/Westwind.Scripting) |
57 | 61 | * [CS-Script](https://github.com/oleg-shilo/cs-script) Best alternative (I use it some times) -> Real C# scripts better than ExpressionEvaluator (But everything is compiled. Read the doc. Execution is faster but compilation can make it very slow. And if not done the right way, it can lead to [memory leaks](https://en.wikipedia.org/wiki/Memory_leak))
|
58 | 62 | * [Roslyn](https://github.com/dotnet/roslyn) The Microsoft official solution (For scripting [see](https://github.com/dotnet/roslyn/wiki/Scripting-API-Samples))
|
59 | 63 | * [MathParser](https://github.com/KirillOsenkov/MathParser) expression tree compiler and interpreter for math expressions. Heavily inspired by Roslyn.
|
| 64 | +* [YoowzxCalc](https://github.com/MarkusSecundus/YoowzxCalc) |
| 65 | +* [Scriban](https://github.com/scriban/scriban) |
| 66 | +* [WattleScript](https://github.com/WattleScript/wattlescript) |
| 67 | +* [AngouriMath](https://github.com/asc-community/AngouriMath) For advanced Math in C# |
| 68 | +* [Fluid](https://github.com/sebastienros/fluid) |
| 69 | +* [ClearScript](https://github.com/microsoft/ClearScript) |
| 70 | +* [Expressive](https://github.com/bijington/expressive) |
| 71 | +* [IronPython](https://github.com/IronLanguages/ironpython3) to execute python in .Net or .Net in python |
60 | 72 |
|
61 | 73 | ### Commercial
|
62 | 74 | * [Eval Expression.NET](http://eval-expression.net/)
|
| 75 | +* [mXparser](https://mathparser.org) (dual licensing) (Free for open source) |
| 76 | + |
| 77 | +### Projects that could help you build your own expression/script evaluator |
| 78 | +* [SuperPower](https://github.com/datalust/superpower) |
| 79 | +* [Sprache](https://github.com/sprache/Sprache) |
| 80 | +* [CSLY : C# lex and yacc](https://github.com/b3b00/csly) |
| 81 | +* [Lexepars](https://github.com/DNemtsov/Lexepars) |
| 82 | +* [Parlot](https://github.com/sebastienros/parlot) |
| 83 | +* [Irony](https://github.com/IronyProject/Irony) |
| 84 | +* [Pidgin](https://github.com/benjamin-hodgson/Pidgin) |
63 | 85 |
|
| 86 | +### Reading and resources |
| 87 | +* [Crafting interpreters](http://www.craftinginterpreters.com) |
| 88 | +* [Building a compiler](https://www.youtube.com/playlist?list=PLRAdsfhKI4OWNOSfS7EUu5GRAVmze1t2y) An excellent Youtube tutorial |
| 89 | +* Search for LEX, YACC, AST, Syntaxic trees... |
| 90 | + |
| 91 | + |
64 | 92 | I would say every C# evaluation libraries have drawbacks and benefits, ExpressionEvaluator is not an exception so choose wisely (Read docs and licences).
|
65 | 93 |
|
66 | 94 | The biggest difference of ExpressionEvaluator is that everything is evaluated on the fly, nothing is compiled or transpile nor in CLR/JIT/IL nor in lambda expressions nor in javascript or other languages stuffs.
|
67 |
| -So it can be slower in some cases (sometimes not) but it also avoid a lot of memory leaks. |
| 95 | +So it can be slower in some cases (sometimes not) but it also avoid a lot of memory leaks. It is clearly not optimized for big reuse of expressions as the expression is reevaluated every time (Filtering on big dataset for example). |
68 | 96 | It already allow to evaluate some small scripts.
|
69 | 97 | If you don't want an another .dll file in your project, you only need to copy one [C# file](./CodingSeb.ExpressionEvaluator/ExpressionEvaluator.cs) in your project. And it's [MIT licence](./LICENSE.md)
|
70 | 98 |
|
|
0 commit comments