Skip to content

ExpressionEvaluator Todo List

Coding Seb edited this page Mar 3, 2021 · 39 revisions

ExpressionEvaluator can already do some fun things, but it could do more. Here is just a small list of ideas and todo stuff (maybe some will never be done, But it's a place to keep track of ideas). It's a kind of not dated roadmap.

More customization

  • Customization of the script evaluation part

More C# like things support

  • Manage Tuples
  • Add nameof keyword
  • Subscribe to event
  • Manage switch case

Optimization and/or doing things better

  • Speed up evaluations
    • Caching things and consider using expression tree or other intermediate format. (See)
    • Caching Properties delegates (Do not improve perfs significantly)
  • Better variables management
    • Declare struct and valuetypes without new keyword
    • Scope variables to code blocks (add an option for retrocompatibility)
  • Line and (position) in script exceptions
  • More self explained exceptions
  • Add standard syntax for method declaration (for now see issue #72 Declare methods in scripts)

Other

  • Create Func<> or Action<>
  • Return a Func<> or an Action<>
  • Validate code before evaluate (Hard to do without evaluating things)

Done

  • Manage ref method args (see #83)
  • Manage in method args (see #83)
  • Manage out method args (see #83)
  • Manage params methods args (see #83)
  • Add a Context object in addition to Variables Dictionary to allow direct access to it's methods, fields and properties
  • Manage List<>.ForEach
  • Transform an internal lambda to Action<> or Func<> when needed (To allow writing List<>.ForEach(x => {}))
  • Typed variables (In version 1.4.3.0 See Declare and init variables in scripts
  • Generic types inference (Optimistic way to inferate. Only looking backward for generics in the stack)
  • Add an optional var keyword for variables init. (Better for copy paste with C# code)
  • Manage structs assignation
  • Option to force integer eval as double
  • Manage numbers decimal separator and functions arguments separators
  • Manage sizeof keyword
  • Binary numbers
  • Hexadecimal numbers
  • ++ and -- as prefix operators
  • Dictionary initializers
  • Collection initializers
  • Objects initializers
  • throw and try catch exception
  • Manage ExpendoObject
  • Manage calling of Action and Func delegates
  • Manage ++ and -- for indexing
  • Manage assignation to indexer
  • Manage do while
  • Properties set assignation
  • Manage foreach
  • Manage continue keyword
  • Manage break keyword
  • Manage blocks in lambda body
  • Manage return keyword
  • Manage comments // and /* */
  • Manage Evaluate<type>(calc)
  • Manage chars
  • On the fly properties and methods evaluation
  • Manage Generic functions and types with <>
  • Manage ?: operator
  • Manage new Keyword
  • Manage multi line mode with ;? and = ++`...
  • Manage blocks like if for while...

Optimization and/or doing things better

  • Speed up evaluations
    • Manage inline namespaces faster
    • Option for caching namespace resolution
    • Option for caching type resolution
    • [Kept as this] Manage object creation faster (Activator.CreateInstance finally not so slow comparing to others strategy)

More customization

  • Custom operators (see #27 and Advanced Customization and Hacking)
    • On the fly operators
    • Operators Dictionary easy customisation
    • Add a way to allow aliases for existing operators like Or, And
    • Add a way to add some custom operators and corresponding implementations
    • Flexible length of the operators
    • Types : multiple operands vs Single operands (Maybe start with only 2 operands operators)
    • Take care of operators precedences (priorities)
  • Add generic types in VariableEvaluationEventArg and FunctionEvaluationEventArg for on the fly evaluations (A list of types when using <>)
  • On the fly static methods and/or property
  • Better onthe fly events priorities management with other evaluations (By adding 2 Pre events See #35)
  • On the fly parsing (event with current expression,ref parsing position and the stack)

Will not (or can not) be done for now

  • Find a way to manage extensions methods without the need to declaring the static type and without beeing too slow (snippet to add all extensions class provided here)

Table Of Content

Clone this wiki locally