Skip to content
Espen Skaufel edited this page Oct 7, 2018 · 9 revisions

Welcome to the Yale wiki!

Yale is yet another expression parser and evaluator library for .Net

Like other expression frameworks Yale evaluates string expressions like sqrt(a^2 + b^2) and name() = "Maria" at runtime. In Yale, these expressions are compiled to the Common Intermediate Language. This results in a blazing fast performance of expression evaluation after compilation. The primary design objective of Yale is to make a rather complex library as intuitive and easy to use as possible.

Yale is based on Flee with the intent to modernize and simplify the source code and usage. Yale uses the same grammar and compiler; however, the functionality does not match. If you have worked with Flee you can look at differences between Flee and Yale to see what is the difference.

Functionality

  • High performance
  • Automatic recalculation, including lazy recalculate
  • Expressions that relies on other expressions
  • Dependency management
  • Usage of public static methods in expressions
  • Support for all arithmetic operations
  • Support all base types as expression result
  • Uses the tried and tested Flee grammar

How do I use Yale?

Basic usage

var instance = new ComputeInstance();
instance.SetValue("a", 10);
instance.AddExpression("b", "2 * a")
var result = instance.GetResult("b");

//Update value
instance.SetValue("a", 15);
result = instance.GetResult("b"); // result == 30

More advanced examples are available as examples.

What is the use case for Yale?

Yale can be used in many applications, but when to use it is not obvious when one has never used a library like this. The library is suited for everything from states in bot frameworks to applications that need advances rules with a high level of dependencies and that can change at run-time.

What is the state of Yale?

Yale is in alpha and breaking changes should be expected. However most of the current work is focused on stabilization and bug-fixes. It should be safe for small applications and demos. Any bugs reported will be prioritized and feedback would be appreciated.

License

MIT License