Skip to content
Shivam Gupta edited this page Nov 17, 2022 · 6 revisions

ℹ️ Introduction

Dynamic Expresso is an interpreter for simple C# statements written in .NET Standard 2.0.

  • It embeds its parsing logic, interprets C# statements by converting them to .NET lambda expressions or delegates
  • It allows you to create scriptable applications, execute .NET code without compilation or create dynamic LINQ statements
  • Global variables or parameters can be injected and used inside expressions. It doesn't generate assembly, but it creates an expression tree on the fly

✔️ Features

  • Expressions can be written using a subset of C# syntax (see Syntax section for more information)
  • Support for variables and parameters
  • Can generate delegates or lambda expression
  • Full suite of unit tests
  • Good performance compared to other similar projects
  • Partial support of generic, params array and extension methods (only with implicit generic arguments detection)
  • Partial support of dynamic (ExpandoObject for get properties, method invocation and indexes)
  • Partial support of lambda expressions (disabled by default, because it has a slight performance penalty)
  • Case insensitive expressions (default is case sensitive)
  • Ability to discover identifiers (variables, types, parameters) of a given expression
  • Small footprint, generated expressions are managed classes, can be unloaded and can be executed in a single appdomain
  • Easy to use and deploy, it is all contained in a single assembly without other external dependencies

🚫 Limitations

Dynamic Expresso doesn't support every C# syntaxes. The following are some of the examples which are not supported.
  • Multiline expressions
  • for/foreach/while/do operators
  • Array/list/dictionary initialization
  • Explicit generic invocation such as method(arg)
  • Lambda/delegate declarations are not supported, delegate and lambda are only supported as variables or parameters or as a return type of the expression
  • Array/list/dictionary element assignment
  • Other operations on dynamic objects